Ssl tidyups

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11344 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2001-11-08 19:36:24 +00:00
parent d85ea9ba47
commit 288c0b6e9d
5 changed files with 705 additions and 568 deletions

View file

@ -384,6 +384,8 @@ static NSLock *urlLock = nil;
{
NSRunLoop *loop = [NSRunLoop currentRunLoop];
NSString *cmd;
NSTimeInterval last = 0.0;
NSTimeInterval limit = 0.01;
if ([url port] == nil)
{
@ -406,7 +408,14 @@ static NSLock *urlLock = nil;
object: sock];
while (tunnel == YES)
{
[loop runUntilDate: [NSDate dateWithTimeIntervalSinceNow: 1.0]];
NSDate *when;
NSTimeInterval tmp = limit;
limit += last;
last = tmp;
when = [[NSDate alloc] initWithTimeIntervalSinceNow: limit];
[loop runUntilDate: when];
RELEASE(when);
}
}
if ([[url scheme] isEqualToString: @"https"])
@ -533,6 +542,7 @@ static NSLock *urlLock = nil;
e = [userInfo objectForKey: GSFileHandleNotificationError];
if (e != nil)
{
tunnel = NO;
NSLog(@"Failed to write command to socket - %@", e);
/*
* Tell superclass that the load failed - let it do housekeeping.