[Top][All Lists]

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

NSURLConnection delays 30 seconds before returning chunked-mode response

From: Jens Alfke
Subject: NSURLConnection delays 30 seconds before returning chunked-mode response
Date: Thu, 1 Mar 2012 17:32:43 -0800

The chunked-mode parser in GNUstep seems to have trouble detecting EOF. What 
I’m seeing when I use NSURLConnection to GET a resource whose response is 
chunked, is that the data is fetched immediately, and then there’s an exactly 
30-second delay before the delegate is called.

Here’s part of a transcript with NSURLProtocol debug mode turned on. Note that 
the first logged message contains the entire response (including the 
zero-length chunk that signifies EOF), and then after a delay of exactly 29.997 
seconds the protocol reports reading another zero bytes (?!) Immediately after 
that second message my delegate method is called with the response body.

Anyone know for sure what’s going on here? My guess is that (a) the 
chunked-mode parser doesn’t convey to the NSURLProtocol that the end of the 
response has been reached; and then (b) after 30 seconds of inactivity the 
remote server closes the socket, triggering the protocol to realize that it’s 
got the entire response. If that’s so, I’m still not sure how to fix the 


2012-03-01 17:24:46.670 TouchTool[30208] <_NSHTTPURLProtocol: 0xa09c754> 
read 463 bytes: 'HTTP/1.1 200 OK
Transfer-Encoding: chunked
Server: CouchDB/1.0.1 (Erlang OTP/R14B)
Date: Fri, 02 Mar 2012 01:24:46 GMT
Content-Type: text/plain;charset=utf-8
Cache-Control: must-revalidate






2012-03-01 17:25:16.667 TouchTool[30208] <_NSHTTPURLProtocol: 0xa09c754> 
read 0 bytes: ''

Attachment: smime.p7s
Description: S/MIME cryptographic signature

reply via email to

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