vcpkg/ports/librtmp/hide_netstackdump.patch

59 lines
1.5 KiB
Diff
Raw Normal View History

2017-10-05 20:56:49 +08:00
diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c
2018-01-18 20:20:18 +08:00
index 5ef3ae9..7c6a010 100644
2017-10-05 20:56:49 +08:00
--- a/librtmp/rtmp.c
+++ b/librtmp/rtmp.c
2018-01-18 20:20:18 +08:00
@@ -129,7 +129,7 @@ static int clk_tck;
uint32_t
RTMP_GetTime()
{
-#ifdef _DEBUG
+#if defined(_DEBUG) && !defined(LIBRTMP_ONLY)
return 0;
#elif defined(_WIN32)
return timeGetTime();
@@ -1256,7 +1256,7 @@ RTMP_ClientPacket(RTMP *r, RTMPPacket *packet)
return bHasMediaPacket;
}
-#ifdef _DEBUG
+#if defined(_DEBUG) && !defined(LIBRTMP_ONLY)
extern FILE *netstackdump;
extern FILE *netstackdump_read;
#endif
2018-01-09 04:12:37 +08:00
@@ -1333,7 +1333,7 @@ ReadN(RTMP *r, char *buffer, int n)
2017-10-05 20:56:49 +08:00
SendBytesReceived(r);
}
/*RTMP_Log(RTMP_LOGDEBUG, "%s: %d bytes\n", __FUNCTION__, nBytes); */
-#ifdef _DEBUG
+#if defined(_DEBUG) && !defined(LIBRTMP_ONLY)
fwrite(ptr, 1, nBytes, netstackdump_read);
#endif
2018-01-18 20:20:18 +08:00
@@ -3064,7 +3064,7 @@ HandShake(RTMP *r, int FP9HandShake)
memset(&clientsig[4], 0, 4);
-#ifdef _DEBUG
+#if defined(_DEBUG) && !defined(LIBRTMP_ONLY)
for (i = 8; i < RTMP_SIG_SIZE; i++)
clientsig[i] = 0xff;
#else
@@ -3136,7 +3136,7 @@ SHandShake(RTMP *r)
memcpy(serversig, &uptime, 4);
memset(&serversig[4], 0, 4);
-#ifdef _DEBUG
+#if defined(_DEBUG) && !defined(LIBRTMP_ONLY)
for (i = 8; i < RTMP_SIG_SIZE; i++)
serversig[i] = 0xff;
#else
2018-01-09 04:12:37 +08:00
@@ -3553,7 +3553,7 @@ RTMPSockBuf_Send(RTMPSockBuf *sb, const char *buf, int len)
2017-10-05 20:56:49 +08:00
{
int rc;
-#ifdef _DEBUG
+#if defined(_DEBUG) && !defined(LIBRTMP_ONLY)
fwrite(buf, 1, len, netstackdump);
#endif