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
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");
#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];
}
}
- if (got && !ask)
- return 0;
-
in.first = 1;
in.date = date;
HMAC_CTX_init(&ctx);
/* 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
#include "log.h"
#include "parseurl.h"
-#define RTMPDUMP_VERSION "v2.0"
+#define RTMPDUMP_VERSION "v2.1"
#define RD_SUCCESS 0
#define RD_FAILED 1
}
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;
#include <pthread.h>
#endif
-#define RTMPDUMP_SERVER_VERSION "v2.0"
+#define RTMPDUMP_SERVER_VERSION "v2.1"
#define RD_SUCCESS 0
#define RD_FAILED 1
#include <pthread.h>
#endif
-#define RTMPDUMP_PROXY_VERSION "v2.0"
+#define RTMPDUMP_PROXY_VERSION "v2.1"
#define RD_SUCCESS 0
#define RD_FAILED 1
{
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);
#include <pthread.h>
#endif
-#define RTMPDUMP_STREAMS_VERSION "v2.0"
+#define RTMPDUMP_STREAMS_VERSION "v2.1"
#define RD_SUCCESS 0
#define RD_FAILED 1
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;