Updates for moving SSL support out of main library.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11622 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2001-12-04 14:59:09 +00:00
parent e7bbd6e347
commit bbcf4c1163
12 changed files with 793 additions and 649 deletions

View file

@ -81,6 +81,8 @@ char emp[64] = {
static NSMutableDictionary *urlCache = nil;
static NSLock *urlLock = nil;
static Class sslClass = 0;
static NSLock *debugLock = nil;
static char debugFile[128];
@ -143,6 +145,9 @@ static void debugWrite(NSData *data)
urlLock = [NSLock new];
debugLock = [NSLock new];
sprintf(debugFile, "/tmp/GSHTTP.%d", getpid());
#ifndef __MINGW__
sslClass = [NSFileHandle sslClass];
#endif
}
}
@ -307,12 +312,16 @@ static void debugWrite(NSData *data)
{
if ([[url scheme] isEqualToString: @"https"])
{
#ifndef __MINGW__
sock = [GSUnixSSLHandle
if (sslClass == 0)
{
[self backgroundLoadDidFailWithReason:
@"https not supported ... needs SSL bundle"];
return;
}
sock = [sslClass
fileHandleAsClientInBackgroundAtAddress: [url host]
service: [url scheme]
protocol: @"tcp"];
#endif
}
else
{
@ -330,14 +339,18 @@ static void debugWrite(NSData *data)
}
if ([[url scheme] isEqualToString: @"https"])
{
#ifndef __MINGW__
sock = [GSUnixSSLHandle
if (sslClass == 0)
{
[self backgroundLoadDidFailWithReason:
@"https not supported ... needs SSL bundle"];
return;
}
sock = [sslClass
fileHandleAsClientInBackgroundAtAddress:
[request objectForKey: GSHTTPPropertyProxyHostKey]
service:
[request objectForKey: GSHTTPPropertyProxyPortKey]
protocol: @"tcp"];
#endif
}
else
{