using System.Threading;\r
using System.Net;\r
\r
-\r
-\r
namespace System.Net\r
{\r
[Serializable]\r
{\r
[MonoTODO]\r
get{return _provider.GetX509Certificates();}\r
+ [MonoNotSupported("")]\r
+ set { throw new NotImplementedException (); }\r
}\r
\r
public string Connection\r
\r
string val = value;\r
if (val != null)\r
- val = val.Trim ().ToLower ();\r
+ val = val.Trim ().ToLower (CultureInfo.InvariantCulture);\r
\r
if (val == null || val.Length == 0)\r
{\r
throw new InvalidOperationException("Connection already opened");\r
string val = value;\r
if (val != null)\r
- val = val.Trim ().ToLower ();\r
+ val = val.Trim ().ToLower (CultureInfo.InvariantCulture);\r
\r
if (val == null || val.Length == 0)\r
{\r
}\r
\r
public DateTime IfModifiedSince\r
- {
+ {\r
get\r
{\r
string str = Headers["If-Modified-Since"];\r
}\r
string val = value;\r
if (val != null)\r
- val = val.Trim ().ToLower ();\r
+ val = val.Trim ().ToLower (CultureInfo.InvariantCulture);\r
\r
if (val == null || val.Length == 0)\r
{\r
{\r
_provider.Abort();\r
// _connection.disconnect();\r
-// _haveResponse = true;
-// //aborted = true;
+// _haveResponse = true;\r
+// //aborted = true;\r
// if (_asyncWrite != null)\r
-// {
-// GHWebAsyncResult r = _asyncWrite;
-// WebException wexc = new WebException ("Aborted.", WebExceptionStatus.RequestCanceled);
-// r.SetCompleted (false, wexc);
-// r.DoCallback ();
-// _asyncWrite = null;
-// }
-//
+// {\r
+// GHWebAsyncResult r = _asyncWrite;\r
+// WebException wexc = new WebException ("Aborted.", WebExceptionStatus.RequestCanceled);\r
+// r.SetCompleted (false, wexc);\r
+// r.DoCallback ();\r
+// _asyncWrite = null;\r
+// }\r
+//\r
// if (_asyncRead != null)\r
-// {
-// GHWebAsyncResult r = _asyncRead;
-// WebException wexc = new WebException ("Aborted.", WebExceptionStatus.RequestCanceled);
-// r.SetCompleted (false, wexc);
-// r.DoCallback ();
-// _asyncRead = null;
-// }
-//
+// {\r
+// GHWebAsyncResult r = _asyncRead;\r
+// WebException wexc = new WebException ("Aborted.", WebExceptionStatus.RequestCanceled);\r
+// r.SetCompleted (false, wexc);\r
+// r.DoCallback ();\r
+// _asyncRead = null;\r
+// }\r
+//\r
//// if (abortHandler != null)\r
-//// {
+//// {\r
//// try\r
-//// {
-//// abortHandler (this, EventArgs.Empty);
+//// {\r
+//// abortHandler (this, EventArgs.Empty);\r
//// }\r
-//// catch {}
-//// abortHandler = null;
-//// }
-//
+//// catch {}\r
+//// abortHandler = null;\r
+//// }\r
+//\r
// if (_writeStream != null)\r
-// {
+// {\r
// try\r
-// {
-// _writeStream.Close ();
-// _writeStream = null;
+// {\r
+// _writeStream.Close ();\r
+// _writeStream = null;\r
// }\r
-// catch {}
-// }
-//
+// catch {}\r
+// }\r
+//\r
// if (_response != null)\r
-// {
+// {\r
// try\r
-// {
-// _response.Close ();
-// _response = null;
+// {\r
+// _response.Close ();\r
+// _response = null;\r
// }\r
-// catch {}
+// catch {}\r
// }\r
}\r
\r
- public void AddRange (int range)
- {
- AddRange ("bytes", range);
- }
-
- public void AddRange (int from, int to)
- {
- AddRange ("bytes", from, to);
- }
-
- public void AddRange (string rangeSpecifier, int range)
- {
+ public void AddRange (int range)\r
+ {\r
+ AddRange ("bytes", range);\r
+ }\r
+\r
+ public void AddRange (int from, int to)\r
+ {\r
+ AddRange ("bytes", from, to);\r
+ }\r
+\r
+ public void AddRange (string rangeSpecifier, int range)\r
+ {\r
if (rangeSpecifier == null)\r
throw new ArgumentNullException ("rangeSpecifier");\r
string value = Headers ["Range"];\r
if (value == null || value.Length == 0)\r
value = rangeSpecifier + "=";\r
- else if (value.ToLower ().StartsWith (rangeSpecifier.ToLower () + "="))\r
+ else if (value.StartsWith (rangeSpecifier.ToLower () + "=", StringComparison.InvariantCultureIgnoreCase))\r
value += ",";\r
else\r
throw new InvalidOperationException ("rangeSpecifier");\r
- Headers.RemoveAndAdd ("Range", value + range + "-");
- }
-
- public void AddRange (string rangeSpecifier, int from, int to)
- {
+ Headers.RemoveAndAdd ("Range", value + range + "-");\r
+ }\r
+\r
+ public void AddRange (string rangeSpecifier, int from, int to)\r
+ {\r
if (rangeSpecifier == null)\r
throw new ArgumentNullException ("rangeSpecifier");\r
if (from < 0 || to < 0 || from > to)\r
string value = Headers ["Range"];\r
if (value == null || value.Length == 0)\r
value = rangeSpecifier + "=";\r
- else if (value.ToLower ().StartsWith (rangeSpecifier.ToLower () + "="))\r
+ else if (value.StartsWith (rangeSpecifier.ToLower () + "=", StringComparison.InvariantCultureIgnoreCase))\r
value += ",";\r
else\r
throw new InvalidOperationException ("rangeSpecifier");\r
- Headers.RemoveAndAdd ("Range", value + from + "-" + to);
+ Headers.RemoveAndAdd ("Range", value + from + "-" + to);\r
}\r
\r
public override Stream GetRequestStream()\r
return _provider.GetResponse();\r
}\r
/*\r
- private void CommonChecks (bool putpost)
- {
- string method = _connection.getRequestMethod();
-
- if (method == null)
- throw new ProtocolViolationException ("Method is null.");
-
- bool keepAlive = _headers["Keep-Alive"] == null;
- bool allowBuffering = true;
- bool sendChunked = true;
- long contentLength = _connection.getContentLength();
-
- if (putpost && ((!keepAlive || (contentLength == -1 && !sendChunked)) && !allowBuffering))
- throw new ProtocolViolationException ("Content-Length not set");
-
- string transferEncoding = TransferEncoding;
- if (!sendChunked && transferEncoding != null && transferEncoding.Trim () != "")
- throw new ProtocolViolationException ("SendChunked should be true.");
+ private void CommonChecks (bool putpost)\r
+ {\r
+ string method = _connection.getRequestMethod();\r
+\r
+ if (method == null)\r
+ throw new ProtocolViolationException ("Method is null.");\r
+\r
+ bool keepAlive = _headers["Keep-Alive"] == null;\r
+ bool allowBuffering = true;\r
+ bool sendChunked = true;\r
+ long contentLength = _connection.getContentLength();\r
+\r
+ if (putpost && ((!keepAlive || (contentLength == -1 && !sendChunked)) && !allowBuffering))\r
+ throw new ProtocolViolationException ("Content-Length not set");\r
+\r
+ string transferEncoding = TransferEncoding;\r
+ if (!sendChunked && transferEncoding != null && transferEncoding.Trim () != "")\r
+ throw new ProtocolViolationException ("SendChunked should be true.");\r
}\r
*/\r
\r
}\r
\r
public override Stream EndGetRequestStream(IAsyncResult asyncResult)\r
- {
+ {\r
return _provider.EndGetRequestStream(asyncResult);\r
}\r
\r
\r
\r
#endregion\r
+#if NET_2_0\r
+ public DecompressionMethods AutomaticDecompression\r
+ {\r
+ get {\r
+ throw new NotSupportedException ();\r
+ }\r
+ set {\r
+ throw new NotSupportedException ();\r
+ }\r
+ }\r
+#endif\r
\r
}\r
-}
\ No newline at end of file
+}\r