]> granicus.if.org Git - curl/commitdiff
RMTP: the version code is now rtmp aware
authorHoward Chu <hyc@highlandsun.com>
Sat, 15 May 2010 20:13:17 +0000 (22:13 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 15 May 2010 20:13:17 +0000 (22:13 +0200)
configure.ac
lib/version.c

index bad358610e0ade5c1f5813411875e71879ba1a75..77a07d49a6c85f314f03de734a4684d65035d218 100644 (file)
@@ -2735,7 +2735,7 @@ if test "x$CURL_DISABLE_RTSP" != "x1"; then
   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
 fi
 if test "x$USE_LIBRTMP" = "x1"; then
-  SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP RTMPT RTMPE RTMPTE RTMPS RTMPTS"
+  SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
 fi
 
 dnl replace spaces with newlines
index 86cb113d751f1b79214c4797e491f7fe313c0a31..6144f3268a104a2749bdb3cd28a64ce6cdc68b88 100644 (file)
 #include <iconv.h>
 #endif
 
+#ifdef USE_LIBRTMP
+#include <librtmp/rtmp.h>
+#endif
+
 #ifdef USE_LIBSSH2
 #include <libssh2.h>
 #endif
@@ -107,15 +111,29 @@ char *curl_version(void)
   ptr += len;
 #endif
 #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);
   left -= 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
 
   return version;
@@ -164,6 +182,9 @@ static const char * const protocols[] = {
 #if defined(USE_SSL) && !defined(CURL_DISABLE_POP3)
   "pop3s",
 #endif
+#ifdef USE_LIBRTMP
+  "rtmp",
+#endif
 #ifndef CURL_DISABLE_RTSP
   "rtsp",
 #endif