@@ -36,11 +36,11 @@ #import "OFAlreadyConnectedException.h" #import "OFHTTPRequestFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidEncodingException.h" #import "OFInvalidFormatException.h" -#import "OFInvalidServerReplyException.h" +#import "OFInvalidServerResponseException.h" #import "OFNotImplementedException.h" #import "OFNotOpenException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "OFTruncatedDataException.h" @@ -455,21 +455,21 @@ return false; } if (![line hasPrefix: @"HTTP/"] || line.length < 9 || [line characterAtIndex: 8] != ' ') - @throw [OFInvalidServerReplyException exception]; + @throw [OFInvalidServerResponseException exception]; _version = [[line substringWithRange: OFMakeRange(5, 3)] copy]; if (![_version isEqual: @"1.0"] && ![_version isEqual: @"1.1"]) @throw [OFUnsupportedVersionException exceptionWithVersion: _version]; status = [line substringWithRange: OFMakeRange(9, 3)].longLongValue; if (status < 0 || status > 599) - @throw [OFInvalidServerReplyException exception]; + @throw [OFInvalidServerResponseException exception]; _status = (short)status; return true; } @@ -479,11 +479,11 @@ OFString *key, *value, *old; const char *lineC, *tmp; char *keyC; if (line == nil) - @throw [OFInvalidServerReplyException exception]; + @throw [OFInvalidServerResponseException exception]; if (line.length == 0) { [_serverHeaders makeImmutable]; if ([_client->_delegate respondsToSelector: @selector(client: @@ -503,11 +503,11 @@ } lineC = line.UTF8String; if ((tmp = strchr(lineC, ':')) == NULL) - @throw [OFInvalidServerReplyException exception]; + @throw [OFInvalidServerResponseException exception]; keyC = OFAllocMemory(tmp - lineC + 1, 1); memcpy(keyC, lineC, tmp - lineC); keyC[tmp - lineC] = '\0'; normalizeKey(keyC); @@ -542,11 +542,12 @@ bool ret; if (exception != nil) { if ([exception isKindOfClass: [OFInvalidEncodingException class]]) - exception = [OFInvalidServerReplyException exception]; + exception = + [OFInvalidServerResponseException exception]; [self raiseException: exception]; return false; } @@ -899,11 +900,11 @@ isEqual: @"chunked"]; contentLength = [headers objectForKey: @"Content-Length"]; if (contentLength != nil) { if (_chunked || contentLength.length == 0) - @throw [OFInvalidServerReplyException exception]; + @throw [OFInvalidServerResponseException exception]; _hasContentLength = true; @try { unsigned long long toRead = @@ -912,11 +913,11 @@ if (toRead > LLONG_MAX) @throw [OFOutOfRangeException exception]; _toRead = (long long)toRead; } @catch (OFInvalidFormatException *e) { - @throw [OFInvalidServerReplyException exception]; + @throw [OFInvalidServerResponseException exception]; } } } - (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length @@ -958,16 +959,16 @@ switch ([_stream readIntoBuffer: tmp length: 2]) { case 2: _toRead++; if (tmp[1] != '\n') - @throw [OFInvalidServerReplyException + @throw [OFInvalidServerResponseException exception]; case 1: _toRead++; if (tmp[0] != '\r') - @throw [OFInvalidServerReplyException + @throw [OFInvalidServerResponseException exception]; } if (_setAtEndOfStream && _toRead == 0) _atEndOfStream = true; @@ -977,11 +978,11 @@ char tmp; if ([_stream readIntoBuffer: &tmp length: 1] == 1) { _toRead++; if (tmp != '\n') - @throw [OFInvalidServerReplyException + @throw [OFInvalidServerResponseException exception]; } if (_setAtEndOfStream && _toRead == 0) _atEndOfStream = true; @@ -1004,11 +1005,11 @@ size_t pos; @try { line = [_stream tryReadLine]; } @catch (OFInvalidEncodingException *e) { - @throw [OFInvalidServerReplyException exception]; + @throw [OFInvalidServerResponseException exception]; } if (line == nil) return 0; @@ -1022,11 +1023,11 @@ * at end of stream. */ if (_stream.atEndOfStream && pos == OFNotFound) @throw [OFTruncatedDataException exception]; else - @throw [OFInvalidServerReplyException + @throw [OFInvalidServerResponseException exception]; } @try { unsigned long long toRead = @@ -1035,11 +1036,11 @@ if (toRead > LLONG_MAX) @throw [OFOutOfRangeException exception]; _toRead = (long long)toRead; } @catch (OFInvalidFormatException *e) { - @throw [OFInvalidServerReplyException exception]; + @throw [OFInvalidServerResponseException exception]; } if (_toRead == 0) { _setAtEndOfStream = true; _toRead = -2;