curl-users
RE: hanging URL
Date: Thu, 21 Sep 2000 09:16:43 -0400
Sure enough -- that's what did it. I modified the sendf() call
on line 318 of http.c to look like this:
sendf(data->firstsocket, data,
"%s " /* GET/HEAD/POST/PUT */
"%s HTTP/1.0\r\n" /* path */
"%s" /* proxyuserpwd */
"%s" /* userpwd */
"%s" /* range */
"%s" /* user agent */
"%s" /* cookie */
"%s" /* host */
"%s" /* pragma */
"%s" /* accept */
"%s\015\012", /* referer */
Compiled the program and ran:
curl http://www.cbs.com/
Worked like a charm. Is this something that's worth implementing
in the distributed version? Is it possible to assemble the request
string in a buffer and then send it all at once?
Jason Priebe
WRAL OnLine
http://www.wral-tv.com/
> -----Original Message-----
> From: Daniel Stenberg [mailto:daniel_at_haxx.se]
> Sent: Wednesday, September 20, 2000 5:10 p.m.
> To: Curl Mailinglist
> Subject: RE: hanging URL
>
>
> On Wed, 20 Sep 2000, Priebe, Jason wrote:
>
> > The only obvious difference I can see so far is that the
> first two tools
> > sent hex 0x0D 0x0A 0x0D 0x0A to end their requests, and the
> second two
> > only sent 0x0D 0x0A.
> >
> > This is strange, since I definitely hit "return" twice
> within my telnet
> > session. And I would think that curl would send the CR-LF
> combination
> > twice.
>
> Try this:
>
> Curl normally sends its entire request in two write()s. The
> first write() is
> everything except the last CR-LF. Then it sends the final
> CR-LF separately.
> The reason for this, is that this way enables curl to fill in
> custom headers,
> cookies and whatever in between the write()s.
>
> So what you see is the first package. The second package
> should come later.
> However, if there's a TCP problem somewhere along the "road",
> it wouldn't
> surprise me if you can get this to work by sending everything
> in one single
> shot. (You only need to modify the curl source code slightly
> to test this
> theory -- of course you'll disable a few features but this is
> for testing.)
>
> --
> Daniel Stenberg -- curl project maintainer -- http://curl.haxx.se/
>
Received on 2000-09-21