mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
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:
parent
e7bbd6e347
commit
bbcf4c1163
12 changed files with 793 additions and 649 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue