Tcl Source Code

Artifact [2233591409]
Login

Artifact 22335914094e1b03cd88bfa760048356d4631ca1:

Attachment "tlsIO.patch" to ticket [0f94f855ca] added by dgp 2015-04-10 15:46:21.
Index: tlsIO.c
===================================================================
RCS file: /cvsroot/tls/tls/tlsIO.c,v
retrieving revision 1.17
diff -u -r1.17 tlsIO.c
--- tlsIO.c	8 Dec 2014 19:09:06 -0000	1.17
+++ tlsIO.c	10 Apr 2015 15:45:26 -0000
@@ -345,6 +345,11 @@
     if (!SSL_is_init_finished(statePtr->ssl)) {
 	bytesRead = Tls_WaitForConnect(statePtr, errorCodePtr);
 	if (bytesRead <= 0) {
+	    if (*errorCodePtr == ECONNRESET) {
+		/* Soft EOF */
+		*errorCodePtr = 0;
+		bytesRead = 0;
+	    }
 	    goto input;
 	}
     }
@@ -913,9 +918,6 @@
 		    continue;
 		}
 	    } else if (err == 0) {
-		if (Tcl_Eof(statePtr->self)) {
-		    return 0;
-		}
 		dprintf(stderr,"CR! ");
 		*errorCodePtr = ECONNRESET;
 		return -1;