Minor HTTP bugfixes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11338 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2001-11-08 09:46:31 +00:00
parent 885ed3e370
commit da0531200b
2 changed files with 26 additions and 6 deletions

View file

@ -1,3 +1,8 @@
2001-11-08 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSHTTPHURLHandle.m: handle writing of nil properties and
use of empty strings as proxy settings.
2001-11-07 Richard Frith-Macdonald <rfm@gnu.org> 2001-11-07 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/foundation/NSUserDefaults.h: Add _lock ivar * Headers/foundation/NSUserDefaults.h: Add _lock ivar

View file

@ -257,7 +257,7 @@ static NSLock *urlLock = nil;
[sock closeFile]; [sock closeFile];
DESTROY(sock); DESTROY(sock);
contentLength = 0; contentLength = 0;
if ([request objectForKey: GSHTTPPropertyProxyHostKey] == nil) if ([[request objectForKey: GSHTTPPropertyProxyHostKey] length] == 0)
{ {
if ([[url scheme] isEqualToString: @"https"]) if ([[url scheme] isEqualToString: @"https"])
{ {
@ -278,7 +278,7 @@ static NSLock *urlLock = nil;
} }
else else
{ {
if ([request objectForKey: GSHTTPPropertyProxyPortKey] == nil) if ([[request objectForKey: GSHTTPPropertyProxyPortKey] length] == 0)
{ {
[request setObject: @"8080" forKey: GSHTTPPropertyProxyPortKey]; [request setObject: @"8080" forKey: GSHTTPPropertyProxyPortKey];
} }
@ -380,7 +380,7 @@ static NSLock *urlLock = nil;
* If SSL via proxy, set up tunnel first * If SSL via proxy, set up tunnel first
*/ */
if ([[url scheme] isEqualToString: @"https"] if ([[url scheme] isEqualToString: @"https"]
&& [request objectForKey: GSHTTPPropertyProxyHostKey] != nil) && [[request objectForKey: GSHTTPPropertyProxyHostKey] length] > 0)
{ {
NSRunLoop *loop = [NSRunLoop currentRunLoop]; NSRunLoop *loop = [NSRunLoop currentRunLoop];
NSString *cmd; NSString *cmd;
@ -437,7 +437,7 @@ static NSLock *urlLock = nil;
method = @"GET"; method = @"GET";
} }
} }
if ([request objectForKey: GSHTTPPropertyProxyHostKey] != nil if ([[request objectForKey: GSHTTPPropertyProxyHostKey] length] > 0
&& [[url scheme] isEqualToString: @"https"] == NO) && [[url scheme] isEqualToString: @"https"] == NO)
{ {
s = [[NSMutableString alloc] initWithFormat: @"%@ http://%@%@", s = [[NSMutableString alloc] initWithFormat: @"%@ http://%@%@",
@ -625,11 +625,26 @@ static NSLock *urlLock = nil;
{ {
if ([propertyKey hasPrefix: @"GSHTTPProperty"]) if ([propertyKey hasPrefix: @"GSHTTPProperty"])
{ {
[request setObject: property forKey: propertyKey]; if (propertyKey == nil)
{
[request removeObjectForKey: propertyKey];
} }
else else
{ {
[wProperties setObject: property forKey: [propertyKey lowercaseString]]; [request setObject: property forKey: propertyKey];
}
}
else
{
if (propertyKey == nil)
{
[wProperties removeObjectForKey: [propertyKey lowercaseString]];
}
else
{
[wProperties setObject: property
forKey: [propertyKey lowercaseString]];
}
} }
return YES; return YES;
} }