Closed rajanbalana closed 6 years ago
Environment:
OS: iOS 11 Networking Library: AFNetworking (2.6.3)
Steps to reproduce:
Step 1: Make a request to the HTTPS Server, request type should be Multi-part POST
Step 2: Observe till the request timeout. You will see the following error:
Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={NSUnderlyingError=0x600000c43e40 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, NSErrorFailingURLStringKey=URL_HERE, NSErrorFailingURLKey=URL_HERE, _kCFStreamErrorDomainKey=4, _kCFStreamErrorCodeKey=-2102, NSLocalizedDescription=The request timed out.}
Let me know, if you need any more details
Thanks for the info. Are you sure the timeout is related with the netfox e.g if you disable netfox the request is executed successfully?
Absolutely. I tried the same, as soon as I disable the library. Request goes through.
Is it easy to execute the same request using Apple's standard API + netfox?
Yes. It must be very straight-forward. However, I haven't tried the same.
I meant if it is easy you to try it :)
@kasketis I uploaded a quick test application below. I'm not quite sure what's going wrong, would you be able to check it out?
Here is the toilet these posts are going to, so you can see what was sent.
As you can see the normal posts work, and multipart works if you comment out NFX.start()
in the view controller, but the multipart requests aren't going through with Netfox enabled.
Don't judge my code :P
P.S. no, there's no viruses in the zip. Here's proof
Also, I noticed when we do a regular post, the "Request" column doesn't show my [foo:bar]
dictionary, but it does on the multipart post. I wonder what's up with that?
Thanks @Janglinator! I reproduced the timeout issue but I want to dive into it more. Regarding the body issue you mentioned above, I think it is related with this (check the radar and the #16 ) You can view it on multipart possibly because it sent as httpBodyStream and not as httpBody
I have same issue when using Alamofire to upload file with a stream, 1.10.5 does not have this issue.
Netfox 1.10.5 doesn’t have this issue? Interesting!
@Janglinator file uploading can success when I use 1.10.5, but it will be timeout with last version.
Hey, Did you get the time to look into the issue? I tried to look into the code but was unable to understand the underlying issue.
I think that issue is related to this pull. https://github.com/kasketis/netfox/pull/102. There is an inputstream that is open / read simultaneous by 2 actors. And this may cause some callbacks/delegates to not be triggered.
Any update?
hey we've made a pull request for this issue see https://github.com/kasketis/netfox/pull/120
@alextud That works! I have integrated your fork into my project. Thanks a ton!
As far I see was fixed by @alextud , and his update already was merged đź‘Ť , so, if anyone still get any issue regarding this let us know
not sure how is this fixed. We see same behaviour in v1.15.0 (any above 1.10.5) when posting multipart forms. Adding NFXProtocol.self
to URLSessionConfiguration doesn't help either
same as @RolandasRazma
Still getting same issue in 1.9.0. @felipeflorencio can you please look into this
Still getting same issue in 1.9.0. @felipeflorencio can you please look into this
I agree with you, I still have this issue.
Hi, Please provide more details about the issue (what version do you use, request executed natively or via 3rd party library, steps to reproduce, etc)