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

@ -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)