On Dec 27, 2012, at 19:10 , Rick Mann <rm...@latencyzero.com> wrote:

> My iOS app makes HTTP requests of my server. It caches the data for one of 
> the calls, and makes an If-Modified-Since request for it. The server returns 
> 304 if it has not been modified.
> 
> This works great on Wifi. But I'm seeing over 4G that my server gets the 
> request and makes the response, and about a minute later, the phone still 
> hasn't gotten the response, and eventually returns a timeout error.
> 
> This actually happens with two different devices about 30 miles apart, both 
> AT&T iPhone 5, one running one app, the other running a test app that uses 
> the same networking code.
> 
> Any ideas how to troubleshoot this? Thanks!

Turns out, I was trying to return a body with my 304 response, which is one of 
the few responses that is prohibited by the HTTP/1.1 spec from returning a 
body. Because there was a Content-Length: header specifying content, and some 
proxy between the phone and my server truncated the body (but did not remove 
the header, jerkwads), the NS networking code waited (im)patiently for a body 
that would never come.

Fixed the server to not return a body when returning 304, and all is well.


-- 
Rick




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to