49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
-
+
-
|
}
- (OFArray OF_GENERIC(OFHTTPCookie *) *)cookies
{
return [[_cookies copy] autorelease];
}
- (void)addCookie: (OFHTTPCookie *)cookie
- (void)addCookie: (OFHTTPCookie *)cookie forURL: (OFURL *)URL
forURL: (OFURL *)URL
{
void *pool = objc_autoreleasePoolPush();
OFString *cookieDomain, *URLHost;
size_t i;
if (![cookie.path hasPrefix: @"/"])
cookie.path = @"/";
|
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
-
+
-
-
-
+
-
|
}
i = 0;
for (OFHTTPCookie *iter in _cookies) {
if ([iter.name isEqual: cookie.name] &&
[iter.domain isEqual: cookie.domain] &&
[iter.path isEqual: cookie.path]) {
[_cookies replaceObjectAtIndex: i
[_cookies replaceObjectAtIndex: i withObject: cookie];
withObject: cookie];
objc_autoreleasePoolPop(pool);
return;
}
i++;
}
[_cookies addObject: cookie];
objc_autoreleasePoolPop(pool);
}
- (void)addCookies: (OFArray OF_GENERIC(OFHTTPCookie *) *)cookies
forURL: (OFURL *)URL
{
for (OFHTTPCookie *cookie in cookies)
[self addCookie: cookie
[self addCookie: cookie forURL: URL];
forURL: URL];
}
- (OFArray OF_GENERIC(OFHTTPCookie *) *)cookiesForURL: (OFURL *)URL
{
OFMutableArray *ret = [OFMutableArray array];
for (OFHTTPCookie *cookie in _cookies) {
|