Author: gonzalo
Date: 2005-04-07 16:03:43 -0400 (Thu, 07 Apr 2005)
New Revision: 42651
Modified:
trunk/mcs/class/System/System.Net/ServicePoint.cs
trunk/mcs/class/System/System.Net/WebHeaderCollection.cs
Log:
2005-04-07 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
* WebHeaderCollection.cs: added if-modified-since to the list of
restricted headers.
* ServicePoint.cs: use a field object when locking.
Modified: trunk/mcs/class/System/System.Net/ServicePoint.cs
===================================================================
--- trunk/mcs/class/System/System.Net/ServicePoint.cs 2005-04-07 19:59:25 UTC
(rev 42650)
+++ trunk/mcs/class/System/System.Net/ServicePoint.cs 2005-04-07 20:03:43 UTC
(rev 42651)
@@ -53,6 +53,7 @@
Hashtable groups;
bool sendContinue = true;
bool useConnect;
+ object locker = new object ();
#if NET_1_1
bool useNagle;
#endif
@@ -98,7 +99,7 @@
public int CurrentConnections {
get {
- lock (this) {
+ lock (locker) {
return currentConnections;
}
}
@@ -106,7 +107,7 @@
public DateTime IdleSince {
get {
- lock (this) {
+ lock (locker) {
return idleSince;
}
}
@@ -241,7 +242,7 @@
{
WebConnection cnc;
- lock (this) {
+ lock (locker) {
WebConnectionGroup cncGroup =
GetConnectionGroup (groupName);
cnc = cncGroup.GetConnection ();
}
@@ -251,7 +252,7 @@
internal void IncrementConnection ()
{
- lock (this) {
+ lock (locker) {
currentConnections++;
idleSince = DateTime.Now.AddMilliseconds
(1000000);
}
@@ -259,7 +260,7 @@
internal void DecrementConnection ()
{
- lock (this) {
+ lock (locker) {
currentConnections--;
if (currentConnections == 0)
idleSince = DateTime.Now;
Modified: trunk/mcs/class/System/System.Net/WebHeaderCollection.cs
===================================================================
--- trunk/mcs/class/System/System.Net/WebHeaderCollection.cs 2005-04-07
19:59:25 UTC (rev 42650)
+++ trunk/mcs/class/System/System.Net/WebHeaderCollection.cs 2005-04-07
20:03:43 UTC (rev 42651)
@@ -64,6 +64,7 @@
restricted.Add ("date", true);
restricted.Add ("expect", true);
restricted.Add ("host", true);
+ restricted.Add ("if-modified-since", true);
restricted.Add ("range", true);
restricted.Add ("referer", true);
restricted.Add ("transfer-encoding", true);
@@ -139,7 +140,7 @@
if (name == null)
throw new ArgumentNullException ("name");
if (internallyCreated && IsRestricted (name))
- throw new ArgumentException ("restricted
header");
+ throw new ArgumentException ("This header must
be modified with the appropiate property.");
this.AddWithoutValidate (name, value);
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches