487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
|
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
|
-
+
+
|
@try {
line = [socket readLine];
} @catch (OFInvalidEncodingException *e) {
@throw [OFInvalidServerReplyException exception];
}
}
if (![line hasPrefix: @"HTTP/"] || [line characterAtIndex: 8] != ' ')
if (![line hasPrefix: @"HTTP/"] || [line length] < 9 ||
[line characterAtIndex: 8] != ' ')
@throw [OFInvalidServerReplyException exception];
version = [line substringWithRange: of_range(5, 3)];
if (![version isEqual: @"1.0"] && ![version isEqual: @"1.1"])
@throw [OFUnsupportedVersionException
exceptionWithVersion: version];
|