Try to improve debug logs

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26550 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2008-05-22 08:29:04 +00:00
parent 3fc4813dc7
commit 305228ef17
2 changed files with 18 additions and 34 deletions

View file

@ -1,3 +1,7 @@
2008-05-22 Richard Frith-Macdonald <rfm@gnu.org>
* SSL/GSSSLHandle.m: Attempt to improve error logging.
2008-05-21 Richard Frith-Macdonald <rfm@gnu.org> 2008-05-21 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSRunLoop.m: Fix reference to uninitialised variable. * Source/NSRunLoop.m: Fix reference to uninitialised variable.

View file

@ -87,37 +87,21 @@ sslError(int err)
SSL_load_error_strings(); SSL_load_error_strings();
switch (err) if (err == SSL_ERROR_SYSCALL)
{ {
case SSL_ERROR_NONE: NSError *e = [NSError _last];
str = @"No error: really helpful";
break; str = [NSString stringWithFormat: @"Syscall error %d - %@",
case SSL_ERROR_ZERO_RETURN: [e code], [e description]];
str = @"Zero Return error"; }
break; else if (err == SSL_ERROR_NONE)
case SSL_ERROR_WANT_READ: {
str = @"Want Read Error"; str = @"No error: really helpful";
break; }
case SSL_ERROR_WANT_WRITE: else
str = @"Want Write Error"; {
break; str = [NSString stringWithFormat: @"%s", ERR_reason_error_string(err)];
case SSL_ERROR_WANT_X509_LOOKUP:
str = @"Want X509 Lookup Error";
break;
case SSL_ERROR_SYSCALL:
{
NSError *e = [NSError _last];
str = [NSString stringWithFormat: @"Syscall error %d - %@",
[e code], [e description]];
}
break;
case SSL_ERROR_SSL:
str = @"SSL Error: really helpful";
break;
default:
str = @"Standard system error: really helpful";
break;
} }
return str; return str;
} }
@ -270,10 +254,8 @@ sslError(int err)
/* /*
* Some other error ... not just a timeout or disconnect * Some other error ... not just a timeout or disconnect
*/ */
NSLog(@"unable to accept SSL connection from %@:%@ - %@", NSWarnLog(@"unable to accept SSL connection from %@:%@ - %@",
address, service, sslError(err)); address, service, sslError(err));
ERR_print_errors_fp(stderr);
} }
RELEASE(self); RELEASE(self);
return NO; return NO;
@ -369,7 +351,6 @@ sslError(int err)
RELEASE(final); RELEASE(final);
if (err != SSL_ERROR_NONE) if (err != SSL_ERROR_NONE)
{ {
if (err != SSL_ERROR_WANT_READ && err != SSL_ERROR_WANT_WRITE)
if (err != SSL_ERROR_WANT_READ && err != SSL_ERROR_WANT_WRITE) if (err != SSL_ERROR_WANT_READ && err != SSL_ERROR_WANT_WRITE)
{ {
/* /*
@ -377,7 +358,6 @@ sslError(int err)
*/ */
NSLog(@"unable to make SSL connection to %@:%@ - %@", NSLog(@"unable to make SSL connection to %@:%@ - %@",
address, service, sslError(err)); address, service, sslError(err));
ERR_print_errors_fp(stderr);
} }
RELEASE(self); RELEASE(self);
return NO; return NO;