changeset 1322:7800e6f1919f

Do not log an error if TLS link was shutdown properly
author Sebastien Decugis <sdecugis@freediameter.net>
date Sun, 15 Oct 2017 21:13:58 +0800
parents 8288982c63b7
children 10143e09abdf
files libfdcore/cnxctx.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libfdcore/cnxctx.c	Sun Oct 15 20:59:46 2017 +0800
+++ b/libfdcore/cnxctx.c	Sun Oct 15 21:13:58 2017 +0800
@@ -1051,13 +1051,14 @@
 	   messages. */
 int fd_tls_rcvthr_core(struct cnxctx * conn, gnutls_session_t session)
 {
+	ssize_t ret = 0;
 	/* No guarantee that GnuTLS preserves the message boundaries, so we re-build it as in TCP. */
 	do {
 		uint8_t header[4];
 		struct fd_cnx_rcvdata rcv_data;
 		struct fd_msg_pmdl *pmdl=NULL;
-		ssize_t ret = 0;
 		size_t	received = 0;
+		ret = 0;
 
 		do {
 			ret = fd_tls_recv_handle_error(conn, session, &header[received], sizeof(header) - received);
@@ -1108,7 +1109,7 @@
 	} while (1);
 	
 out:
-	return ENOTCONN;
+	return (ret == 0) ? 0 : ENOTCONN;
 }
 
 /* Receiver thread (TLS & 1 stream SCTP or TCP)  */
"Welcome to our mercurial repository"