// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#if NET_2_0
+
+using System.IO;
using System.Net.Sockets;
using System.Runtime.InteropServices;
namespace System.Net {
class ChunkedInputStream : RequestStream {
bool disposed;
- ChunkStream decoder;
+ MonoChunkStream decoder;
HttpListenerContext context;
bool no_more_data;
}
}
- public ChunkedInputStream (HttpListenerContext context, Socket sock,
+ public ChunkedInputStream (HttpListenerContext context, Stream stream,
byte [] buffer, int offset, int length)
- : base (sock, buffer, offset, length)
+ : base (stream, buffer, offset, length)
{
this.context = context;
WebHeaderCollection coll = (WebHeaderCollection) context.Request.Headers;
- decoder = new ChunkStream (coll);
+ decoder = new MonoChunkStream (coll);
}
- public ChunkStream Decoder {
+ public MonoChunkStream Decoder {
get { return decoder; }
set { decoder = value; }
}
ares.AsyncWaitHandle.WaitOne ();
if (my_ares.Error != null)
- throw new HttpListenerException (400, "I/O operation aborted.");
+ throw new HttpListenerException (400, "I/O operation aborted: " + my_ares.Error.Message);
return my_ares.Count;
}
}
}
}
-#endif