diff --git a/websocket-sharp/Ext.cs b/websocket-sharp/Ext.cs index 059cbb32..8b2255e1 100644 --- a/websocket-sharp/Ext.cs +++ b/websocket-sharp/Ext.cs @@ -424,7 +424,7 @@ namespace WebSocketSharp /// /// Determines whether the specified equals the specified , - /// and invokes the specified Action<int> delegate at the same time. + /// and invokes the specified Action<int> delegate at the same time. /// /// /// true if equals ; @@ -437,18 +437,12 @@ namespace WebSocketSharp /// A to compare. /// /// - /// An Action<int> delegate that references the method(s) called at - /// the same time as comparing. An parameter to pass to + /// An Action<int> delegate that references the method(s) called + /// at the same time as comparing. An parameter to pass to /// the method(s) is . /// - /// - /// isn't between 0 and 255. - /// internal static bool EqualsWith (this int value, char c, Action action) { - if (value < 0 || value > 255) - throw new ArgumentOutOfRangeException ("value"); - action (value); return value == c - 0; } diff --git a/websocket-sharp/HttpBase.cs b/websocket-sharp/HttpBase.cs index 85220b35..a7dbd402 100644 --- a/websocket-sharp/HttpBase.cs +++ b/websocket-sharp/HttpBase.cs @@ -122,6 +122,9 @@ namespace WebSocketSharp var buff = new List (); var cnt = 0; Action add = i => { + if (i == -1) + throw new EndOfStreamException ("The header cannot be read from the data source."); + buff.Add ((byte) i); cnt++; };