adium/adium

Parents 5816a0c4307a
Children a705ec3e9e96
Fix a read returning 0 in the SocketRead callback for SSL being handled as an error, while it's meant to indicate "no data available".

This would cause disconnections with the error "(Libpurple: cdsa) receive failed (-9802): Undefined error: 0".

Fixes #16356, fixes #15405, fixes #15411, fixes #15741
--- a/Plugins/Purple Service/libpurple_extensions/ssl-cdsa.c Tue Mar 19 20:25:26 2013 +0100
+++ b/Plugins/Purple Service/libpurple_extensions/ssl-cdsa.c Tue Mar 26 23:47:30 2013 +0100
@@ -230,17 +230,18 @@
switch(theErr) {
case ENOENT:
/* connection closed */
- rtn = errSSLClosedGraceful;
+ rtn = errSSLClosedGraceful;
break;
case ECONNRESET:
rtn = errSSLClosedAbort;
break;
+ case 0:
case EAGAIN:
rtn = errSSLWouldBlock;
break;
default:
- fprintf(stderr,"SocketRead: read(%lu) error %d\n",
- (unsigned long)bytesToGo, theErr);
+ fprintf(stderr,"SocketRead: read(%lu) error %d\n",
+ (unsigned long)bytesToGo, theErr);
rtn = errSSLFatalAlert;
break;
}