1
0
mirror of https://github.com/moparisthebest/curl synced 2025-03-11 07:39:50 -04:00

RMTP: the version code is now rtmp aware

This commit is contained in:
Howard Chu 2010-05-15 22:13:17 +02:00 committed by Daniel Stenberg
parent 510836f80b
commit 027ceb37a1
2 changed files with 27 additions and 6 deletions

View File

@ -2735,7 +2735,7 @@ if test "x$CURL_DISABLE_RTSP" != "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP" SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
fi fi
if test "x$USE_LIBRTMP" = "x1"; then if test "x$USE_LIBRTMP" = "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP RTMPT RTMPE RTMPTE RTMPS RTMPTS" SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
fi fi
dnl replace spaces with newlines dnl replace spaces with newlines

View File

@ -44,6 +44,10 @@
#include <iconv.h> #include <iconv.h>
#endif #endif
#ifdef USE_LIBRTMP
#include <librtmp/rtmp.h>
#endif
#ifdef USE_LIBSSH2 #ifdef USE_LIBSSH2
#include <libssh2.h> #include <libssh2.h>
#endif #endif
@ -107,15 +111,29 @@ char *curl_version(void)
ptr += len; ptr += len;
#endif #endif
#ifdef USE_LIBSSH2 #ifdef USE_LIBSSH2
(void)snprintf(ptr, left, " libssh2/%s", CURL_LIBSSH2_VERSION);
/*
If another lib version is added below libssh2, this code would instead
have to do:
len = snprintf(ptr, left, " libssh2/%s", CURL_LIBSSH2_VERSION); len = snprintf(ptr, left, " libssh2/%s", CURL_LIBSSH2_VERSION);
left -= len; left -= len;
ptr += len; ptr += len;
#endif
#ifdef USE_LIBRTMP
{
char suff[2];
if (RTMP_LIB_VERSION & 0xff) {
suff[0] = (RTMP_LIB_VERSION & 0xff) + 'a' - 1;
suff[1] = '\0';
} else {
suff[0] = '\0';
}
len = snprintf(ptr, left, " librtmp/%d.%d%s",
RTMP_LIB_VERSION >> 16, (RTMP_LIB_VERSION >> 8) & 0xff, suff);
/*
If another lib version is added below this one, this code would
also have to do:
left -= len;
ptr += len;
*/ */
}
#endif #endif
return version; return version;
@ -164,6 +182,9 @@ static const char * const protocols[] = {
#if defined(USE_SSL) && !defined(CURL_DISABLE_POP3) #if defined(USE_SSL) && !defined(CURL_DISABLE_POP3)
"pop3s", "pop3s",
#endif #endif
#ifdef USE_LIBRTMP
"rtmp",
#endif
#ifndef CURL_DISABLE_RTSP #ifndef CURL_DISABLE_RTSP
"rtsp", "rtsp",
#endif #endif