chicken-janitors
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-janitors] Re: [Chicken-bugs] #311: http-server and http-client


From: Chicken Scheme
Subject: [Chicken-janitors] Re: [Chicken-bugs] #311: http-server and http-client doesn't handle keep-alive very well.
Date: Fri, 30 Nov 2007 23:51:34 -0000

#311: http-server and http-client doesn't handle keep-alive very well.
-------------------------+--------------------------------------------------
  Reporter:  daishi      |       Owner:  sjamaan 
      Type:  defect      |      Status:  assigned
  Priority:  minor       |   Milestone:          
 Component:  extensions  |     Version:  2.6     
Resolution:              |    Keywords:          
-------------------------+--------------------------------------------------
Comment (by sjamaan):

 > Hi, I tried the code.
 > It looks file with HTTP/1.0.
 > But with HTTP/1.1, a response does not have Connection: close,
 > even if a request has Connection: close.
 > I found another weird behaviour with http-client connecting to lighttpd,
 > which fails to get http headers.

 I managed to trace the error to the way you're using http-server and http-
 client.  First, instead of printing the headers after outputting the
 header response, in trunk you now need to pass an alist of headers to the
 http:write-response-headers procedure.

 Second, because http-client is reusing existing connections, you need to
 read out the response body.  In your test code you read out the headers,
 but not the body.  Then, you do another request and proceed to read out
 from the same input port, which actually just continues the original read
 from that port and reads out the contents.  If you want to reuse a port
 (by saying connection: keep-alive), you will have to read out all the
 contents before issuing another request.  This also caused the lighttpd
 error.

 Have a look at the new attachment to see the correct code.  If you agree
 the bug is no longer there, please close the ticket.

-- 
Ticket URL: <http://trac.callcc.org/ticket/311#comment:13>
Chicken Scheme <http://www.call-with-current-continuation.org/>
The CHICKEN Scheme-to-C compiler

reply via email to

[Prev in Thread] Current Thread [Next in Thread]