I am using the following code to set up a chunked HTTP 1.1 request (the request itself is a SOAP one but I don't think this is particularly important):
NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:url];
...
NSInputStream *dataStream = [NSInputStream inputStreamWithFileAtPath:_tempFilePath];
[request setHTTPBodyStream:dataStream];
self.p_connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES];
This seems to work fine except when request gets too big, I can see that some packets get randomly dropped in WireShark - it flags it as "TCP Previous segment not captured". I think the size of the request only matters insomuch as the random dropping of the packets has more chance to happen, but that otherwise it is some more fundamental issue.
Does anybody have an idea what might be at play here? Is it the fault of NSURLConnection or the way I am using it?