|
From: Uwe H. <uh...@bi...> - 2000-03-04 13:06:52
|
On Fri, Mar 03, 2000 at 09:25:17AM -0500, Brian St. Pierre wrote: > > > > > > > > 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. > > > > Nope. I also get it when connecting to my local apache. And the page I > > point it to, is just 2K big, so it can't be the size of the page either. > > Ok, I figured out the problem, haven't coded a solution yet. With HTTP/1.0, > a connection is created for every request. So when we do a GET with 1.0, > the server sends us the response and then closes the connection. Our socket > sees the EOF and the call to fread() completes. > > With HTTP/1.1, a single connection may be used for multiple requests. So > when we do the GET this time, the socket remains open for 17 seconds (I > timed the call to fread()). This is how long it takes to time out and be > closed by the server. > > There are a couple of different ways to solve this, some better than others. > The best is probably to implement more of the protocol; it provides a means > of knowing how long the "content" portion of the response will be and it > also provides a way for the client to tell the server that it wishes to > close the connection after the first GET. The last one sounds like the easiest one to implement, as the code of Express (at the moment) relies on the connection being closed. Later on we can start implementing HTTP/1.1 to a greater degree... I'll have a look at the respective RFC(s), soon... Uwe. -- Uwe Hermann <uh...@bi...> http://www.bingo-ev.de/~uh1763/index.html ----------------------------------------- :wq |