Browse code

tls: verbose debugging for SSL_ERROR_WANT_WRITE

Debugging messages for partial write and SSL_ERROR_WANT_WRITE
(enabled only if the tls module is compiled with
-DTLS_WR_DEBUG and -DTLS_RD_DEBUG).

Andrei Pelinescu-Onciul authored on 15/08/2010 16:10:42
Showing 1 changed files
... ...
@@ -787,6 +787,10 @@ redo_wr:
787 787
 					/* this function should be called again => disallow
788 788
 					   immediate closing of the connection */
789 789
 					send_flags->f &= ~SND_F_CON_CLOSE;
790
+					TLS_WR_TRACE("(%p) SSL_ERROR_WANT_WRITE partial write"
791
+								" (written %p , %d, rest_buf=%p"
792
+								" rest_len=%d))\n", c, buf, offs,
793
+								*rest_buf, *rest_len);
790 794
 				}
791 795
 				break; /* or goto end */
792 796
 			case SSL_ERROR_SSL:
... ...
@@ -1157,6 +1161,8 @@ ssl_read_skipped:
1157 1157
 				/* something was written => buffer not big enough to hold
1158 1158
 				   everything => reset buffer & retry (the tcp_write already
1159 1159
 				   happened if we are here) */
1160
+				TLS_RD_TRACE("(%p) SSL_ERROR_WANT_WRITE partial write"
1161
+							" (written  %d), retrying\n", c, wr.used);
1160 1162
 				goto continue_ssl_read;
1161 1163
 			}
1162 1164
 			/* else write buffer too small, nothing written */