|
From: Brian S. P. <bst...@me...> - 2000-03-02 18:42:28
|
> On Wed, Mar 01, 2000 at 03:54:28PM -0500, Brian St . Pierre wrote: > > 2) We now do HTTP/1.1 GET's. This lets the > > http://express.sourceforge.net/ URL work. > > I get several seconds delay between the "Request sent."-message and I noticed this as well, but on a (sometimes) slow connection, I just thought the network was a bit sluggish. > Using a request of 'sprintf(buf, "GET %s HTTP/1.0\n\n", u->path);' works > quite nice though. Some servers don't support HTTP/1.0 anymore. You'll get an error message from http://express.sourceforge.net/, for example. > I telnetted to my apache directly and entered > > GET / HTTP/1.1\n > Host: localhost\n\n I did the same thing at sourceforge and yahoo. I thought telnet sent CR/LF pairs instead of just LF (see below)? > (the \n representing Enter, of course), which worked fine too, and AFAIK > your code does exactly the same thing, so I don't really know why this > happens... > > I tried to use '\r\n' and also '\r' instead of '\n', but that doesn't > work correctly either. I tried both of these as well. The code seems to mimic telnet. It is likely that using stdio streams (i.e. FILE*) is trying to buffer the input in such a way that kills performance. I can take a look at using setvbuf to turn buffering off. Or we could decide to use non-ANSI-C output (i.e. system-specific open/close/read/write); but I'd rather remain higher level and closer to standards. -Brian |