Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpWebClientProtocol.cs')
-rw-r--r--mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpWebClientProtocol.cs36
1 files changed, 9 insertions, 27 deletions
diff --git a/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpWebClientProtocol.cs b/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpWebClientProtocol.cs
index 3be915cfbc8..722f1d2a681 100644
--- a/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpWebClientProtocol.cs
+++ b/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpWebClientProtocol.cs
@@ -45,7 +45,6 @@ namespace System.Web.Services.Protocols {
CookieContainer cookieContainer;
IWebProxy proxy;
string userAgent;
- CookieCollection prevCookies;
#if NET_1_1
bool _unsafeAuthenticated;
@@ -117,41 +116,25 @@ namespace System.Web.Services.Protocols {
#region Methods
- internal virtual void AddCookies (Uri uri)
+ internal virtual void CheckForCookies (HttpWebResponse response)
{
- if (cookieContainer == null)
- cookieContainer = new CookieContainer ();
-
- if (prevCookies == null || prevCookies.Count == 0)
+ CookieCollection cookies = response.Cookies;
+ if (cookieContainer == null || cookies.Count == 0)
return;
CookieCollection coll = cookieContainer.GetCookies (uri);
- foreach (Cookie prev in prevCookies) {
- bool dont = false;
- foreach (Cookie c in coll) {
+ foreach (Cookie c in cookies) {
+ bool add = true;
+ foreach (Cookie prev in coll) {
if (c.Equals (prev)) {
- dont = true;
+ add = false;
break;
}
}
-
- if (dont == false)
- cookieContainer.Add (prev);
+ if (add)
+ cookieContainer.Add (c);
}
}
-
- internal virtual void CheckForCookies (HttpWebResponse response)
- {
- CookieCollection cookies = response.Cookies;
- if (cookies.Count == 0)
- return;
-
- if (prevCookies == null)
- prevCookies = new CookieCollection ();
-
- foreach (Cookie c in cookies)
- prevCookies.Add (c);
- }
protected override WebRequest GetWebRequest (Uri uri)
{
@@ -164,7 +147,6 @@ namespace System.Web.Services.Protocols {
if (clientCertificates != null)
request.ClientCertificates.AddRange (clientCertificates);
- AddCookies (uri);
request.CookieContainer = cookieContainer;
if (proxy != null)
request.Proxy = proxy;