pokeb / asi-http-request

Easy to use CFNetwork wrapper for HTTP requests, Objective-C, Mac OS X and iPhone
http://allseeing-i.com/ASIHTTPRequest
Other
5.78k stars 1.41k forks source link

when client set keep-alive,server keepalive_timeout is less,upload image(eg. size: 1M ) more times will fail. #394

Open shiqiang124 opened 10 years ago

shiqiang124 commented 10 years ago

bug https://github.com/pokeb/asi-http-request/issues/94 is still exist. ( the bug reproduce test code: https://github.com/shiqiang124/asi-http-request/blob/master/iPhone%20Sample/UploadViewController.m )

the bug happen need follow setting:

1.set keep-alive,and need Content-Type:multipart/form-data, image more than 1M request setShouldAttemptPersistentConnection:YES request setPersistentConnectionTimeoutSeconds:60 request setTimeOutSeconds:60 request setPostFormat:ASIMultipartFormDataPostFormat

  1. nginx keepalive_timeout 5s // less than setPersistentConnectionTimeoutSeconds
  2. don't use proxy (eg.Charles )
RbBtSn0w commented 10 years ago

It's about time out error.

setShouldAttemptPersistentConnection:NO

http://stackoverflow.com/questions/8317662/asihttprequest-request-sent-twice