Commit Graph
28 Commits
Author SHA1 Message Date
Gonzalo Paniagua Javier 0b019a73d4 [HttpListener] Fix keep-alive connections
We were removing the connection in the wrong place.
	Also unbind the context in other error situations like a read failure
	after the headers are in.
2011-03-22 11:21:28 -04:00
Gonzalo Paniagua Javier 79a054063a [HttpListener] Avoid contention
-Lock-free reads from registered listeners.
	-Don't register the context until *all* the setup steps are done.
2011-03-14 17:59:51 -04:00
Gonzalo Paniagua Javier d420dafa92 [HttpListener] Plug leak. 2011-03-11 01:46:04 -05:00
Gonzalo Paniagua Javier 87ee560127 [HttpListener] Memory use reductions 2011-03-10 00:44:56 -05:00
Gonzalo Paniagua Javier eae45fd704 [HttpListener] Close idle connections on Stop()
Idle connections that never received any data or had ever been
	associated to a listener are properly closed now when the endpoint is
	closed or the last listener they used is closed.
	Fixes a bunch of tests in System.ServiceModel.
2011-02-15 01:52:50 -05:00
Gonzalo Paniagua Javier b061ae7569 [HttpListener] Small improvements
Less allocations in managed and unmanaged code.
2011-02-13 08:18:57 -05:00
Gonzalo Paniagua Javier e71a9ba492 Avoid killing the thread if socket already null
In some weird cases socket is null when we try to close it.
2010-11-01 18:54:14 -04:00
Gonzalo Paniagua Javier d20e427694 Add connection timers and reuses
Use a timer to handle read timeouts and extend reuses to regular
	connections, not just chunked. The timer is set to 90s for the first
	request and 15s for subsequent requests.
2010-10-25 20:27:48 -04:00
Marek Safar aad016fd87 Clean up few more warnings 2010-10-15 15:20:25 +01:00
Miguel de Icaza f47e5fe6a6 2010-03-20 Miguel de Icaza <[email protected]>
* Eliminate warnings in a bunch of places.

svn path=/trunk/mcs/; revision=153952
2010-03-20 23:09:06 +00:00
Miguel de Icaza 11ca00c93b 2010-03-19 Miguel de Icaza <[email protected]>
* Eliminate warnings in a bunch of places.

svn path=/trunk/mcs/; revision=153923
2010-03-19 21:46:30 +00:00
Gonzalo Paniagua Javier 8df3b9fd32 2010-03-09 Gonzalo Paniagua Javier <[email protected]>
* HttpConnection.cs: set the right position when a CR is found.
	Fixes bug #577891.


svn path=/trunk/mcs/; revision=153309
2010-03-09 07:45:32 +00:00
Gonzalo Paniagua Javier cddd78ded6 2010-03-09 Gonzalo Paniagua Javier <[email protected]>
* HttpListener.cs:
	* HttpListenerRequest.cs:
	* ListenerAsyncResult.cs:
	* HttpConnection.cs: make sure there is no pending input when reusing
	the connection.


svn path=/trunk/mcs/; revision=153300
2010-03-09 06:05:10 +00:00
Gonzalo Paniagua Javier f512a21cb8 2009-09-15 Gonzalo Paniagua Javier <[email protected]>
* HttpListenerRequest.cs: add the right status code.
	* HttpConnection.cs: exception might come from more places when
	reading the input. Catch all of them.


svn path=/trunk/mcs/; revision=142004
2009-09-16 01:27:36 +00:00
Gonzalo Paniagua Javier b0ea001694 2009-06-26 Gonzalo Paniagua Javier <[email protected]>
* HttpConnection.cs:
	* HttpListenerResponse.cs: force closing the socket when the response
	is aborted.


svn path=/trunk/mcs/; revision=137016
2009-06-26 22:37:38 +00:00
Gonzalo Paniagua Javier ef06a7c25b 2009-06-02 Gonzalo Paniagua Javier <[email protected]>
* HttpConnection.cs: unbind the context after every read for keep-alive
	connections.
	Bug #502274 fixed.


svn path=/trunk/mcs/; revision=135241
2009-06-02 21:42:31 +00:00
Gonzalo Paniagua Javier 3f8bc3c7ef 2009-01-15 Gonzalo Paniagua Javier <[email protected]>
* HttpListenerRequest.cs: always initialize 'version'.
	* HttpConnection.cs: the socket might already be disconnected when
	shutting down.


svn path=/trunk/mcs/; revision=123453
2009-01-15 06:03:51 +00:00
Gonzalo Paniagua Javier 538c44650f 2009-01-13 Gonzalo Paniagua Javier <[email protected]>
* HttpConnection.cs: we were not writing the headers for 0-length
	responses.
	* WebConnectionStream.cs: for 204/304 responses with an explicit
	content-length of 0, release the socket only once.
	Fixes bug #465638.


svn path=/trunk/mcs/; revision=123250
2009-01-13 20:32:26 +00:00
Gonzalo Paniagua Javier 370451c2fe 2008-11-18 Gonzalo Paniagua Javier <[email protected]>
* HttpConnection.cs: remove CWL. When reusing, BeginReadRequest might
	throw if the client closes.
	* HttpListenerResponse.cs: close the connection for 1.0 clients.


svn path=/trunk/mcs/; revision=119225
2008-11-18 21:50:44 +00:00
Gonzalo Paniagua Javier f374f900d4 2008-10-08 Gonzalo Paniagua Javier <[email protected]>
* HttpConnection.cs:
	* HttpListenerResponse.cs: fix typo that caused the "connection close"
	header to be sent. Do not close the socket when the encoding is not
	chunked and reuse is possible.
	Fixes bug #433371.


svn path=/trunk/mcs/; revision=115250
2008-10-08 17:52:29 +00:00
Miguel de Icaza d97ed80f3b 2008-09-12 Miguel de Icaza <[email protected]>
* HttpListenerPrefixCollection.cs, EndPointListener.cs,
	HttpListener.cs, EndPointManager.cs, HttpConnection.cs: Remove
	generics support where necessary to allow this code to be reused
	in the 1.0 profile.

svn path=/trunk/mcs/; revision=112922
2008-09-12 23:59:52 +00:00
Zoltan Varga c514358e22 2008-02-21 Zoltan Varga <[email protected]>
* HttpConnection.cs (Close): Close the socket even if Shutdown throws an exception.

svn path=/trunk/mcs/; revision=96331
2008-02-21 11:04:49 +00:00
Marek Safar e61dde083e Warnings cleanup
svn path=/trunk/mcs/; revision=89678
2007-11-15 14:14:49 +00:00
Sebastien Pouliot 7da033a75a Fix build as HttpListener now depends on X509Certificate2, which can't be build on the first time for 2.0... bla bla bla, and lot of other stuff depends on it
svn path=/trunk/mcs/; revision=69982
2006-12-23 04:34:08 +00:00
Gonzalo Paniagua Javier ac198e410d 2006-12-22 Gonzalo Paniagua Javier <[email protected]>
* EndPointListener.cs:
	* ListenerPrefix.cs:
	* ResponseStream.cs:
	* ChunkedInputStream.cs:
	* HttpConnection.cs:
	* RequestStream.cs: add initial support for HTTPS.


svn path=/trunk/mcs/; revision=69972
2006-12-22 21:50:03 +00:00
Gonzalo Paniagua Javier d8d07db2bb 2006-08-30 Gonzalo Paniagua Javier <[email protected]>
* HttpConnection.cs: when the content length is available, keep it
	updated after synchronous read. Renamed 'available' to 'remaining_body'.
	* RequestStream.cs: when creating the stream, pass the remaining length
	starting from the offset in the buffer.


svn path=/trunk/mcs/; revision=64584
2006-08-31 00:04:30 +00:00
Gonzalo Paniagua Javier b509cdc267 2006-02-07 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: don't send the expect-100 if if there's no content.

	* HttpListenerRequest.cs:
	* HttpConnection.cs:
	* RequestStream.cs: use the content length header to avoid reading past
	the end of the stream.

	Patch by Horst Reiterer.


svn path=/trunk/mcs/; revision=56658
2006-02-08 01:33:15 +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