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:
Richard Frith-Macdonald 2001-11-08 09:46:31 +00:00
parent cb1d29dc55
commit 30ab57b9a4
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>
* Headers/foundation/NSUserDefaults.h: Add _lock ivar

View file

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