On 20/05/2004, at 23:48, Geoffrey Talvola wrote:
Kenneth Brown wrote:
This is driving me swiftly insane.

I'm working on a page that uploads images. I've tried a few ways of
pulling the file data out of the request and writing it to
disk, but it
always ends up corrupted and/or truncated (I'm not sure which)
...

I can't get this to fail on Windows, but I do see some suspicious-looking
code in WebKit/Adapters/mod_webkit2/mod_webkit.c.


This loop at line 391:

            do {
                aprlen=len;
                rv = apr_send(aprsock, data, &aprlen);
                len = len-aprlen;
            } while (len >0 && rv==APR_SUCCESS);

seems broken because if the apr_send is unable to send the whole length of
data at once, it will try to resend from the beginning of the data instead
of advancing the pointer by the amount sent. This would result in a small
block of repeated data which is exactly what you're seeing. Try this and
see if it helps:


            do {
                aprlen=len;
                rv = apr_send(aprsock, data, &aprlen);
                len = len-aprlen;
                data += aprlen;
            } while (len >0 && rv==APR_SUCCESS);

- Geoff

Brilliant, Geoff! This has fixed upload corruption on my system. Hopefully it will also fix the intermittent lockups that I'm getting too, but I won't know for a few weeks.


I guess that you'll stick this in CVS. I'm to risk-averse to use CVS so I'm running 0.8.1.


Regards,

  Oliver



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to