cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: POST a large file over HTTPS to IIS-5 problem

From: Veselin Terzic <veselin.terzic_at_systems.dhl.com>
Date: Fri, 3 Jan 2003 11:35:05 -0700

Daniel,

I have a feeling that "curl" is not completely in accordance with HTTP RFC
2616 section 8.2.3.
I do not see Expect [expectation = "100-continue"] header sent by
"curl" before curl starts to dump data stream at the server.
In my case IIS 5 server does send 100-continue header, but looks like curl
has already started data stream.
I think it would be a good idea to add 100-continue expectation to curl in
case data stream is to follow HTTP headers.

 I use "curl --data-binary @/tmp/myfile ... etc ..." and I get the following
trace:

<snip SSL handshake>
== Info: issuer: /O=VeriSign Trust Network/OU=VeriSign,
Inc./OU=VeriSign
 International Server CA - Class 3/OU=www.verisign.com/CPS Incorp.by Ref.
LIABIL
ITY LTD.(c)97 VeriSign
=> Send header, 362 bytes (0x16a)
0000: POST /dx/automated/FilePost.aspx?Username=*****&Password=***** H
0040: TTP/1.1
0049: User-Agent: curl/7.10.3-pre3 (i686-pc-linux-gnu) libcurl/7.10.3-
0089: pre3 OpenSSL/0.9.6g zlib/1.1.3
00a9: Host: data.mycompany.com
00cb: Pragma: no-cache
00dd: Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
011f: Content-Length: 946114
0137: Content-Type: application/x-www-form-urlencoded
0168:
=> Send data, 0 bytes (0x0)
<= Recv header, 23 bytes (0x17)
0000: HTTP/1.1 100 Continue
<= Recv header, 27 bytes (0x1b)
0000: Server: Microsoft-IIS/5.0
<= Recv header, 37 bytes (0x25)
0000: Date: Fri, 03 Jan 2003 17:29:47 GMT
=> Send data, 16384 bytes (0x4000)

followed by a complete stream of data ...

and server sending TCP FIN, which is represented in trace as

== Info: Connection #0 left intact

What do you think?

Thanks
--veselin

----- Original Message -----
From: "Daniel Stenberg" <daniel_at_haxx.se>
To: "Curl Mailinglist" <curl-users_at_lists.sourceforge.net>
Sent: Wednesday, December 18, 2002 2:45 AM
Subject: Re: POST a large file over HTTPS to IIS-5 problem

> On Mon, 16 Dec 2002, Veselin Terzic wrote:
>
> > curl 7.10.2 (i686-pc-linux-gnu) libcurl/7.10.2 OpenSSL/0.9.6g zlib/1.1.3
>
> > I have tried to lower CURL_MAX_WRITE_SIZE to 10K and then to 1K, but
that
> > didn't make any difference, although it looks like SSL_write() was the
> > issue.
> >
> > I've noticed 3 different behaviors:
> >
> > 1. file size 3.5K, no errors, i.e. I don't get any "Send header, 0
bytes"
> > 2. file size 1 MB I get a lot of "Send header, 0 bytes" messages, but
curl
> > recovers and POSTs file successfully.
>
> The reason for the "Send header, 0 bytes" message is when curl tries to
send
> data but it can't due to the socket being "full" and thus it loops and
> retries again.
>
> This "loop system" is severely brain-damaged as it doesn't wait for the
> socket to become writable before trying again so it just tries and tries
in a
> senseless manner.
>
> This approach has been changed since 7.10.2 and will be a lot smarter and
> better in 7.10.3.
>
> > 3. file size 6.6 MB I get the error below and file cannot be posted .
>
> I does however not completely explain this though. The stupid send system
> explains the many failed send attempts.
>
> But, it is not unlikely that the server sends something back to the client
> while the post is being done, and if curl doesn't receive that data it may
> not like the situation and finally end it. I don't know if this is what
> happens, but it's a theory.
>
> > == Info: SSL_write() return error 5
>
> Can you add 'errno' to that error message and rebuild (lib/send.c around
line
> 240) ? The 5 mentioned above is the SSL error SSL_ERROR_SYSCALL and
> supposedly, errno might contain some more details on this particular error
> case.
>
> --
> Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:
> With Great Power, Comes Great Responsibility
> Learn to use your power at OSDN's High Performance Computing Channel
> http://hpc.devchannel.org/
>

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-01-03