We're sometimes getting a timeout on a HttpWebRequest response. Some data is
received, but not all, resulting in an exception in
WebConnectionStream.Read()
The request is over SSL and the response is using chunked transfer encoding.
Bypassing one of these 2 (i.e. chunked over http or non-chunked over https)
solves the problem for this specific instance. As we only have this problem
with a very few requests, there is no way to be certain that this solves the
actual problem or only circumvents our only reproducible case.
However, I might have found a cause in WebConnection.BeginRead() an was
wondering if anyone can confirm this:

Here is a (simplified) part of WebConnection.BeginRead():
1.      if (!chunkedRead || (!chunkStream.DataAvailable && 
chunkStream.WantMore))
{
2.              result = nstream.BeginRead (buffer, offset, size, cb, state);
3.              cb = null;
4.      }
5.
6.      if (chunkedRead) {
7.              WebAsyncResult wr = new WebAsyncResult (cb, state, buffer, 
offset,
size);
8.              wr.InnerAsyncResult = result;
9.              ...
10.             return wr;
11.     }

When chunkStream has only read a part of a chunk, then the 2nd part of line
1 will be true. However, line 2 directly reads from the HttpsClientStream to
the buffer. And so, bypassing data which is still in the chunkedStream.


Robin

Monotouch: 5.2.12

--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/Response-timeout-on-HttpWebRequest-with-chunked-encoding-https-tp4655607.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to