Author: gonzalo
Date: 2005-06-26 01:51:18 -0400 (Sun, 26 Jun 2005)
New Revision: 46512
Modified:
trunk/mcs/class/System/System.Net/ChangeLog
trunk/mcs/class/System/System.Net/WebConnection.cs
trunk/mcs/class/System/System.Net/WebConnectionStream.cs
Log:
2005-06-26 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
* WebConnection.cs: if cnc.EndRead throws, mark the asyncresult as done.
* WebConnectionStream.cs: if we're done with the body of a chunk, don't
require the next chunk header to be there, as some servers might close
the connection (while also sending 'Connection: close').
Modified: trunk/mcs/class/System/System.Net/ChangeLog
===================================================================
--- trunk/mcs/class/System/System.Net/ChangeLog 2005-06-26 03:35:01 UTC (rev
46511)
+++ trunk/mcs/class/System/System.Net/ChangeLog 2005-06-26 05:51:18 UTC (rev
46512)
@@ -1,3 +1,10 @@
+2005-06-26 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
+ * WebConnection.cs: if cnc.EndRead throws, mark the asyncresult as done.
+ * WebConnectionStream.cs: if we're done with the body of a chunk, don't
+ require the next chunk header to be there, as some servers might close
+ the connection (while also sending 'Connection: close').
+
2005-06-22 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
* HttpWebRequest.cs: MS implementation follows redirects for POST. Seems
Modified: trunk/mcs/class/System/System.Net/WebConnection.cs
===================================================================
--- trunk/mcs/class/System/System.Net/WebConnection.cs 2005-06-26 03:35:01 UTC
(rev 46511)
+++ trunk/mcs/class/System/System.Net/WebConnection.cs 2005-06-26 05:51:18 UTC
(rev 46512)
@@ -711,7 +711,7 @@
WebExceptionStatus.ServerProtocolViolation, null);
}
- if ((done || nbytes == 0) &&
chunkStream.WantMore) {
+ if ((done || nbytes == 0) &&
chunkStream.ChunkLeft != 0) {
HandleError
(WebExceptionStatus.ReceiveFailure, null, "chunked EndRead");
throw new WebException ("Read error",
null, WebExceptionStatus.ReceiveFailure, null);
}
Modified: trunk/mcs/class/System/System.Net/WebConnectionStream.cs
===================================================================
--- trunk/mcs/class/System/System.Net/WebConnectionStream.cs 2005-06-26
03:35:01 UTC (rev 46511)
+++ trunk/mcs/class/System/System.Net/WebConnectionStream.cs 2005-06-26
05:51:18 UTC (rev 46512)
@@ -320,9 +320,16 @@
int nbytes = -1;
try {
nbytes = cnc.EndRead (result);
- } catch (Exception) {
+ } catch (Exception exc) {
+ lock (locker) {
+ pendingReads--;
+ if (pendingReads == 0)
+ pending.Set ();
+ }
+
nextReadCalled = true;
cnc.Close (true);
+ result.SetCompleted (false, exc);
throw;
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches