+2004-04-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * WebConnectionStream.cs: avoid the exception when getting the content
+ length if possible.
+
2004-03-29 Lluis Sanchez Gual <lluis@ximian.com>
* HttpWebRequest.cs: Use a lock block instead of Monitor.Enter/Exit, so
the lock is released in case of exception (for example, a
ThreadAbortException). This also "fixes" bug #52417.
Beware, this requires a runtime update (due to a bug in Monitor.Exit).
- * ServicePoint.cs: Changed method from internal to private, since it is not
- called from outside the class.
+ * ServicePoint.cs: Changed method from internal to private, since it
+ is not called from outside the class.
2004-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
isRead = true;
pending = new ManualResetEvent (true);
this.cnc = cnc;
- try {
- contentLength = Int32.Parse (cnc.Data.Headers ["Content-Length"]);
- } catch {
+ string clength = cnc.Data.Headers ["Content-Length"];
+ if (clength != null && clength != "") {
+ try {
+ contentLength = Int32.Parse (clength);
+ } catch {
+ contentLength = Int32.MaxValue;
+ }
+ } else {
contentLength = Int32.MaxValue;
}
}