@@ -201,19 +201,20 @@ BOOL chunked; char *buffer; size_t bytesReceived; if (![scheme isEqual: @"http"] && ![scheme isEqual: @"https"]) - @throw [OFUnsupportedProtocolException exceptionWithClass: isa - URL: URL]; + @throw [OFUnsupportedProtocolException + exceptionWithClass: [self class] + URL: URL]; if ([scheme isEqual: @"http"]) sock = [OFTCPSocket socket]; else { if (of_http_request_tls_socket_class == Nil) @throw [OFUnsupportedProtocolException - exceptionWithClass: isa + exceptionWithClass: [self class] URL: URL]; sock = [[[of_http_request_tls_socket_class alloc] init] autorelease]; } @@ -280,15 +281,17 @@ [sock writeString: queryString]; @try { line = [sock readLine]; } @catch (OFInvalidEncodingException *e) { - @throw [OFInvalidServerReplyException exceptionWithClass: isa]; + @throw [OFInvalidServerReplyException + exceptionWithClass: [self class]]; } if (![line hasPrefix: @"HTTP/1.0 "] && ![line hasPrefix: @"HTTP/1.1 "]) - @throw [OFInvalidServerReplyException exceptionWithClass: isa]; + @throw [OFInvalidServerReplyException + exceptionWithClass: [self class]]; status = (int)[[line substringWithRange: of_range(9, 3)] decimalValue]; serverHeaders = [OFMutableDictionary dictionary]; @@ -298,25 +301,25 @@ @try { line = [sock readLine]; } @catch (OFInvalidEncodingException *e) { @throw [OFInvalidServerReplyException - exceptionWithClass: isa]; + exceptionWithClass: [self class]]; } if (line == nil) @throw [OFInvalidServerReplyException - exceptionWithClass: isa]; + exceptionWithClass: [self class]]; if ([line isEqual: @""]) break; line_c = [line UTF8String]; if ((tmp = strchr(line_c, ':')) == NULL) @throw [OFInvalidServerReplyException - exceptionWithClass: isa]; + exceptionWithClass: [self class]]; key = [OFString stringWithUTF8String: line_c length: tmp - line_c]; normalizeKey(key); @@ -378,11 +381,12 @@ if (contentLengthHeader != nil) { contentLength = (size_t)[contentLengthHeader decimalValue]; if (contentLength > SIZE_MAX) - @throw [OFOutOfRangeException exceptionWithClass: isa]; + @throw [OFOutOfRangeException + exceptionWithClass: [self class]]; } buffer = [self allocMemoryWithSize: of_pagesize]; bytesReceived = 0; @try { @@ -394,11 +398,11 @@ @try { line = [sock readLine]; } @catch (OFInvalidEncodingException *e) { @throw [OFInvalidServerReplyException - exceptionWithClass: isa]; + exceptionWithClass: [self class]]; } pos = [line indexOfFirstOccurrenceOfString: @";"]; if (pos != OF_INVALID_INDEX) @@ -408,11 +412,11 @@ @try { toRead = (size_t)[line hexadecimalValue]; } @catch (OFInvalidFormatException *e) { @throw [OFInvalidServerReplyException - exceptionWithClass: isa]; + exceptionWithClass: [self class]]; } if (toRead == 0 || (contentLengthHeader != nil && contentLength >= bytesReceived)) @@ -439,16 +443,16 @@ @try { line = [sock readLine]; } @catch (OFInvalidEncodingException *e) { @throw [OFInvalidServerReplyException - exceptionWithClass: isa]; + exceptionWithClass: [self class]]; } if (![line isEqual: @""]) @throw [OFInvalidServerReplyException - exceptionWithClass: isa]; + exceptionWithClass: [self class]]; [pool2 releaseObjects]; } } else { size_t length; @@ -483,11 +487,12 @@ * OFHTTPRequestFailedException for all other status codes later. */ if (contentLengthHeader != nil && contentLength != bytesReceived && (status == 200 || status == 301 || status == 302 || status == 303 || status == 307)) - @throw [OFTruncatedDataException exceptionWithClass: isa]; + @throw [OFTruncatedDataException + exceptionWithClass: [self class]]; [serverHeaders makeImmutable]; result = [[OFHTTPRequestResult alloc] initWithStatusCode: status headers: serverHeaders @@ -501,11 +506,11 @@ case 307: break; default: [result release]; @throw [OFHTTPRequestFailedException - exceptionWithClass: isa + exceptionWithClass: [self class] HTTPRequest: self result: result]; } [pool release];