Tweak to avoid rare hangup

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21680 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2005-08-25 14:30:29 +00:00
parent 905ff03796
commit 3d548c92a8
2 changed files with 12 additions and 0 deletions

View file

@ -1,6 +1,10 @@
2005-08-25 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSCalendarDate.m: Fix bug subtracting minute interval.
* SSL/GSSSLHandle.m: Put handle in non-blocking mode before call
to SSL_accept() or SSL_connect() so that we can be interrupted
if the remote end doesn't respond (older code can hang waiting
for the remote end).
2005-08-22 Adam Fedor <fedor@gnu.org>

View file

@ -206,6 +206,10 @@ sslError(int err, int e)
{
ssl = SSL_new(ctx);
}
/*
* Set non-blocking so accept won't hang if remote end goes wrong.
*/
[self setNonBlocking: YES];
RETAIN(self); // Don't get destroyed during runloop
loop = [NSRunLoop currentRunLoop];
ret = SSL_set_fd(ssl, descriptor);
@ -304,6 +308,10 @@ ERR_print_errors_fp(stderr);
ssl = SSL_new(ctx);
}
RETAIN(self); // Don't get destroyed during runloop
/*
* Set non-blocking so accept won't hang if remote end goes wrong.
*/
[self setNonBlocking: YES];
loop = [NSRunLoop currentRunLoop];
ret = SSL_set_fd(ssl, descriptor);
if (ret == 1)