Dual-tls - split management of TLS into in- and out-bound connection-handling.
[exim.git] / src / src / ip.c
index 11f0fd88b17240881eeae0eaee36dd1f8e8ac9bb..b0c98878b6736b9f3365129d50a11ee10a22af4a 100644 (file)
@@ -347,8 +347,10 @@ for (;;)
 close down of the connection), set errno to zero; otherwise leave it alone. */
 
 #ifdef SUPPORT_TLS
-if (tls_active == sock)
-  rc = tls_read(buffer, buffsize);
+if (tls_out.active == sock)
+  rc = tls_read(FALSE, buffer, buffsize);
+else if (tls_in.active == sock)
+  rc = tls_read(TRUE, buffer, buffsize);
 else
 #endif
   rc = recv(sock, buffer, buffsize, 0);