[Modify] Polish it

master
sta 6 years ago
parent d0bf684d7c
commit d0c51a32e0

@ -170,9 +170,18 @@ namespace WebSocketSharp.Net
} }
set { set {
checkDisposedOrHeadersSent (); if (_disposed)
if (value < 0) throw new ObjectDisposedException (GetType ().ToString ());
throw new ArgumentOutOfRangeException ("Less than zero.", "value");
if (_headersSent) {
var msg = "The response has already been sent.";
throw new InvalidOperationException (msg);
}
if (value < 0) {
var msg = "Less than zero.";
throw new ArgumentOutOfRangeException (msg, "value");
}
_contentLength = value; _contentLength = value;
} }

Loading…
Cancel
Save