adium 5843:9b4717820ead: We should not read errno when reading 0...

commits at adium.im commits at adium.im
Fri Feb 21 11:39:57 UTC 2014


details:	http://hg.adium.im/adium/rev/9b4717820ead
revision:	5843:9b4717820ead
branch:		adium-1.5.10
author:		Thijs Alkemade <me at thijsalkema.de>
date:		Fri Feb 21 12:39:21 2014 +0100

We should not read errno when reading 0 bytes, because it is not set. The connection has been closed.

Refs #16356

diffs (15 lines):

diff -r f8d2f42c499b -r 9b4717820ead Plugins/Purple Service/libpurple_extensions/ssl-cdsa.c
--- a/Plugins/Purple Service/libpurple_extensions/ssl-cdsa.c	Fri Feb 21 11:53:35 2014 +0100
+++ b/Plugins/Purple Service/libpurple_extensions/ssl-cdsa.c	Fri Feb 21 12:39:21 2014 +0100
@@ -230,7 +230,10 @@
     for(;;) {
         bytesRead = 0;
         rrtn = read(sock, currData, bytesToGo);
-        if (rrtn <= 0) {
+		if (rrtn == 0) {
+			rtn = errSSLClosedGraceful;
+			break;
+		} else if (rrtn < 0) {
             /* this is guesswork... */
             int theErr = errno;
             switch(theErr) {




More information about the commits mailing list