[rtmpdump] r229 - in tags/rel-2.1c: . rtmp.c rtmp.h rtmpdump.c rtmpsuck.c
hyc
subversion at mplayerhq.hu
Sat Jan 9 08:25:55 CET 2010
Author: hyc
Date: Sat Jan 9 08:25:54 2010
New Revision: 229
Log:
Sync again
Modified:
tags/rel-2.1c/ (props changed)
tags/rel-2.1c/rtmp.c
tags/rel-2.1c/rtmp.h
tags/rel-2.1c/rtmpdump.c
tags/rel-2.1c/rtmpsuck.c
Modified: tags/rel-2.1c/rtmp.c
==============================================================================
--- tags/rel-2.1c/rtmp.c Sat Jan 9 08:20:02 2010 (r228)
+++ tags/rel-2.1c/rtmp.c Sat Jan 9 08:25:54 2010 (r229)
@@ -2177,14 +2177,22 @@ bool
RTMP_SendChunk(RTMP *r, RTMPChunk *chunk)
{
bool wrote;
+ char hbuf[RTMP_MAX_HEADER_SIZE];
Log(LOGDEBUG2, "%s: fd=%d, size=%d", __FUNCTION__, r->m_socket, chunk->c_chunkSize);
LogHexString(LOGDEBUG2, chunk->c_header, chunk->c_headerSize);
if (chunk->c_chunkSize)
- LogHexString(LOGDEBUG2, chunk->c_chunk, chunk->c_chunkSize);
- wrote = WriteN(r, chunk->c_header, chunk->c_headerSize);
- if (wrote && chunk->c_chunkSize)
- wrote = WriteN(r, chunk->c_chunk, chunk->c_chunkSize);
+ {
+ char *ptr = chunk->c_chunk - chunk->c_headerSize;
+ LogHexString(LOGDEBUG2, chunk->c_chunk, chunk->c_chunkSize);
+ /* save header bytes we're about to overwrite */
+ memcpy(hbuf, ptr, chunk->c_headerSize);
+ memcpy(ptr, chunk->c_header, chunk->c_headerSize);
+ wrote = WriteN(r, ptr, chunk->c_headerSize + chunk->c_chunkSize);
+ memcpy(ptr, hbuf, chunk->c_headerSize);
+ }
+ else
+ wrote = WriteN(r, chunk->c_header, chunk->c_headerSize);
return wrote;
}
Modified: tags/rel-2.1c/rtmp.h
==============================================================================
--- tags/rel-2.1c/rtmp.h Sat Jan 9 08:20:02 2010 (r228)
+++ tags/rel-2.1c/rtmp.h Sat Jan 9 08:25:54 2010 (r229)
@@ -159,7 +159,6 @@ typedef struct RTMP_LNK
typedef struct RTMP
{
- int m_socket;
int m_inChunkSize;
int m_outChunkSize;
int m_nBWCheckCounter;
Modified: tags/rel-2.1c/rtmpdump.c
==============================================================================
--- tags/rel-2.1c/rtmpdump.c Sat Jan 9 08:20:02 2010 (r228)
+++ tags/rel-2.1c/rtmpdump.c Sat Jan 9 08:25:54 2010 (r229)
@@ -831,7 +831,7 @@ GetLastKeyframe(FILE * file, // output f
uint32_t timestamp = RTMP_LIB::AMF_DecodeInt24(buffer);
timestamp |= (buffer[3]<<24);
- Log(LOGDEBUG, "Previuos timestamp: %d ms", timestamp);
+ Log(LOGDEBUG, "Previous timestamp: %d ms", timestamp);
*/
if (*dSeek != 0)
Modified: tags/rel-2.1c/rtmpsuck.c
==============================================================================
--- tags/rel-2.1c/rtmpsuck.c Sat Jan 9 08:20:02 2010 (r228)
+++ tags/rel-2.1c/rtmpsuck.c Sat Jan 9 08:25:54 2010 (r229)
@@ -325,9 +325,11 @@ ServeInvoke(STREAMING_SERVER *server, in
if (AVMATCH(&av, &fl->f_path))
count++;
}
+ /* strip trailing URL parameters */
q = memchr(av.av_val, '?', av.av_len);
if (q)
av.av_len = q - av.av_val;
+ /* strip leading slash components */
for (p=av.av_val+av.av_len-1; p>=av.av_val; p--)
if (*p == '/')
{
@@ -336,6 +338,12 @@ ServeInvoke(STREAMING_SERVER *server, in
av.av_val = p;
break;
}
+ /* skip leading dot */
+ if (av.av_val[0] == '.')
+ {
+ av.av_val++;
+ av.av_len--;
+ }
flen = av.av_len;
/* hope there aren't more than 255 dups */
if (count)
@@ -927,6 +935,7 @@ void doServe(STREAMING_SERVER * server,
cleanup:
LogPrintf("Closing connection... ");
RTMP_Close(&server->rs);
+ RTMP_Close(&server->rc);
while (server->f_head)
{
Flist *fl = server->f_head;
@@ -1096,7 +1105,7 @@ main(int argc, char **argv)
LogPrintf("RTMP Proxy Server %s\n", RTMPDUMP_VERSION);
LogPrintf("(c) 2010 Andrej Stepanchuk, Howard Chu; license: GPL\n\n");
- debuglevel = LOGDEBUG;
+ debuglevel = LOGINFO;
if (argc > 1 && !strcmp(argv[1], "-z"))
debuglevel = LOGALL;
More information about the rtmpdump
mailing list