mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Fix uninitialised variables
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39906 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8fd0387e36
commit
b07fe2eb2b
2 changed files with 21 additions and 13 deletions
|
@ -487,7 +487,7 @@ didReceiveResponse:(NSURLResponse *)response
|
|||
NSString *path = nil;
|
||||
NSString *redirectPath = nil;
|
||||
NSString *statusCode = nil;
|
||||
NSString *redirectCode;
|
||||
NSString *redirectCode = nil;
|
||||
NSString *method = nil;
|
||||
id payload = nil;
|
||||
id content = nil;
|
||||
|
@ -551,8 +551,9 @@ didReceiveResponse:(NSURLResponse *)response
|
|||
}
|
||||
}
|
||||
|
||||
isOwnAuxServer = [[d objectForKey: @"IsAuxilliary"] isEqualToString: @"YES"] &&
|
||||
nil == _auxServer;
|
||||
isOwnAuxServer
|
||||
= [[d objectForKey: @"IsAuxilliary"] isEqualToString: @"YES"]
|
||||
&& nil == _auxServer;
|
||||
if (isOwnAuxServer)
|
||||
{
|
||||
auxPort = [d objectForKey: @"AuxPort"];
|
||||
|
@ -615,7 +616,8 @@ didReceiveResponse:(NSURLResponse *)response
|
|||
if (_expectedStatusCode == 0)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Invalid expected 'StatusCode' supplied %@", statusCode];
|
||||
format: @"Invalid expected 'StatusCode' supplied %@",
|
||||
statusCode];
|
||||
}
|
||||
}
|
||||
if (nil == redirectCode)
|
||||
|
@ -628,7 +630,8 @@ didReceiveResponse:(NSURLResponse *)response
|
|||
if (_redirectStatusCode == 0)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Invalid expected 'RedirectCode' supplied %@", redirectCode];
|
||||
format: @"Invalid expected 'RedirectCode' supplied %@",
|
||||
redirectCode];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -650,12 +653,14 @@ didReceiveResponse:(NSURLResponse *)response
|
|||
}
|
||||
|
||||
url = [NSURL URLWithString:
|
||||
[NSString stringWithFormat: @"%@://%@:%@%@", protocol, address, auxPort, redirectPath]];
|
||||
[NSString stringWithFormat:
|
||||
@"%@://%@:%@%@", protocol, address, auxPort, redirectPath]];
|
||||
_redirectRequest = [NSMutableURLRequest requestWithURL: url];
|
||||
RETAIN(_redirectRequest);
|
||||
|
||||
url = [NSURL URLWithString:
|
||||
[NSString stringWithFormat: @"%@://%@:%@%@", protocol, address, port, path]];
|
||||
[NSString stringWithFormat:
|
||||
@"%@://%@:%@%@", protocol, address, port, path]];
|
||||
_request = [NSMutableURLRequest requestWithURL: url];
|
||||
RETAIN(_request);
|
||||
|
||||
|
|
|
@ -109,7 +109,8 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"%@: already started '%@' on '%@'", self, _serverStream, [NSThread currentThread]);
|
||||
NSLog(@"%@: already started '%@' on '%@'",
|
||||
self, _serverStream, [NSThread currentThread]);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -212,7 +213,7 @@
|
|||
NSData *statusData;
|
||||
char *crlf = "\r\n";
|
||||
id content;
|
||||
NSData *contentData;
|
||||
NSData *contentData = nil;
|
||||
NSUInteger cLength = 0; // content-length
|
||||
NSString *connection;
|
||||
BOOL close = YES;
|
||||
|
@ -226,15 +227,17 @@
|
|||
{
|
||||
connection = [[_request headerNamed: @"connection"] value];
|
||||
}
|
||||
// if the client didn't supply the header 'Connection' or explicitly stated
|
||||
// to close the current connection
|
||||
close = (nil == connection || [[connection lowercaseString] isEqualToString: @"close"]);
|
||||
// if the client didn't supply the header 'Connection' or
|
||||
// explicitly stated to close the current connection
|
||||
close = (nil == connection
|
||||
|| [[connection lowercaseString] isEqualToString: @"close"]);
|
||||
|
||||
// adding the 'Content-Length' to the response
|
||||
content = [_response content];
|
||||
if ([content isKindOfClass: [NSString class]])
|
||||
{
|
||||
contentData = [(NSString *)content dataUsingEncoding: NSUTF8StringEncoding];
|
||||
contentData = [(NSString *)content
|
||||
dataUsingEncoding: NSUTF8StringEncoding];
|
||||
}
|
||||
else if ([content isKindOfClass: [NSData class]])
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue