Our app is a BI product to analyze data. When run a report, we send a series of Http Requests from mobile client to server, and after upgrading to ios10, it always gets error alert (error code=1005, error domain=KCFErrorDomainCFNetwork). After investigation, we find Xcode does not send last http request's body, which results a bad request to server. Also, if we set a network proxy in device, this error will not happen. All requests could succeed. And when we debug the issue, if we delay to send out the last request for some seconds, it could succeed too. This issue only happen in ios10.
I will explain how we investigate the issue.
1. Run a report, and the client will send out a series of http requests. And in the end, the mobile client get an error: error code=1005, error domain=KCFErrorDomainCFNetwork.
2. Install wireshark on server. Through wireshark, we could see server send a response: 400 Bad Request. And we find the corresponding http request's body is missing, which has parameters. It is always the last http request having the issue.
3. Use CFnetwork Diagnostics to record network traffic. Then we get detail network logs through device. Normally, CF network Diagnostics will have below log to send request body:
2016-08-19 14:21:45.774895 MicroStrategy[695:281935] CFNetwork Diagnostics [3:1540] 14:21:45.774 { Did Send Body: (null) Loader: <CFMutableURLRequest 0x1741b8c60 [0x1a831fbb8]> {url = [3:1540]
But for last http request, it does not have such information. And we are sure we have set the body correctly, which could be seen from the log.