MbedTLS ssl_send_data(): Include the socket in the log messages
authorFabian Keil <fk@fabiankeil.de>
Sat, 3 Oct 2020 15:35:03 +0000 (17:35 +0200)
committerFabian Keil <fk@fabiankeil.de>
Fri, 9 Oct 2020 07:40:39 +0000 (09:40 +0200)
ssl.c

diff --git a/ssl.c b/ssl.c
index 729388f..7334fb9 100644 (file)
--- a/ssl.c
+++ b/ssl.c
@@ -170,7 +170,8 @@ extern int ssl_send_data(struct ssl_attr *ssl_attr, const unsigned char *buf, si
          send_len = (int)max_fragment_size;
       }
 
-      log_error(LOG_LEVEL_WRITING, "TLS: %N", send_len, buf+pos);
+      log_error(LOG_LEVEL_WRITING, "TLS on socket %d: %N",
+         ssl_attr->mbedtls_attr.socket_fd.fd, send_len, buf+pos);
 
       /*
        * Sending one part of the buffer
@@ -186,7 +187,8 @@ extern int ssl_send_data(struct ssl_attr *ssl_attr, const unsigned char *buf, si
 
             mbedtls_strerror(ret, err_buf, sizeof(err_buf));
             log_error(LOG_LEVEL_ERROR,
-               "Sending data over TLS/SSL failed: %s", err_buf);
+               "Sending data on socket %d over TLS/SSL failed: %s",
+               ssl_attr->mbedtls_attr.socket_fd.fd, err_buf);
             return -1;
          }
       }