cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: public URL accepting POST multipart/form-data file upload?

From: Mohun Biswas <m_biswas_at_mailinator.com>
Date: Sun, 18 Jul 2004 21:30:23 -0400

Mohun Biswas wrote:

> My application, in which a custom client written with libcurl talks to a
> custom server implemented as a Java webapp, is exibiting a problem
> whereby uploading files works fine till they reach a size around 500MB,
> and I'm having trouble determining whether the problem is on the client
> or server. I'd really like to check my test case against a server that's
> known to handle large uploads correctly just in case the bug is with my
> web container or JDK or Jakarta Commons FileUpload.

Solved. For the record, it turns out that Tomcat (my development web
container on the server side) has a config parameter called
"connectionTimeout" which out of the box is set to 20 seconds. When the
uploaded file reaches a certain size it takes more than 20 seconds for
libcurl to prepare the file part (lots of brk() system calls) and the
server closes the connection. Thanks G-d for truss on Solaris.

One thing for libcurl though: is there a reason it couldn't report
something along the lines of "Server closed the connection" rather than
"Empty reply from server"? I probably would have been on the right track
much sooner if it had. You can see in the truss output that the errno
(ECONNRESET) is pretty clear:

         .
         .
         .
read(9, " X X X X X X X X X X X X".., 8192) = 8192
brk(0x214A6210) = 0
brk(0x214A8210) = 0
read(9, " X X X X X X X X X X X X".., 8192) = 8192
brk(0x214A8210) = 0
brk(0x214AA210) = 0
read(9, " X X X X X X X X X X X X".., 8192) = 8192
brk(0x214AA210) = 0
brk(0x214AC210) = 0
read(9, 0x0005749C, 8192) = 0
llseek(9, 0, SEEK_CUR) = 0x20000000
close(9) = 0
time() = 1090190796
send(4, " P O S T / n x / p m d".., 330, 0) = 330
poll(0xFFBFEBB8, 1, 1000) = 1
recv(4, 0x0004F2FC, 16383, 0) Err#131 ECONNRESET
time() = 1090190796
sigaction(SIGPIPE, 0xFFBFEB40, 0xFFBFEBC0) = 0

M.B.
Received on 2004-07-19