Commit Graph
21 Commits
Author SHA1 Message Date
Martin Baulig 288489d637 [http]: Correctly handle partial chunk sizes; fixes #20583. 2014-07-25 00:37:16 +02:00
Martin Baulig 861d495951 Fix WebConnectionStream.CheckComplete() logic for chunked encoding. 2014-02-13 13:22:19 +01:00
Gonzalo Paniagua Javier 0ec96ead95 Do not attempt to write 0 bytes.
Fixes bug #4669.
2012-04-27 15:43:52 -04:00
Gonzalo Paniagua Javier 41b91a23a2 Last commit was not entirely correct... 2012-03-16 00:31:34 -04:00
Gonzalo Paniagua Javier 864d354b59 If we read an entire chunk, return it in the next read operation
When waiting for the chunk trailer, we can return the data read
	so far.
2012-03-13 11:57:51 -04:00
Gonzalo Paniagua Javier bd6f2b765a Chunked read error reporting improvement
Reset the chunked read variables before reading the chunk size and
	provide a better error in case of a protocol problem.
2012-02-10 02:14:36 -05:00
Gonzalo Paniagua Javier cf322b224a 2010-04-20 Gonzalo Paniagua Javier <[email protected]>
* ChunkStream.cs: ignore chunk extensions when reading the chunk
	size. Fixes bug #597556.


svn path=/trunk/mcs/; revision=155815
2010-04-20 15:54:28 +00:00
Gonzalo Paniagua Javier 6b5d46c6d7 2008-10-06 Gonzalo Paniagua Javier <[email protected]>
* ChunkStream.cs: (ReadTrailer) make sure the array access is not out
	of bounds. Fixes bug #322715.


svn path=/trunk/mcs/; revision=115003
2008-10-06 20:35:46 +00:00
Gonzalo Paniagua Javier 5bff5c3630 2006-02-07 Gonzalo Paniagua Javier <[email protected]>
* ChunkedInputStream.cs:
	* ChunkStream.cs: handle partial trailers and zero reads. Patch by Pawel
	Sakowski.


svn path=/trunk/mcs/; revision=56661
2006-02-08 01:37:58 +00:00
Gonzalo Paniagua Javier 3e700ee551 2005-11-17 Gonzalo Paniagua Javier <[email protected]>
* HttpListenerPrefixCollection.cs:
	* EndPointListener.cs:
	* HttpStreamAsyncResult.cs:
	* HttpListenerContext.cs:
	* HttpListenerBasicIdentity.cs:
	* AuthenticationSchemeSelector.cs:
	* HttpListener.cs:
	* WebHeaderCollection.cs:
	* ListenerPrefix.cs:
	* HttpListenerException.cs:
	* HttpResponseHeader.cs:
	* EndPointManager.cs:
	* HttpListenerRequest.cs:
	* HttpRequestHeader.cs:
	* BindIPEndPoint.cs:
	* ResponseStream.cs:
	* ChunkedInputStream.cs:
	* HttpStatusCode.cs:
	* ListenerAsyncResult.cs:
	* ChunkStream.cs:
	* HttpConnection.cs:
	* HttpUtility.cs:
	* HttpListenerResponse.cs:
	* RequestStream.cs: initial implementation of HttpListener. There are
	a few TODOs left (cookies, HTTPS) but almost everything else is in.


svn path=/trunk/mcs/; revision=53169
2005-11-17 12:03:25 +00:00
Gonzalo Paniagua Javier 7a23a83534 2004-12-04 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: handle errors on chunked streams. Fixes bug #66858.
	* ChunkStream.cs: added error checking all over.

	* HttpWebRequest.cs: throw the exception received in SetResponseError
	if we already have a response.
	(SetRequestData): Don't nest the exception if it's a WebException.


svn path=/trunk/mcs/; revision=37075
2004-12-04 11:52:31 +00:00
Gonzalo Paniagua Javier ccc7c27707 2004-11-09 Gonzalo Paniagua Javier <[email protected]>
* ChunkStream.cs: simplified condition for WantMore property.

	* WebConnection.cs: in Connect(), finish any pending reads we might
	have for chunked data. Ignore possible blank lines at the very
	beginning of the server response. Honor user set KeepAlive in
	HttpWebRequest for HTTP/1.1 connections. Thanks to Eyal Alayuf for
	his suggestions and code.

svn path=/trunk/mcs/; revision=35934
2004-11-10 00:26:30 +00:00
Gonzalo Paniagua Javier 7f0c264c40 2004-10-25 Gonzalo Paniagua Javier <[email protected]>
* ChunkStream.cs:
	(WantMore): we're not done until we get a 0 chunk size and the trailer.
	The 0 can be expressed as more than one character too (ie, 000000).

	* HttpWebRequest.cs: new argument in SetResponseError.
	* WebConnection.cs: added argument to HandleError as a hint for
	debugging.
	(Connect): make the chunked stream be in the expected state when
	reusing.

	* WebConnectionStream.cs: removed unused method (ResetWriteBuffer).

svn path=/trunk/mcs/; revision=35312
2004-10-25 21:26:55 +00:00
Duncan Mak 24f5ef2c44 Add MIT license to System.dll
svn path=/trunk/mcs/; revision=30054
2004-06-21 18:02:11 +00:00
Gonzalo Paniagua Javier 671f8b5ce6 2004-06-06 Gonzalo Paniagua Javier <[email protected]>
* ChunkStream.cs: added ChunkLeft property.
	* WebConnection.cs:
	(EndRead): when using small byte arrays to read from a chunked stream,
	ensure we've read the chunk size and try to fulfill the request
	completely. fixes bug 59653.

svn path=/trunk/mcs/; revision=28915
2004-06-06 17:41:06 +00:00
Gonzalo Paniagua Javier c48e993d10 2004-02-12 Gonzalo Paniagua Javier <[email protected]>
* ChunkStream.cs: use an array of buffers instead of a MemoryStream for
	storing the chunks. This way, we won't miss traling data from the
	previous chunk when a new one is received before the other is fully
	read.

svn path=/trunk/mcs/; revision=23004
2004-02-12 00:50:34 +00:00
Gonzalo Paniagua Javier 9718b1dc86 2004-02-10 Gonzalo Paniagua Javier <[email protected]>
* ChunkStream.cs:
	* WebConnection.cs: fixed bug that caused ChunkStream to return 0 on
	Read if it have not yet received any byte of the body but is expecting
	a body.

svn path=/trunk/mcs/; revision=22944
2004-02-10 14:47:34 +00:00
Lluis Sanchez f2ab3f236a * ChunkStream.cs: The "size" parameter of Write is not the number of bytes
to write, but the last offset to be written. Thus, in WriteAndReadBack,
	since "read" is not an offset but the number of bytes, it must be added to
	the offset. Maybe it would be a good idea to change the name of the
	parameter, since it is confusing. This should fix bug #52591.

svn path=/trunk/mcs/; revision=22161
2004-01-16 11:37:40 +00:00
Gonzalo Paniagua Javier 6873f63f25 2003-07-20 Gonzalo Paniagua Javier <[email protected]>
* ChunkStream.cs:
	(WantMore): true if we've not received the last chunk yet. Fixes
	bug #45463. Thanks to Miguel for tracking this down and providing a
	test case.

	* WebConnection.cs: removed bogus ^M's.

	* WebHeaderCollection.cs: provide more info when the header or value is
	wrong.

svn path=/trunk/mcs/; revision=16441
2003-07-20 11:29:09 +00:00
Andreas N 84c5f4a194 2003-07-15 Andreas Nahr <[email protected]>
* ChunkStream.cs: Removed unused members
	* IPAddress.cs: Removed unused exception variable, fixes compiler warning
	* WebConnection.cs: Removed unused exception variables, fixes compiler warnings

svn path=/trunk/mcs/; revision=16260
2003-07-15 10:07:15 +00:00
Gonzalo Paniagua Javier cc8432099d Reworked HttpWebRequest and related classes.
svn path=/trunk/mcs/; revision=15149
2003-06-06 06:57:36 +00:00