[rtmpdump] r420 - in trunk: librtmp/rtmp.h rtmpdump.c rtmpgw.c

hyc subversion at mplayerhq.hu
Wed Apr 7 09:24:56 CEST 2010


Author: hyc
Date: Wed Apr  7 09:24:55 2010
New Revision: 420

Log:
Drop #ifdef CRYPTO from rtmp.h; apps have no way to know any more if CRYPTO
is defined or not

Modified:
   trunk/librtmp/rtmp.h
   trunk/rtmpdump.c
   trunk/rtmpgw.c

Modified: trunk/librtmp/rtmp.h
==============================================================================
--- trunk/librtmp/rtmp.h	Wed Apr  7 09:12:59 2010	(r419)
+++ trunk/librtmp/rtmp.h	Wed Apr  7 09:24:55 2010	(r420)
@@ -146,15 +146,14 @@ extern "C"
     unsigned short socksport;
     unsigned short port;
 
-#ifdef CRYPTO
+#define RTMP_SWF_HASHLEN	32
     void *dh;			// for encryption
     void *rc4keyIn;
     void *rc4keyOut;
 
     uint32_t SWFSize;
-    char SWFHash[32];
-    char SWFVerificationResponse[42];
-#endif
+    char SWFHash[RTMP_SWF_HASHLEN];
+    char SWFVerificationResponse[RTMP_SWF_HASHLEN+10];
   } RTMP_LNK;
 
   /* state for read() wrapper */
@@ -304,13 +303,9 @@ extern "C"
   int RTMP_Read(RTMP *r, char *buf, int size);
   int RTMP_Write(RTMP *r, char *buf, int size);
 
-#ifdef CRYPTO
 /* hashswf.c */
-#define HASHLEN	32
-
   int RTMP_HashSWF(const char *url, unsigned int *size, unsigned char *hash,
 		   int age);
-#endif
 
 #ifdef __cplusplus
 };

Modified: trunk/rtmpdump.c
==============================================================================
--- trunk/rtmpdump.c	Wed Apr  7 09:12:59 2010	(r419)
+++ trunk/rtmpdump.c	Wed Apr  7 09:24:55 2010	(r420)
@@ -757,7 +757,7 @@ main(int argc, char **argv)
 #ifdef CRYPTO
   int swfAge = 30;	/* 30 days for SWF cache by default */
   int swfVfy = 0;
-  unsigned char hash[HASHLEN];
+  unsigned char hash[RTMP_SWF_HASHLEN];
 #endif
 
   char *flvFile = 0;
@@ -848,13 +848,13 @@ main(int argc, char **argv)
 	case 'w':
 	  {
 	    int res = hex2bin(optarg, &swfHash.av_val);
-	    if (res != HASHLEN)
+	    if (res != RTMP_SWF_HASHLEN)
 	      {
 		swfHash.av_val = NULL;
 		RTMP_Log(RTMP_LOGWARNING,
-		    "Couldn't parse swf hash hex string, not hexstring or not %d bytes, ignoring!", HASHLEN);
+		    "Couldn't parse swf hash hex string, not hexstring or not %d bytes, ignoring!", RTMP_SWF_HASHLEN);
 	      }
-	    swfHash.av_len = HASHLEN;
+	    swfHash.av_len = RTMP_SWF_HASHLEN;
 	    break;
 	  }
 	case 'x':
@@ -1109,7 +1109,7 @@ main(int argc, char **argv)
       if (RTMP_HashSWF(swfUrl.av_val, &swfSize, hash, swfAge) == 0)
         {
           swfHash.av_val = (char *)hash;
-          swfHash.av_len = HASHLEN;
+          swfHash.av_len = RTMP_SWF_HASHLEN;
         }
     }
 

Modified: trunk/rtmpgw.c
==============================================================================
--- trunk/rtmpgw.c	Wed Apr  7 09:12:59 2010	(r419)
+++ trunk/rtmpgw.c	Wed Apr  7 09:24:55 2010	(r420)
@@ -105,7 +105,7 @@ typedef struct
   uint32_t dStopOffset;
 
 #ifdef CRYPTO
-  unsigned char hash[HASHLEN];
+  unsigned char hash[RTMP_SWF_HASHLEN];
 #endif
 } RTMP_REQUEST;
 
@@ -520,7 +520,7 @@ void processTCPrequest(STREAMING_SERVER 
         if (RTMP_HashSWF(req.swfUrl.av_val, &req.swfSize, req.hash, req.swfAge) == 0)
           {
             req.swfHash.av_val = (char *)req.hash;
-            req.swfHash.av_len = HASHLEN;
+            req.swfHash.av_len = RTMP_SWF_HASHLEN;
           }
 #endif
     }
@@ -786,13 +786,13 @@ ParseOption(char opt, char *arg, RTMP_RE
     case 'w':
       {
 	int res = hex2bin(arg, &req->swfHash.av_val);
-	if (!res || res != HASHLEN)
+	if (!res || res != RTMP_SWF_HASHLEN)
 	  {
 	    req->swfHash.av_val = NULL;
 	    RTMP_Log(RTMP_LOGWARNING,
-		"Couldn't parse swf hash hex string, not hexstring or not %d bytes, ignoring!", HASHLEN);
+		"Couldn't parse swf hash hex string, not hexstring or not %d bytes, ignoring!", RTMP_SWF_HASHLEN);
 	  }
-	req->swfHash.av_len = HASHLEN;
+	req->swfHash.av_len = RTMP_SWF_HASHLEN;
 	break;
       }
     case 'x':


More information about the rtmpdump mailing list