[rtmpdump] r401 - in trunk/librtmp: handshake.h log.c

hyc subversion at mplayerhq.hu
Thu Mar 25 04:29:52 CET 2010


Author: hyc
Date: Thu Mar 25 04:29:51 2010
New Revision: 401

Log:
Cleanup LogHex, just print 16 bytes per line

Modified:
   trunk/librtmp/handshake.h
   trunk/librtmp/log.c

Modified: trunk/librtmp/handshake.h
==============================================================================
--- trunk/librtmp/handshake.h	Thu Mar 25 04:25:11 2010	(r400)
+++ trunk/librtmp/handshake.h	Thu Mar 25 04:29:51 2010	(r401)
@@ -728,7 +728,7 @@ SHandShake(RTMP * r)
     return false;
 
   RTMP_Log(RTMP_LOGDEBUG, "%s: Type Requested : %02X", __FUNCTION__, type);
-  RTMP_LogHexString(RTMP_LOGDEBUG2, clientsig, RTMP_SIG_SIZE);
+  RTMP_LogHex(RTMP_LOGDEBUG2, clientsig, RTMP_SIG_SIZE);
 
   if (type == 3)
     {
@@ -824,7 +824,7 @@ SHandShake(RTMP * r)
     }
 
   RTMP_Log(RTMP_LOGDEBUG2, "Serversig: ");
-  RTMP_LogHexString(RTMP_LOGDEBUG2, serversig, RTMP_SIG_SIZE);
+  RTMP_LogHex(RTMP_LOGDEBUG2, serversig, RTMP_SIG_SIZE);
 
   if (!WriteN(r, serversig-1, RTMP_SIG_SIZE + 1))
     return false;
@@ -948,7 +948,7 @@ SHandShake(RTMP * r)
 
   RTMP_Log(RTMP_LOGDEBUG2, "%s: Sending handshake response: ",
     __FUNCTION__);
-  RTMP_LogHexString(RTMP_LOGDEBUG2, clientsig, RTMP_SIG_SIZE);
+  RTMP_LogHex(RTMP_LOGDEBUG2, clientsig, RTMP_SIG_SIZE);
 
   if (!WriteN(r, clientsig, RTMP_SIG_SIZE))
     return false;
@@ -958,7 +958,7 @@ SHandShake(RTMP * r)
     return false;
 
   RTMP_Log(RTMP_LOGDEBUG2, "%s: 2nd handshake: ", __FUNCTION__);
-  RTMP_LogHexString(RTMP_LOGDEBUG2, clientsig, RTMP_SIG_SIZE);
+  RTMP_LogHex(RTMP_LOGDEBUG2, clientsig, RTMP_SIG_SIZE);
 
   if (FP9HandShake)
     {

Modified: trunk/librtmp/log.c
==============================================================================
--- trunk/librtmp/log.c	Thu Mar 25 04:25:11 2010	(r400)
+++ trunk/librtmp/log.c	Thu Mar 25 04:29:51 2010	(r401)
@@ -132,9 +132,11 @@ void RTMP_LogHex(int level, const char *
 	if ( level > RTMP_debuglevel )
 		return;
 	for(i=0; i<len; i++) {
-		RTMP_LogPrintf("%02X ", (unsigned char)data[i]);
+		RTMP_LogPrintf("%02X%c", (unsigned char)data[i],
+		  ((i & 0x0f) == 0x0f) ? '\n': ' ');
 	}
-	RTMP_LogPrintf("\n");
+	if (i & 0x0f)
+	  RTMP_LogPrintf("\n");
 }
 
 void RTMP_LogHexString(int level, const char *data, unsigned long len)


More information about the rtmpdump mailing list