Commit Graph
18 Commits
Author SHA1 Message Date
Martin Baulig bad5ef8453 [Http]: Fix a potential race condition in the WebConnectionGroup's connection list.
Remove the "ConnectionState" from the connection list before closing the connection,
this should avoid ServicePoint.SendRequest() ever crashing with a NullReferenceException
due to getting a null return value from WebConnectionGroup.GetConnection().
2014-06-11 19:07:15 +02:00
Martin Baulig c6a70a9586 Rewrite and fix the web stack's connection reuse and idle logic.
* ServicePoint now uses an idle timer to close idle connections.

* WebConnectionGroup has been mostly rewritten to use a linked
  list of open connections and their idle times.

  This fixes both the problem that we were leaking sockets and
  that we were not reusing existing connections.

* ServicePoint now correctly keeps track of the number of open
  connections.

* ServicePointManager now uses the correct default idle time
  of 100 seconds (previously 15 minutes).

* WebConnection uses the new WebConnectionGroup's busy logic
  to correctly flag connections as busy / reusable.
2014-02-13 14:17:14 +01:00
Martin Baulig 593da60eab [#7258][Web]: Fix proxy authentication for non-ssl sessions
Thanks a lot to Christian Gan for this patch :-)
2012-10-24 01:17:38 +02:00
Miguel de Icaza ae0feab435 Removal of NET_1_1 defines and some NET_2_0; Both defines are true these days in Mono, no versions prior to 2.0 are supported 2012-06-01 18:04:24 -04:00
Miguel de Icaza 6db9dc225c update copyrights 2011-08-17 00:52:41 -04:00
Gonzalo Paniagua Javier 07a679d371 Fix the range for rnd.Next() 2011-08-11 14:16:24 -04:00
Miguel de Icaza 661b8cbd0c 2010-03-20 Miguel de Icaza <[email protected]>
* WebConnection.cs: Drop pre-2.0 and pre-1.1 support, and remove
	warnings. 

svn path=/trunk/mcs/; revision=153949
2010-03-20 22:56:56 +00:00
Gonzalo Paniagua Javier baa3d5ff39 2009-12-21 Gonzalo Paniagua Javier <[email protected]>
* WebConnectionGroup.cs:
	* ServicePoint.cs: implemented CloseConnectionGroup().


svn path=/trunk/mcs/; revision=148813
2009-12-21 17:12:57 +00:00
Gonzalo Paniagua Javier 61bbe5b41b 2008-10-08 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs:
	* ServicePoint.cs:
	* WebConnectionGroup.cs:
	* HttpWebRequest.cs:
	* WebConnectionStream.cs: reuse the same connection when doing NTLM
	authentication. Fixes bug #323375.
	Implemented support for UnsafeAuthenticatedConnectionSharing.


svn path=/trunk/mcs/; revision=115265
2008-10-08 20:16:33 +00:00
Gonzalo Paniagua Javier 1683d9081f 2004-12-03 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: remove prevStream and don't set busy to false in
	HandleError. prevStream is not needed any more and setting 'busy' so
	early might let a request skip the queue.
	
	* WebConnectionGroup.cs: decrement the indexer when removing a dead
	reference from the arraylist.

	* WebConnectionStream.cs:
	(ReadAll): call NextRead if it has not been called before even when
	we have completed the request. Reuse the read buffer when reading a
	response of unknown size. Increase the buffer to 8kB.
	(BeginRead): increase pendingReads earlier and even when reading from
	the internal buffer.
	(EndRead): decrease pendingReads later and always.


svn path=/trunk/mcs/; revision=36993
2004-12-03 07:37:32 +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 8d801ed6b3 2004-03-04 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs:
	* WebConnectionGroup.cs: the requests queue is now shared for all the
	connections belonging to the same connection group.

svn path=/trunk/mcs/; revision=23695
2004-03-04 17:28:27 +00:00
Gonzalo Paniagua Javier 0a5ccb6f09 2004-01-09 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: Data.Init is a bad boy. Lluis realized. He also
	tidied up the end of ReadDone. Disabled relaunching the request if 2
	InitRead are called, since now we don't throw everything into
	RegisterWaitForSingleObject but one request at a time.

	* WebConnectionGroup.cs: when checking available connections, allow them
	not to be Connected but allocated to honor the connection limit.

	* WebConnectionStream.cs: CheckComplete() now checks for nextReadCalled
	too. ReadAll don't mess contentLength if it's provided in the headers.

	BIG thanks to Lluis. Turns out that we were debugging the same stuff and
	his Data.Init discovery was THE thing I was missing.

	Fixes bug #51277.

svn path=/trunk/mcs/; revision=21883
2004-01-09 21:02:20 +00:00
Gonzalo Paniagua Javier 063eec915c 2003-11-17 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs: turns out that socket.Connected is not useful until
	we actually try to send/receive data, even if the other end has already
	closed the socket. Added TryReconnect() and Connected.

	* WebConnectionData.cs: default value for StatusCode is 0 now.

	* WebConnectionGroup.cs: reuse the connection since the beginning,
	instead of opening up to ConnectionLimit and then reusing.

	* WebConnectionStream.cs: reopen the socket if we're trying to reuse
	one which fails on first write.

svn path=/trunk/mcs/; revision=20117
2003-11-17 16:24:15 +00:00
Gonzalo Paniagua Javier d3f150312d 2003-10-09 Gonzalo Paniagua Javier <[email protected]>
* System.Net/ServicePoint.cs: preparing for recycling. Not yet finished.
	* System.Net/ServicePointManager.cs: this is the one that reads config.
	* System.Net/WebConnectionGroup.cs: don't read config here.
	* System.Net/WebConnection.cs: added the queue again. Launch queued
	requests on error.
	* System.Net.Configuration/ConnectionManagementHandler.cs: the hashtable
	is case insensitive now.

svn path=/trunk/mcs/; revision=18788
2003-10-09 03:31:08 +00:00
Gonzalo Paniagua Javier 88b5e403bc 2003-10-08 Gonzalo Paniagua Javier <[email protected]>
* System.Net/WebConnection.cs: the queue is now handled by the
	threadpool. Initialize the connection data in a place where it does not
	depend on the execution order of the requests in threadpool. More error
	handling.

	* System.Net/WebConnectionGroup.cs: use the limits in the config file
	and reuse connections when the limit is reached.

	* System.Net.Configuration/ConnectionManagementHandler.cs: added
	GetMaxConnections to return the max. number of simultaneous connections
	to a given host.

svn path=/trunk/mcs/; revision=18735
2003-10-08 02:45:25 +00:00
Jerome Laban b9828aaebf 2003-07-14 Jerome Laban <[email protected]>
* ServicePoint.cs: Removed Connect and GetEndPoint methods.
        Removed reverse resolution when uri is literal IP address.
        * WebConnection.cs: IPv6 compatibility update: Try to connect
        to all addresses returned by IPHostEntry.
        * WebConnectionGroup.cs: Removed unused parameter.

svn path=/trunk/mcs/; revision=16209
2003-07-14 15:09:47 +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