changeset 1222:5d0d300a7cd9

Add more traces for debug
author Sebastien Decugis <sdecugis@freediameter.net>
date Tue, 18 Jun 2013 17:05:44 +0800
parents 940713a4f296
children 33ad82ffbdde
files libfdcore/sctp_dtls.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libfdcore/sctp_dtls.c	Tue Jun 18 16:28:11 2013 +0800
+++ b/libfdcore/sctp_dtls.c	Tue Jun 18 17:05:44 2013 +0800
@@ -143,8 +143,8 @@
 	switch (event) {
 		case FDEVP_CNX_MSG_RECV:
 			got_data = 1;
-			LOG_A("Received DTLS data, type %hhd, Seq %02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx, Stream %hu",
-				(*buf)[0],
+			LOG_A("Received DTLS data, len %zd, type %hhd, Seq %02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx, Stream %hu",
+				*len, (*buf)[0],
 				(*buf)[3],(*buf)[4],(*buf)[5],(*buf)[6], (*buf)[7],(*buf)[8],(*buf)[9],(*buf)[10],
 				*strid);
 			break;
@@ -176,9 +176,9 @@
 	
 	while (offset + 13 <= len) {
 		next_record_len = (buf[offset+11] << 8) + buf[offset+12];
-		LOG_A("update_nextseq_from_records off:%zd Type %hhd, Ver:%02hhx.%02hhx, Seq:%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx",
+		LOG_A("update_nextseq_from_records off:%zd Type %hhd, Ver:%02hhx.%02hhx, Len:%d, Seq:%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx",
 			offset,
-			buf[offset], buf[offset+1], buf[offset+2], 
+			buf[offset], buf[offset+1], buf[offset+2], (((int)buf[offset+11])<<8)+((int)buf[offset+12]),
 			buf[offset+3],buf[offset+4],buf[offset+5],buf[offset+6],buf[offset+7],buf[offset+8],buf[offset+9],buf[offset+10]
 			);
 		
@@ -606,9 +606,9 @@
 	/* TODO("Cookie exchange?"); */
 	/* gnutls_dtls_prestate_set (session, &prestate); */
 
-	gnutls_dtls_set_mtu(session, DTLS_SCTP_MTU);
+	GNUTLS_TRACE( gnutls_dtls_set_mtu(session, DTLS_SCTP_MTU));
 
-	gnutls_dtls_set_timeouts(session, 70000, 60000); /* Set retrans > total so that there is no retransmission, since SCTP is reliable */
+	GNUTLS_TRACE( gnutls_dtls_set_timeouts(session, 70000, 60000)); /* Set retrans > total so that there is no retransmission, since SCTP is reliable */
 
 #ifdef GNUTLS_VERSION_320
 	TODO("Disable replay protection");
"Welcome to our mercurial repository"