[rtmpdump] r456 - in trunk: Makefile librtmp/Makefile librtmp/hashswf.c librtmp/rtmp.c
hyc
subversion at mplayerhq.hu
Fri Apr 30 01:47:31 CEST 2010
Author: hyc
Date: Fri Apr 30 01:47:30 2010
New Revision: 456
Log:
Add -DNO_SSL option for omitting SSL support (just use rtmpe, no rtmps)
Modified:
trunk/Makefile
trunk/librtmp/Makefile
trunk/librtmp/hashswf.c
trunk/librtmp/rtmp.c
Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile Fri Apr 30 01:33:33 2010 (r455)
+++ trunk/Makefile Fri Apr 30 01:47:30 2010 (r456)
@@ -13,8 +13,7 @@ CRYPTO_LIB=$(LIB_$(CRYPTO))
DEF_=-DNO_CRYPTO
CRYPTO_DEF=$(DEF_$(CRYPTO))
-
-DEF=-DRTMPDUMP_VERSION=\"$(VERSION)\" $(CRYPTO_DEF)
+DEF=-DRTMPDUMP_VERSION=\"$(VERSION)\" $(CRYPTO_DEF) $(XDEF)
OPT=-O2
CFLAGS=-Wall $(XCFLAGS) $(INC) $(DEF) $(OPT)
LDFLAGS=-Wall $(XLDFLAGS)
Modified: trunk/librtmp/Makefile
==============================================================================
--- trunk/librtmp/Makefile Fri Apr 30 01:33:33 2010 (r455)
+++ trunk/librtmp/Makefile Fri Apr 30 01:47:30 2010 (r456)
@@ -17,7 +17,7 @@ REQ_OPENSSL=libssl,libcrypto
CRYPTO_REQ=$(REQ_$(CRYPTO))
CRYPTO_DEF=$(DEF_$(CRYPTO))
-DEF=-DRTMPDUMP_VERSION=\"$(VERSION)\" $(CRYPTO_DEF)
+DEF=-DRTMPDUMP_VERSION=\"$(VERSION)\" $(CRYPTO_DEF) $(XDEF)
OPT=-O2
CFLAGS=-Wall $(XCFLAGS) $(INC) $(DEF) $(OPT)
Modified: trunk/librtmp/hashswf.c
==============================================================================
--- trunk/librtmp/hashswf.c Fri Apr 30 01:33:33 2010 (r455)
+++ trunk/librtmp/hashswf.c Fri Apr 30 01:47:30 2010 (r456)
@@ -155,6 +155,11 @@ HTTP_get(struct HTTP_ctx *http, const ch
#ifdef CRYPTO
if (ssl)
{
+#ifdef NO_SSL
+ RTMP_Log(RTMP_LOGERROR, "%s, No SSL/TLS support", __FUNCTION__);
+ ret = HTTPRES_BAD_REQUEST;
+ goto leave;
+#else
TLS_client(RTMP_TLS_ctx, sb.sb_ssl);
TLS_setfd(sb.sb_ssl, sb.sb_socket);
if ((i = TLS_connect(sb.sb_ssl)) < 0)
@@ -163,6 +168,7 @@ HTTP_get(struct HTTP_ctx *http, const ch
ret = HTTPRES_LOST_CONNECTION;
goto leave;
}
+#endif
}
#endif
RTMPSockBuf_Send(&sb, sb.sb_buf, i);
Modified: trunk/librtmp/rtmp.c
==============================================================================
--- trunk/librtmp/rtmp.c Fri Apr 30 01:33:33 2010 (r455)
+++ trunk/librtmp/rtmp.c Fri Apr 30 01:47:30 2010 (r456)
@@ -201,14 +201,14 @@ RTMP_TLS_Init()
#ifdef USE_POLARSSL
RTMP_TLS_ctx = calloc(1,sizeof(struct tls_ctx));
havege_init(&RTMP_TLS_ctx->hs);
-#elif defined(USE_GNUTLS)
+#elif defined(USE_GNUTLS) && !defined(NO_SSL)
gnutls_global_init();
RTMP_TLS_ctx = malloc(sizeof(struct tls_ctx));
gnutls_certificate_allocate_credentials(&RTMP_TLS_ctx->cred);
gnutls_priority_init(&RTMP_TLS_ctx->prios, "NORMAL", NULL);
gnutls_certificate_set_x509_trust_file(RTMP_TLS_ctx->cred,
"ca.pem", GNUTLS_X509_FMT_PEM);
-#else /* USE_OPENSSL */
+#elif !defined(NO_SSL) /* USE_OPENSSL */
SSL_load_error_strings();
SSL_library_init();
OpenSSL_add_all_digests();
@@ -811,7 +811,7 @@ RTMP_Connect1(RTMP *r, RTMPPacket *cp)
{
if (r->Link.protocol & RTMP_FEATURE_SSL)
{
-#ifdef CRYPTO
+#if defined(CRYPTO) && !defined(NO_SSL)
TLS_client(RTMP_TLS_ctx, r->m_sb.sb_ssl);
TLS_setfd(r->m_sb.sb_ssl, r->m_sb.sb_socket);
if (TLS_connect(r->m_sb.sb_ssl) < 0)
@@ -821,7 +821,7 @@ RTMP_Connect1(RTMP *r, RTMPPacket *cp)
return false;
}
#else
- RTMP_Log(RTMP_LOGERROR, "%s, no CRYPTO support", __FUNCTION__);
+ RTMP_Log(RTMP_LOGERROR, "%s, no SSL/TLS support", __FUNCTION__);
RTMP_Close(r);
return false;
@@ -3303,7 +3303,7 @@ RTMPSockBuf_Fill(RTMPSockBuf *sb)
while (1)
{
nBytes = sizeof(sb->sb_buf) - sb->sb_size - (sb->sb_start - sb->sb_buf);
-#ifdef CRYPTO
+#if defined(CRYPTO) && !defined(NO_SSL)
if (sb->sb_ssl)
{
nBytes = TLS_read(sb->sb_ssl, sb->sb_start + sb->sb_size, nBytes);
@@ -3346,7 +3346,7 @@ RTMPSockBuf_Send(RTMPSockBuf *sb, const
fwrite(buf, 1, len, netstackdump);
#endif
-#ifdef CRYPTO
+#if defined(CRYPTO) && !defined(NO_SSL)
if (sb->sb_ssl)
{
rc = TLS_write(sb->sb_ssl, buf, len);
@@ -3362,7 +3362,7 @@ RTMPSockBuf_Send(RTMPSockBuf *sb, const
int
RTMPSockBuf_Close(RTMPSockBuf *sb)
{
-#ifdef CRYPTO
+#if defined(CRYPTO) && !defined(NO_SSL)
if (sb->sb_ssl)
{
TLS_shutdown(sb->sb_ssl);
More information about the rtmpdump
mailing list