Tweaked the HTTP Connection class so it uses ASCII encoding.

CQTexperiment
vspader 2009-03-07 02:06:09 -08:00
parent a19e3f3b8c
commit d468f240e7
2 changed files with 5 additions and 3 deletions

View File

@ -206,6 +206,7 @@
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
@ -228,6 +229,7 @@
ppc,
i386,
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = G5;

View File

@ -85,8 +85,8 @@
}
NSInteger lineLength = ((uint8_t *)newLine - (uint8_t *)_buffer);
NSString *line = [[NSString alloc] initWithBytes:_buffer length:lineLength encoding:NSUTF8StringEncoding];
NSLog(@"Received line: !%@!", line);
NSString *line = [[NSString alloc] initWithBytes:_buffer length:lineLength encoding:NSASCIIStringEncoding];
NSLog(@"Received line: \"%@\"", line);
memmove(_buffer, _buffer + lineLength + 2, _bufferSize - lineLength); // + 2 to skip the newline!
_bufferSize -= lineLength;
@ -186,7 +186,7 @@
for (id header in _requestHeaders) {
id value = [_requestHeaders objectForKey:header];
[requestString appendFormat:@"%@:%@\r\n", header, value];
[requestString appendFormat:@"%@: %@\r\n", header, value];
}
// The final newline