171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
-
+
|
if (requestType == OF_HTTP_REQUEST_TYPE_GET)
type = "GET";
if (requestType == OF_HTTP_REQUEST_TYPE_HEAD)
type = "HEAD";
if (requestType == OF_HTTP_REQUEST_TYPE_POST)
type = "POST";
if ([(path = [URL path]) isEqual: @""])
if ([(path = [URL path]) length] == 0)
path = @"/";
if ([URL query] != nil)
[sock writeFormat: @"%s %@?%@ HTTP/1.1\r\n",
type, path, [URL query]];
else
[sock writeFormat: @"%s %@ HTTP/1.1\r\n", type, path];
|
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
|
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
|
-
+
|
exceptionWithClass: [self class]];
}
if (line == nil)
@throw [OFInvalidServerReplyException
exceptionWithClass: [self class]];
if ([line isEqual: @""])
if ([line length] == 0)
break;
lineC = [line UTF8String];
if ((tmp = strchr(lineC, ':')) == NULL)
@throw [OFInvalidServerReplyException
exceptionWithClass: [self class]];
|
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
|
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
|
-
+
|
@try {
line = [sock readLine];
} @catch (OFInvalidEncodingException *e) {
@throw [OFInvalidServerReplyException
exceptionWithClass: [self class]];
}
if (![line isEqual: @""])
if ([line length] > 0)
@throw [OFInvalidServerReplyException
exceptionWithClass: [self class]];
objc_autoreleasePoolPop(pool2);
}
} else {
size_t length;
|