[rtmpdump] r142 - in trunk: ChangeLog hashswf.c rtmp.h rtmpdump.c rtmpsrv.c rtmpsuck.c streams.c

hyc subversion at mplayerhq.hu
Wed Dec 30 07:17:38 CET 2009


Author: hyc
Date: Wed Dec 30 07:17:36 2009
New Revision: 142

Log:
Prep for 2.1; use Referrer in HashSWF

Modified:
   trunk/ChangeLog
   trunk/hashswf.c
   trunk/rtmp.h
   trunk/rtmpdump.c
   trunk/rtmpsrv.c
   trunk/rtmpsuck.c
   trunk/streams.c

Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	Wed Dec 30 05:30:45 2009	(r141)
+++ trunk/ChangeLog	Wed Dec 30 07:17:36 2009	(r142)
@@ -3,7 +3,7 @@ Copyright 2008-2009 Andrej Stepanchuk; D
 Copyright 2009 Howard Chu
 Copyright 2009 The Flvstreamer Team
 
-29 December 2009, v2.x
+29 December 2009, v2.1
 - AMF cleanup: bounds checking for all encoders, moved AMF_EncodeNamed* from rtmp.c
 - added SecureToken support
 - added automatic SWF hash calculation

Modified: trunk/hashswf.c
==============================================================================
--- trunk/hashswf.c	Wed Dec 30 05:30:45 2009	(r141)
+++ trunk/hashswf.c	Wed Dec 30 07:17:36 2009	(r142)
@@ -151,7 +151,8 @@ http_get(const char *url, struct info *i
   s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
   if (s < 0)
     return -1;
-  i = sprintf(buf, "GET %s HTTP/1.0\r\nUser-Agent: %s\r\nHost: %s\r\n", path, AGENT, host);
+  i = sprintf(buf, "GET %s HTTP/1.0\r\nUser-Agent: %s\r\nHost: %s\r\nReferrer: %.*s\r\n", path, AGENT, host,
+    path-url+1, url);
   if (in->date[0])
     i += sprintf(buf+i, "If-Modified-Since: %s\r\n", in->date);
   i += sprintf(buf+i, "\r\n");
@@ -221,7 +222,7 @@ leave:
 #define HEX2BIN(a)      (((a)&0x40)?((a)&0xf)+9:((a)&0xf))
 
 int
-RTMP_HashSWF(const char *url, unsigned int *size, unsigned char *hash, int ask)
+RTMP_HashSWF(const char *url, unsigned int *size, unsigned char *hash)
 {
   FILE *f = NULL;
   char *path, *home, date[64];
@@ -290,9 +291,6 @@ RTMP_HashSWF(const char *url, unsigned i
         }
     }
 
-  if (got && !ask)
-    return 0;
-
   in.first = 1;
   in.date = date;
   HMAC_CTX_init(&ctx);

Modified: trunk/rtmp.h
==============================================================================
--- trunk/rtmp.h	Wed Dec 30 05:30:45 2009	(r141)
+++ trunk/rtmp.h	Wed Dec 30 07:17:36 2009	(r142)
@@ -211,7 +211,7 @@ bool RTMP_FindFirstMatchingProperty(AMFO
 /* hashswf.c */
 #define HASHLEN	32
 
-int RTMP_HashSWF(const char *url, unsigned int *size, unsigned char *hash, int ask);
+int RTMP_HashSWF(const char *url, unsigned int *size, unsigned char *hash);
 #endif
 
 #endif

Modified: trunk/rtmpdump.c
==============================================================================
--- trunk/rtmpdump.c	Wed Dec 30 05:30:45 2009	(r141)
+++ trunk/rtmpdump.c	Wed Dec 30 07:17:36 2009	(r142)
@@ -45,7 +45,7 @@
 #include "log.h"
 #include "parseurl.h"
 
-#define RTMPDUMP_VERSION	"v2.0"
+#define RTMPDUMP_VERSION	"v2.1"
 
 #define RD_SUCCESS		0
 #define RD_FAILED		1
@@ -1284,7 +1284,7 @@ main(int argc, char **argv)
 	  }
         case 'W':
 	  STR2AVAL(swfUrl, optarg);
-          if (RTMP_HashSWF(optarg, &swfSize, hash, 1) == 0)
+          if (RTMP_HashSWF(optarg, &swfSize, hash) == 0)
             {
               swfHash.av_val = (char *)hash;
               swfHash.av_len = HASHLEN;

Modified: trunk/rtmpsrv.c
==============================================================================
--- trunk/rtmpsrv.c	Wed Dec 30 05:30:45 2009	(r141)
+++ trunk/rtmpsrv.c	Wed Dec 30 07:17:36 2009	(r142)
@@ -45,7 +45,7 @@
 #include <pthread.h>
 #endif
 
-#define RTMPDUMP_SERVER_VERSION	"v2.0"
+#define RTMPDUMP_SERVER_VERSION	"v2.1"
 
 #define RD_SUCCESS		0
 #define RD_FAILED		1

Modified: trunk/rtmpsuck.c
==============================================================================
--- trunk/rtmpsuck.c	Wed Dec 30 05:30:45 2009	(r141)
+++ trunk/rtmpsuck.c	Wed Dec 30 07:17:36 2009	(r142)
@@ -45,7 +45,7 @@
 #include <pthread.h>
 #endif
 
-#define RTMPDUMP_PROXY_VERSION	"v2.0"
+#define RTMPDUMP_PROXY_VERSION	"v2.1"
 
 #define RD_SUCCESS		0
 #define RD_FAILED		1
@@ -207,7 +207,7 @@ ServeInvoke(STREAMING_SERVER *server, RT
             {
               unsigned char hash[HASHLEN];
               server->rc.Link.swfUrl = pval;
-              if (RTMP_HashSWF(pval.av_val, &server->rc.Link.SWFSize, hash, 0) == 0)
+              if (RTMP_HashSWF(pval.av_val, &server->rc.Link.SWFSize, hash, 1) == 0)
                 {
                   server->rc.Link.SWFHash.av_val = malloc(HASHLEN);
                   memcpy(server->rc.Link.SWFHash.av_val, hash, HASHLEN);

Modified: trunk/streams.c
==============================================================================
--- trunk/streams.c	Wed Dec 30 05:30:45 2009	(r141)
+++ trunk/streams.c	Wed Dec 30 07:17:36 2009	(r142)
@@ -37,7 +37,7 @@
 #include <pthread.h>
 #endif
 
-#define RTMPDUMP_STREAMS_VERSION	"v2.0"
+#define RTMPDUMP_STREAMS_VERSION	"v2.1"
 
 #define RD_SUCCESS		0
 #define RD_FAILED		1
@@ -942,7 +942,7 @@ ParseOption(char opt, char *arg, RTMP_RE
         unsigned char hash[HASHLEN];
 
         STR2AVAL(req->swfUrl, arg);
-        if (RTMP_HashSWF(arg, &req->swfSize, hash, 1) == 0)
+        if (RTMP_HashSWF(arg, &req->swfSize, hash) == 0)
           {
             req->swfHash.av_val = malloc(HASHLEN);
             req->swfHash.av_len = HASHLEN;


More information about the rtmpdump mailing list