adium 5877:e9b20f65795c: I hope this is the proper fix to #16356...

commits at adium.im commits at adium.im
Mon May 26 11:11:10 UTC 2014


details:	http://hg.adium.im/adium/rev/e9b20f65795c
revision:	5877:e9b20f65795c
branch:		adium-1.5.11
author:		Thijs Alkemade <me at thijsalkema.de>
date:		Mon May 26 13:10:47 2014 +0200

I hope this is the proper fix to #16356: When any data has been read in the SocketRead for-loop, return noErr when we encounter an EOF. On the next call, it will return errSSLClosedGraceful.

This should fix an -9806 (errSSLClosedAbort) error in SIPE.

Fixes #16356

diffs (19 lines):

diff -r c2de73195b24 -r e9b20f65795c Plugins/Purple Service/libpurple_extensions/ssl-cdsa.c
--- a/Plugins/Purple Service/libpurple_extensions/ssl-cdsa.c	Mon May 26 13:04:27 2014 +0200
+++ b/Plugins/Purple Service/libpurple_extensions/ssl-cdsa.c	Mon May 26 13:10:47 2014 +0200
@@ -231,7 +231,14 @@
         bytesRead = 0;
         rrtn = read(sock, currData, bytesToGo);
 		if (rrtn == 0) {
-			rtn = errSSLClosedGraceful;
+			/* We got an EOF. However, when we have already read some bytes in a previous iteration of this loop,
+			 * then we should return noErr to make sure CDSA processes all that data.
+			 * When initLen is still equal to bytesToGo, we haven't read anything, so we can inform CDSA that we're
+			 * closed.
+			 */
+			if (initLen == bytesToGo) {
+				rtn = errSSLClosedGraceful;
+			}
 			break;
 		} else if (rrtn < 0) {
             /* this is guesswork... */




More information about the commits mailing list