From 268cee2efbec2c9527220646db127ff53220dcf5 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 10 Feb 2026 08:54:14 +0100 Subject: [PATCH] rtmp: drop support - librtmp has no test cases, makes no proper releases and has not had a single commit within the last year - librtmp parses the URL itself and requires non-compliant URLs for this - we have no RTMP tests - RTMP is barely used by curl users (2.2% self-identified in the 2025 survey) Closes #20673 --- .github/labeler.yml | 8 - .github/scripts/cmp-config.pl | 1 - .github/workflows/codeql.yml | 6 +- .github/workflows/linux-old.yml | 8 +- .github/workflows/linux.yml | 10 +- .github/workflows/macos.yml | 12 +- CMake/FindLibrtmp.cmake | 116 ------- CMake/curl-config.in.cmake | 4 - CMakeLists.txt | 9 - Makefile.am | 1 - README.md | 4 +- configure.ac | 85 ----- docs/DEPRECATE.md | 13 +- docs/FAQ.md | 4 +- docs/HISTORY.md | 4 + docs/INSTALL-CMAKE.md | 3 - docs/INSTALL.md | 1 - docs/URL-SYNTAX.md | 24 +- docs/cmdline-opts/_DESCRIPTION.md | 4 +- docs/cmdline-opts/_PROTOCOLS.md | 3 - docs/libcurl/opts/CURLOPT_PROTOCOLS_STR.md | 8 +- .../opts/CURLOPT_REDIR_PROTOCOLS_STR.md | 4 +- docs/libcurl/symbols-in-versions | 12 +- lib/Makefile.inc | 2 - lib/curl_config-cmake.h.in | 3 - lib/curl_rtmp.c | 326 ------------------ lib/curl_rtmp.h | 36 -- lib/url.c | 63 ++-- lib/urldata.h | 3 - lib/version.c | 28 -- projects/vms/generate_config_vms_h_curl.com | 3 - scripts/cd2nroff | 2 - scripts/ciconfig.pl | 1 - scripts/schemetable.c | 6 - src/tool_help.c | 5 +- 35 files changed, 77 insertions(+), 745 deletions(-) delete mode 100644 CMake/FindLibrtmp.cmake delete mode 100644 lib/curl_rtmp.c delete mode 100644 lib/curl_rtmp.h diff --git a/.github/labeler.yml b/.github/labeler.yml index 4a73d014ab..d619d51148 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -369,14 +369,6 @@ POP3: lib/pop3.*\ }" -RTMP: - - all: - - changed-files: - - any-glob-to-all-files: "{\ - CMake/FindLibrtmp.cmake,\ - lib/curl_rtmp.*\ - }" - RTSP: - all: - changed-files: diff --git a/.github/scripts/cmp-config.pl b/.github/scripts/cmp-config.pl index eef6b24927..89a99491b0 100755 --- a/.github/scripts/cmp-config.pl +++ b/.github/scripts/cmp-config.pl @@ -53,7 +53,6 @@ my %remove = ( '#define HAVE_LDAP_SSL 1' => 1, '#define HAVE_LIBBROTLIDEC 1' => 1, '#define HAVE_LIBPSL_H 1' => 1, - '#define HAVE_LIBRTMP_RTMP_H 1' => 1, '#define HAVE_LIBSOCKET 1' => 1, '#define HAVE_LIBSSH' => 1, '#define HAVE_LIBSSH2 1' => 1, diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 815ad772b7..17fffca857 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -74,7 +74,7 @@ jobs: sudo rm -f /etc/apt/sources.list.d/{azure-cli.sources,microsoft-prod.list,ondrej-ubuntu-php-noble.sources} sudo apt-get -o Dpkg::Use-Pty=0 update sudo apt-get -o Dpkg::Use-Pty=0 install libpsl-dev libbrotli-dev libidn2-dev libssh2-1-dev libssh-dev \ - libnghttp2-dev libldap-dev libkrb5-dev librtmp-dev libgnutls28-dev libwolfssl-dev + libnghttp2-dev libldap-dev libkrb5-dev libgnutls28-dev libwolfssl-dev HOMEBREW_NO_AUTO_UPDATE=1 /home/linuxbrew/.linuxbrew/bin/brew install c-ares gsasl libnghttp3 libngtcp2 mbedtls rustls-ffi - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -110,7 +110,7 @@ jobs: export PKG_CONFIG_PATH; PKG_CONFIG_PATH="$(brew --prefix c-ares)/lib/pkgconfig:$(brew --prefix mbedtls)/lib/pkgconfig:$(brew --prefix rustls-ffi)/lib/pkgconfig:$(brew --prefix gsasl)/lib/pkgconfig" cmake -B _bld1 -G Ninja -DCURL_DISABLE_TYPECHECK=ON -DCURL_WERROR=ON -DENABLE_DEBUG=ON \ -DCURL_USE_GNUTLS=ON -DCURL_USE_MBEDTLS=ON -DCURL_USE_RUSTLS=ON -DCURL_USE_WOLFSSL=ON \ - -DUSE_LIBRTMP=ON -DCURL_USE_GSASL=ON -DCURL_USE_GSSAPI=ON -DUSE_SSLS_EXPORT=ON -DUSE_ECH=ON -DENABLE_ARES=ON \ + -DCURL_USE_GSASL=ON -DCURL_USE_GSSAPI=ON -DUSE_SSLS_EXPORT=ON -DUSE_ECH=ON -DENABLE_ARES=ON \ -DCURL_DISABLE_VERBOSE_STRINGS=ON cmake --build _bld1 cmake --build _bld1 --target testdeps @@ -121,7 +121,7 @@ jobs: cmake -B _bld2 -G Ninja -DCURL_DISABLE_TYPECHECK=ON -DCURL_WERROR=ON \ -DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR="$(brew --prefix openssl)" -DUSE_NGTCP2=ON \ -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON \ - -DUSE_LIBRTMP=ON -DCURL_USE_GSASL=ON -DCURL_USE_GSSAPI=ON -DUSE_SSLS_EXPORT=ON + -DCURL_USE_GSASL=ON -DCURL_USE_GSSAPI=ON -DUSE_SSLS_EXPORT=ON cmake --build _bld2 cmake --build _bld2 --target testdeps cmake --build _bld2 --target curl-examples-build diff --git a/.github/workflows/linux-old.yml b/.github/workflows/linux-old.yml index af51acb73c..e11cc79fa1 100644 --- a/.github/workflows/linux-old.yml +++ b/.github/workflows/linux-old.yml @@ -69,7 +69,7 @@ jobs: sha256sum freexian-archive-keyring_2022.06.08_all.deb && dpkg -i freexian-archive-keyring_2022.06.08_all.deb echo 'deb http://deb.freexian.com/extended-lts stretch-lts main contrib non-free' | tee /etc/apt/sources.list.d/extended-lts.list apt-get -o Dpkg::Use-Pty=0 update - apt-get -o Dpkg::Use-Pty=0 install -y --no-install-suggests --no-install-recommends make automake autoconf libtool gcc pkg-config libpsl-dev libzstd-dev zlib1g-dev libc-ares-dev libkrb5-dev libldap2-dev librtmp-dev stunnel4 + apt-get -o Dpkg::Use-Pty=0 install -y --no-install-suggests --no-install-recommends make automake autoconf libtool gcc pkg-config libpsl-dev libzstd-dev zlib1g-dev libc-ares-dev libkrb5-dev libldap2-dev stunnel4 # GitHub's actions/checkout needs newer glibc and libstdc++. The latter also depends on # gcc-8-base, but it does not actually seem used in our situation and is not available in # the main repo, so force the install. @@ -97,7 +97,7 @@ jobs: mkdir bld-1 cd bld-1 ~/cmake/bin/cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \ - -DCURL_ENABLE_SSL=OFF -DENABLE_ARES=OFF -DCURL_ZSTD=OFF -DCURL_USE_GSSAPI=OFF -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF -DUSE_LIBRTMP=ON + -DCURL_ENABLE_SSL=OFF -DENABLE_ARES=OFF -DCURL_ZSTD=OFF -DCURL_USE_GSSAPI=OFF -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF - name: 'CM build-only build' run: VERBOSE=1 make -C bld-1 install @@ -121,7 +121,7 @@ jobs: mkdir bld-cares cd bld-cares ~/cmake/bin/cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \ - -DCURL_ENABLE_SSL=OFF -DENABLE_ARES=ON -DCURL_USE_GSSAPI=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF -DUSE_LIBRTMP=ON \ + -DCURL_ENABLE_SSL=OFF -DENABLE_ARES=ON -DCURL_USE_GSSAPI=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF \ -DCURL_LIBCURL_VERSIONED_SYMBOLS=ON - name: 'CM configure log' @@ -160,7 +160,7 @@ jobs: cd bld-am ../configure --prefix="$PWD"/../curl-install-am --enable-unity --enable-warnings --enable-werror --disable-shared \ --disable-dependency-tracking --enable-option-checking=fatal \ - --without-ssl --enable-ares --without-libssh2 --with-zstd --with-gssapi --with-librtmp + --without-ssl --enable-ares --without-libssh2 --with-zstd --with-gssapi - name: 'AM configure log' if: ${{ !cancelled() }} diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 57dec5a0dd..6177a61666 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -232,7 +232,7 @@ jobs: --with-openssl --enable-debug --disable-unity --disable-dict --disable-gopher --disable-ldap --disable-telnet --disable-imap --disable-pop3 --disable-smtp - --without-librtmp --disable-rtsp + --disable-rtsp --without-libssh2 --without-libssh --disable-tftp --disable-ftp --disable-file --disable-smb @@ -249,14 +249,14 @@ jobs: generate: -DCURL_USE_OPENSSL=ON -DENABLE_DEBUG=ON -DENABLE_ARES=ON - name: 'openssl i686' - install_packages: gcc-14-i686-linux-gnu libssl-dev:i386 librtmp-dev:i386 libssh2-1-dev:i386 libidn2-dev:i386 libc-ares-dev:i386 zlib1g-dev:i386 + install_packages: gcc-14-i686-linux-gnu libssl-dev:i386 libssh2-1-dev:i386 libidn2-dev:i386 libc-ares-dev:i386 zlib1g-dev:i386 configure: >- PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig CC=i686-linux-gnu-gcc-14 CPPFLAGS=-I/usr/include/i386-linux-gnu LDFLAGS=-L/usr/lib/i386-linux-gnu --host=i686-linux-gnu - --with-openssl --with-librtmp --with-libssh2 --with-libidn2 --enable-ares --enable-debug + --with-openssl --with-libssh2 --with-libidn2 --enable-ares --enable-debug - name: '!ssl !http !smtp !imap' image: ubuntu-24.04-arm @@ -275,7 +275,7 @@ jobs: -DCURL_DISABLE_LDAP=ON -DUSE_LIBIDN2=OFF -DCURL_USE_LIBSSH2=OFF - name: 'clang-tidy' - install_packages: clang-20 clang-tidy-20 libssl-dev libidn2-dev libssh2-1-dev libnghttp2-dev libldap-dev libkrb5-dev librtmp-dev libgnutls28-dev + install_packages: clang-20 clang-tidy-20 libssl-dev libidn2-dev libssh2-1-dev libnghttp2-dev libldap-dev libkrb5-dev libgnutls28-dev install_steps: skiprun mbedtls-latest-intel rustls wolfssl-opensslextra-intel install_steps_brew: gsasl CC: clang-20 @@ -283,7 +283,7 @@ jobs: PKG_CONFIG_PATH: /home/runner/wolfssl-opensslextra/lib/pkgconfig:/home/runner/mbedtls/lib/pkgconfig:/home/runner/rustls/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/gsasl/lib/pkgconfig generate: >- -DCURL_USE_OPENSSL=ON -DCURL_USE_WOLFSSL=ON -DCURL_USE_GNUTLS=ON -DCURL_USE_MBEDTLS=ON -DCURL_USE_RUSTLS=ON - -DCURL_USE_GSASL=ON -DUSE_LIBRTMP=ON + -DCURL_USE_GSASL=ON -DUSE_ECH=ON -DCURL_USE_GSSAPI=ON -DUSE_SSLS_EXPORT=ON -DCURL_CLANG_TIDY=ON -DCLANG_TIDY=/usr/bin/clang-tidy-20 diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index d8f827e72a..1953366b42 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -240,7 +240,7 @@ jobs: -DCURL_ENABLE_SSL=OFF -DHTTP_ONLY=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_ALTSVC=ON -DENABLE_UNIX_SOCKETS=OFF -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF -DUSE_NGHTTP2=OFF - -DCURL_USE_GSSAPI=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF -DUSE_LIBRTMP=OFF + -DCURL_USE_GSSAPI=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF -DCURL_BROTLI=OFF -DCURL_ZLIB=OFF -DCURL_ZSTD=OFF -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF @@ -265,19 +265,19 @@ jobs: compiler: clang generate: -DENABLE_DEBUG=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DCURL_USE_LIBSSH2=OFF tflags: '--test-event --min=1300' - - name: 'OpenSSL gsasl rtmp AppleIDN SecTrust +examples' + - name: 'OpenSSL gsasl AppleIDN SecTrust +examples' compiler: clang - install: libnghttp3 libngtcp2 gsasl rtmpdump - generate: -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DCURL_USE_GSASL=ON -DUSE_LIBRTMP=ON -DUSE_APPLE_IDN=ON -DUSE_NGTCP2=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DUSE_APPLE_SECTRUST=ON + install: libnghttp3 libngtcp2 gsasl + generate: -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DCURL_USE_GSASL=ON -DUSE_APPLE_IDN=ON -DUSE_NGTCP2=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DUSE_APPLE_SECTRUST=ON - name: 'MultiSSL AppleIDN clang-tidy +examples' image: macos-26 compiler: clang - install: llvm gnutls nettle libressl krb5 mbedtls gsasl rustls-ffi rtmpdump libssh fish + install: llvm gnutls nettle libressl krb5 mbedtls gsasl rustls-ffi libssh fish install_steps: skiprun chkprefill: _chkprefill generate: >- -DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/libressl -DCURL_DEFAULT_SSL_BACKEND=openssl - -DCURL_USE_GNUTLS=ON -DCURL_USE_MBEDTLS=ON -DCURL_USE_RUSTLS=ON -DENABLE_ARES=ON -DCURL_USE_GSASL=ON -DUSE_LIBRTMP=ON + -DCURL_USE_GNUTLS=ON -DCURL_USE_MBEDTLS=ON -DCURL_USE_RUSTLS=ON -DENABLE_ARES=ON -DCURL_USE_GSASL=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON -DUSE_APPLE_IDN=ON -DUSE_SSLS_EXPORT=ON -DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=/opt/homebrew/opt/krb5 -DCURL_BROTLI=ON -DCURL_ZSTD=ON diff --git a/CMake/FindLibrtmp.cmake b/CMake/FindLibrtmp.cmake deleted file mode 100644 index 853ba63ad0..0000000000 --- a/CMake/FindLibrtmp.cmake +++ /dev/null @@ -1,116 +0,0 @@ -#*************************************************************************** -# _ _ ____ _ -# Project ___| | | | _ \| | -# / __| | | | |_) | | -# | (__| |_| | _ <| |___ -# \___|\___/|_| \_\_____| -# -# Copyright (C) Daniel Stenberg, , et al. -# -# This software is licensed as described in the file COPYING, which -# you should have received as part of this distribution. The terms -# are also available at https://curl.se/docs/copyright.html. -# -# You may opt to use, copy, modify, merge, publish, distribute and/or sell -# copies of the Software, and permit persons to whom the Software is -# furnished to do so, under the terms of the COPYING file. -# -# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -# KIND, either express or implied. -# -# SPDX-License-Identifier: curl -# -########################################################################### -# Find the librtmp library -# -# Input variables: -# -# - `LIBRTMP_INCLUDE_DIR`: Absolute path to librtmp include directory. -# - `LIBRTMP_LIBRARY`: Absolute path to `librtmp` library. -# -# Defines: -# -# - `LIBRTMP_FOUND`: System has librtmp. -# - `LIBRTMP_VERSION`: Version of librtmp. -# - `CURL::librtmp`: librtmp library target. - -set(_librtmp_pc_requires "librtmp") - -if(CURL_USE_PKGCONFIG AND - NOT DEFINED LIBRTMP_INCLUDE_DIR AND - NOT DEFINED LIBRTMP_LIBRARY) - find_package(PkgConfig QUIET) - pkg_check_modules(_librtmp ${_librtmp_pc_requires}) -endif() - -if(_librtmp_FOUND AND _librtmp_INCLUDE_DIRS) - set(Librtmp_FOUND TRUE) - set(LIBRTMP_FOUND TRUE) - set(LIBRTMP_VERSION ${_librtmp_VERSION}) - message(STATUS "Found Librtmp (via pkg-config): ${_librtmp_INCLUDE_DIRS} (found version \"${LIBRTMP_VERSION}\")") -else() - find_path(LIBRTMP_INCLUDE_DIR NAMES "librtmp/rtmp.h") - find_library(LIBRTMP_LIBRARY NAMES "rtmp") - - unset(LIBRTMP_VERSION CACHE) - if(LIBRTMP_INCLUDE_DIR AND EXISTS "${LIBRTMP_INCLUDE_DIR}/librtmp/rtmp.h") - set(_version_regex "#[\t ]*define[\t ]+RTMP_LIB_VERSION[\t ]+0x([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F]).*") - file(STRINGS "${LIBRTMP_INCLUDE_DIR}/librtmp/rtmp.h" _version_str REGEX "${_version_regex}") - string(REGEX REPLACE "${_version_regex}" "\\1" _version_str1 "${_version_str}") - string(REGEX REPLACE "${_version_regex}" "\\2" _version_str2 "${_version_str}") - if(CMAKE_VERSION VERSION_LESS 3.13) - # No support for hex version numbers, just strip leading zeroes - string(REGEX REPLACE "^0" "" _version_str1 "${_version_str1}") - string(REGEX REPLACE "^0" "" _version_str2 "${_version_str2}") - else() - math(EXPR _version_str1 "0x${_version_str1}" OUTPUT_FORMAT DECIMAL) - math(EXPR _version_str2 "0x${_version_str2}" OUTPUT_FORMAT DECIMAL) - endif() - set(LIBRTMP_VERSION "${_version_str1}.${_version_str2}") - unset(_version_regex) - unset(_version_str1) - unset(_version_str2) - endif() - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(Librtmp - REQUIRED_VARS - LIBRTMP_INCLUDE_DIR - LIBRTMP_LIBRARY - VERSION_VAR - LIBRTMP_VERSION - ) - - if(LIBRTMP_FOUND) - set(_librtmp_INCLUDE_DIRS ${LIBRTMP_INCLUDE_DIR}) - set(_librtmp_LIBRARIES ${LIBRTMP_LIBRARY}) - endif() - - mark_as_advanced(LIBRTMP_INCLUDE_DIR LIBRTMP_LIBRARY) - - # Necessary when linking a static librtmp - find_package(OpenSSL) - if(OpenSSL_FOUND) - list(APPEND _librtmp_LIBRARIES OpenSSL::SSL OpenSSL::Crypto) - endif() -endif() - -if(LIBRTMP_FOUND) - if(WIN32) - list(APPEND _librtmp_LIBRARIES "winmm") - endif() - - if(CMAKE_VERSION VERSION_LESS 3.13) - link_directories(${_librtmp_LIBRARY_DIRS}) - endif() - - if(NOT TARGET CURL::librtmp) - add_library(CURL::librtmp INTERFACE IMPORTED) - set_target_properties(CURL::librtmp PROPERTIES - INTERFACE_LIBCURL_PC_MODULES "${_librtmp_pc_requires}" - INTERFACE_COMPILE_OPTIONS "${_librtmp_CFLAGS}" - INTERFACE_INCLUDE_DIRECTORIES "${_librtmp_INCLUDE_DIRS}" - INTERFACE_LINK_DIRECTORIES "${_librtmp_LIBRARY_DIRS}" - INTERFACE_LINK_LIBRARIES "${_librtmp_LIBRARIES}") - endif() -endif() diff --git a/CMake/curl-config.in.cmake b/CMake/curl-config.in.cmake index 62134cbcd8..af018df757 100644 --- a/CMake/curl-config.in.cmake +++ b/CMake/curl-config.in.cmake @@ -93,10 +93,6 @@ if("@USE_LIBPSL@") find_dependency(Libpsl) list(APPEND _curl_libs CURL::libpsl) endif() -if("@USE_LIBRTMP@") - find_dependency(Librtmp) - list(APPEND _curl_libs CURL::librtmp) -endif() if("@USE_LIBSSH@") find_dependency(Libssh) list(APPEND _curl_libs CURL::libssh) diff --git a/CMakeLists.txt b/CMakeLists.txt index 96d409b556..c5b9eee067 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1338,12 +1338,6 @@ if(CURL_USE_LIBUV) set(HAVE_UV_H ON) endif() -option(USE_LIBRTMP "Enable librtmp from rtmpdump" OFF) -if(USE_LIBRTMP) - find_package(Librtmp REQUIRED) - list(APPEND CURL_LIBS CURL::librtmp) -endif() - option(ENABLE_UNIX_SOCKETS "Enable Unix domain sockets support" ON) if(ENABLE_UNIX_SOCKETS) if(WIN32 OR DOS) @@ -1982,7 +1976,6 @@ curl_add_if("SFTP" USE_LIBSSH2 OR USE_LIBSSH) curl_add_if("IPFS" NOT CURL_DISABLE_IPFS) curl_add_if("IPNS" NOT CURL_DISABLE_IPFS) curl_add_if("RTSP" NOT CURL_DISABLE_RTSP) -curl_add_if("RTMP" USE_LIBRTMP) curl_add_if("MQTT" NOT CURL_DISABLE_MQTT) curl_add_if("MQTTS" NOT CURL_DISABLE_MQTT AND _ssl_enabled) curl_add_if("WS" NOT CURL_DISABLE_WEBSOCKETS) @@ -2365,7 +2358,6 @@ if(NOT CURL_DISABLE_INSTALL) # USE_GNUTLS # USE_GSASL # USE_LIBPSL - # USE_LIBRTMP # USE_LIBSSH # USE_LIBSSH2 # USE_LIBUV @@ -2402,7 +2394,6 @@ if(NOT CURL_DISABLE_INSTALL) "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindLibgsasl.cmake" "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindLibidn2.cmake" "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindLibpsl.cmake" - "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindLibrtmp.cmake" "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindLibssh.cmake" "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindLibssh2.cmake" "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindLibuv.cmake" diff --git a/Makefile.am b/Makefile.am index 1913f5d007..bb1e7759f7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -40,7 +40,6 @@ CMAKE_DIST = \ CMake/FindLibgsasl.cmake \ CMake/FindLibidn2.cmake \ CMake/FindLibpsl.cmake \ - CMake/FindLibrtmp.cmake \ CMake/FindLibssh.cmake \ CMake/FindLibssh2.cmake \ CMake/FindLibuv.cmake \ diff --git a/README.md b/README.md index 8834e48485..9f77de607b 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ SPDX-License-Identifier: curl curl is a command-line tool for transferring data from or to a server using URLs. It supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, -HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, MQTTS, POP3, POP3S, RTMP, RTMPS, -RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. +HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, MQTTS, POP3, POP3S, RTSP, SCP, +SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. Learn how to use curl by reading [the man page](https://curl.se/docs/manpage.html) or [everything diff --git a/configure.ac b/configure.ac index f924054c67..83e0cfc71f 100644 --- a/configure.ac +++ b/configure.ac @@ -165,7 +165,6 @@ curl_unix_sockets_msg="no (--enable-unix-sockets)" curl_ldaps_msg="no (--enable-ldaps)" curl_ipfs_msg="no (--enable-ipfs)" curl_rtsp_msg="no (--enable-rtsp)" - curl_rtmp_msg="no (--with-librtmp)" curl_psl_msg="no (--with-libpsl)" curl_altsvc_msg="enabled (--disable-alt-svc)" curl_headers_msg="enabled (--disable-headers-api)" @@ -2691,86 +2690,6 @@ if test "$CURL_DISABLE_LDAPS" != "1"; then curl_ldaps_msg="enabled" fi -dnl ********************************************************************** -dnl Check for the presence of LIBRTMP libraries and headers -dnl ********************************************************************** - -dnl Default to compiler & linker defaults for LIBRTMP files & libraries. -OPT_LIBRTMP=off -AC_ARG_WITH(librtmp,dnl -AS_HELP_STRING([--with-librtmp=PATH],[Where to look for librtmp, PATH points to the LIBRTMP installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) -AS_HELP_STRING([--without-librtmp], [disable LIBRTMP]), - OPT_LIBRTMP=$withval) - -if test "x$OPT_LIBRTMP" != "xno"; then - dnl backup the pre-librtmp variables - CLEANLDFLAGS="$LDFLAGS" - CLEANLDFLAGSPC="$LDFLAGSPC" - CLEANCPPFLAGS="$CPPFLAGS" - CLEANLIBS="$LIBS" - - case "$OPT_LIBRTMP" in - yes) - dnl --with-librtmp (without path) used - CURL_CHECK_PKGCONFIG(librtmp) - - if test "$PKGCONFIG" != "no"; then - LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp` - LD_RTMP=`$PKGCONFIG --libs-only-L librtmp` - CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp` - version=`$PKGCONFIG --modversion librtmp` - DIR_RTMP=`echo $LD_RTMP | $SED -e 's/^-L//'` - else - dnl To avoid link errors, we do not allow --librtmp without - dnl a pkgconfig file - AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.]) - fi - ;; - off) - dnl no --with-librtmp option given, just check default places - LIB_RTMP="-lrtmp" - ;; - *) - dnl use the given --with-librtmp spot - LIB_RTMP="-lrtmp" - PREFIX_RTMP=$OPT_LIBRTMP - ;; - esac - - dnl if given with a prefix, we set -L and -I based on that - if test -n "$PREFIX_RTMP"; then - LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff - CPP_RTMP=-I${PREFIX_RTMP}/include - DIR_RTMP=${PREFIX_RTMP}/lib$libsuff - fi - - LDFLAGS="$LDFLAGS $LD_RTMP" - LDFLAGSPC="$LDFLAGSPC $LD_RTMP" - CPPFLAGS="$CPPFLAGS $CPP_RTMP" - LIBS="$LIB_RTMP $LIBS" - - AC_CHECK_LIB(rtmp, RTMP_Init, - [ - AC_CHECK_HEADERS(librtmp/rtmp.h, - curl_rtmp_msg="enabled (librtmp)" - AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use]) - USE_LIBRTMP=1 - LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE librtmp" - ) - ], - dnl not found, revert back to clean variables - LDFLAGS=$CLEANLDFLAGS - LDFLAGSPC=$CLEANLDFLAGSPC - CPPFLAGS=$CLEANCPPFLAGS - LIBS=$CLEANLIBS - ) - - if test "x$OPT_LIBRTMP" != "xoff" && - test "$USE_LIBRTMP" != "1"; then - AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!]) - fi -fi - dnl ********************************************************************** dnl Check for linker switch for versioned symbols dnl ********************************************************************** @@ -5406,9 +5325,6 @@ fi if test "$CURL_DISABLE_RTSP" != "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP" fi -if test "$USE_LIBRTMP" = "1"; then - SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP" -fi if test "$CURL_DISABLE_WEBSOCKETS" != "1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WS" if test "$SSL_ENABLED" = "1"; then @@ -5520,7 +5436,6 @@ AC_MSG_NOTICE([Configured to build curl/libcurl: LDAPS: ${curl_ldaps_msg} IPFS/IPNS: ${curl_ipfs_msg} RTSP: ${curl_rtsp_msg} - RTMP: ${curl_rtmp_msg} PSL: ${curl_psl_msg} Alt-svc: ${curl_altsvc_msg} Headers API: ${curl_headers_msg} diff --git a/docs/DEPRECATE.md b/docs/DEPRECATE.md index a040842baf..2ec587d21e 100644 --- a/docs/DEPRECATE.md +++ b/docs/DEPRECATE.md @@ -16,18 +16,6 @@ how your use case cannot be satisfied properly using a workaround. In March 2026, we drop support for all c-ares versions before 1.16.0. -## RTMP - -RTMP in curl is powered by the 3rd party library librtmp. - -- RTMP is barely used by curl users (2.2% in the 2025 survey) -- librtmp has no test cases, makes no proper releases and has not had a single - commit within the last year -- librtmp parses the URL itself and requires non-compliant URLs for this -- we have no RTMP tests - -Support for RTMP in libcurl gets removed in April 2026. - ## CMake 3.17 and earlier We remove support for CMake <3.18 in April 2026. @@ -65,3 +53,4 @@ TLS-SRP support gets removed in August 2026. - OpenSSL 1.1.1 and older (removed in 8.18.0) - Support for Windows XP (removed in 8.19.0) - OpenSSL-QUIC (removed in 8.19.0) +- RTMP (removed in 8.20.0) diff --git a/docs/FAQ.md b/docs/FAQ.md index d2cf9c8312..b5be1a1d42 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -21,8 +21,8 @@ The curl project produces two products: ### libcurl A client-side URL transfer library, supporting DICT, FILE, FTP, FTPS, GOPHER, -GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, MQTTS, POP3, POP3S, RTMP, -RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. +GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, MQTTS, POP3, POP3S, +RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. libcurl supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, Kerberos, SPNEGO, HTTP form based upload, proxies, cookies, user+password diff --git a/docs/HISTORY.md b/docs/HISTORY.md index 1816697500..c9ddb7dc62 100644 --- a/docs/HISTORY.md +++ b/docs/HISTORY.md @@ -492,3 +492,7 @@ We drop support for krb-ftp, Heimdal, wolfSSH and the winbuild build system. Add support for Apple SecTrust, native CA certs on Apple systems. December 15: the website served 78 TB over the last month. + +## 2026 + +April: removed support for RTMP diff --git a/docs/INSTALL-CMAKE.md b/docs/INSTALL-CMAKE.md index 9c92e4b4ca..08827b411e 100644 --- a/docs/INSTALL-CMAKE.md +++ b/docs/INSTALL-CMAKE.md @@ -380,7 +380,6 @@ Details via CMake - `USE_APPLE_IDN`: Use Apple built-in IDN support. Default: `OFF` - `USE_APPLE_SECTRUST`: Use Apple OS-native certificate verification. Default: `OFF` - `USE_LIBIDN2`: Use libidn2 for IDN support. Default: `ON` -- `USE_LIBRTMP`: Enable librtmp from rtmpdump. Default: `OFF` - `USE_NGHTTP2`: Use nghttp2 library. Default: `ON` - `USE_NGTCP2`: Use ngtcp2 and nghttp3 libraries for HTTP/3 support. Default: `OFF` - `USE_QUICHE`: Use quiche library for HTTP/3 support. Default: `OFF` @@ -431,8 +430,6 @@ Details via CMake - `LIBIDN2_LIBRARY`: Absolute path to `libidn2` library. - `LIBPSL_INCLUDE_DIR`: Absolute path to libpsl include directory. - `LIBPSL_LIBRARY`: Absolute path to `libpsl` library. -- `LIBRTMP_INCLUDE_DIR`: Absolute path to librtmp include directory. -- `LIBRTMP_LIBRARY`: Absolute path to `librtmp` library. - `LIBSSH_INCLUDE_DIR`: Absolute path to libssh include directory. - `LIBSSH_LIBRARY`: Absolute path to `libssh` library. - `LIBSSH_USE_STATIC_LIBS`: Configure for static libssh libraries. (experimental) diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 8563f4af0f..d457c3a358 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -619,7 +619,6 @@ disabling support for some features (run `./configure --help` to see them all): - `--without-ngtcp2` (HTTP/2 using ngtcp2) - `--without-zstd` (Zstd on-the-fly decompression) - `--without-libidn2` (internationalized domain names) -- `--without-librtmp` (RTMP) - `--without-ssl` (SSL/TLS) - `--without-zlib` (gzip/deflate on-the-fly decompression) diff --git a/docs/URL-SYNTAX.md b/docs/URL-SYNTAX.md index 26b8ffaa12..097341f256 100644 --- a/docs/URL-SYNTAX.md +++ b/docs/URL-SYNTAX.md @@ -141,9 +141,8 @@ curl supports the following schemes on URLs specified to transfer. They are matched case insensitively: `dict`, `file`, `ftp`, `ftps`, `gopher`, `gophers`, `http`, `https`, `imap`, -`imaps`, `ldap`, `ldaps`, `mqtt`, `pop3`, `pop3s`, `rtmp`, `rtmpe`, `rtmps`, -`rtmpt`, `rtmpte`, `rtmpts`, `rtsp`, `smb`, `smbs`, `smtp`, `smtps`, `telnet`, -`tftp` +`imaps`, `ldap`, `ldaps`, `mqtt`, `pop3`, `pop3s`, `rtsp`, `smb`, `smbs`, +`smtp`, `smtps`, `telnet`, `tftp` When the URL is specified to identify a proxy, curl recognizes the following schemes: @@ -209,10 +208,9 @@ only if the URL starts with a scheme. If the port number is not specified in the URL, curl uses a default port number based on the provide scheme: -DICT 2628, FTP 21, FTPS 990, GOPHER 70, GOPHERS 70, HTTP 80, HTTPS 443, -IMAP 143, IMAPS 993, LDAP 389, LDAPS 636, MQTT 1883, POP3 110, POP3S 995, -RTMP 1935, RTMPS 443, RTMPT 80, RTSP 554, SCP 22, SFTP 22, SMB 445, SMBS 445, -SMTP 25, SMTPS 465, TELNET 23, TFTP 69 +DICT 2628, FTP 21, FTPS 990, GOPHER 70, GOPHERS 70, HTTP 80, HTTPS 443, IMAP +143, IMAPS 993, LDAP 389, LDAPS 636, MQTT 1883, POP3 110, POP3S 995, RTSP 554, +SCP 22, SFTP 22, SMB 445, SMBS 445, SMTP 25, SMTPS 465, TELNET 23, TFTP 69 # Scheme specific behaviors @@ -381,15 +379,3 @@ machine's fully qualified domain name, which you might have obtained from an external function such as gethostname or getaddrinfo. The default smtp port is 25. Some servers use port 587 as an alternative. - -## RTMP - -There is no official URL spec for RTMP so libcurl uses the URL syntax supported -by the underlying librtmp library. It has a syntax where it wants a -traditional URL, followed by a space and a series of space-separated -`name=value` pairs. - -While space is not typically a "legal" letter, libcurl accepts them. When a -user wants to pass in a `#` (hash) character it is treated as a fragment and -it gets cut off by libcurl if provided literally. You have to escape it by -providing it as backslash and its ASCII value in hexadecimal: `\23`. diff --git a/docs/cmdline-opts/_DESCRIPTION.md b/docs/cmdline-opts/_DESCRIPTION.md index 65ef69eec2..bb21f0ba32 100644 --- a/docs/cmdline-opts/_DESCRIPTION.md +++ b/docs/cmdline-opts/_DESCRIPTION.md @@ -4,8 +4,8 @@ **curl** is a tool for transferring data from or to a server using URLs. It supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, -IMAP, IMAPS, LDAP, LDAPS, MQTT, MQTTS, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, -SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. +IMAP, IMAPS, LDAP, LDAPS, MQTT, MQTTS, POP3, POP3S, RTSP, SCP, SFTP, SMB, +SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. curl is powered by libcurl for all transfer-related features. See *libcurl(3)* for details. diff --git a/docs/cmdline-opts/_PROTOCOLS.md b/docs/cmdline-opts/_PROTOCOLS.md index 76fa79676e..831b944d24 100644 --- a/docs/cmdline-opts/_PROTOCOLS.md +++ b/docs/cmdline-opts/_PROTOCOLS.md @@ -30,9 +30,6 @@ supported (yet). ## POP3(S) Downloading from a pop3 server means getting an email. With or without using TLS. -## RTMP(S) -The **Realtime Messaging Protocol** is primarily used to serve streaming media -and curl can download it. ## RTSP curl supports RTSP 1.0 downloads. ## SCP diff --git a/docs/libcurl/opts/CURLOPT_PROTOCOLS_STR.md b/docs/libcurl/opts/CURLOPT_PROTOCOLS_STR.md index 8de66099e1..7044dc8d81 100644 --- a/docs/libcurl/opts/CURLOPT_PROTOCOLS_STR.md +++ b/docs/libcurl/opts/CURLOPT_PROTOCOLS_STR.md @@ -42,8 +42,8 @@ set, it returns error. These are the available protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, -MQTT, MQTTS, POP3, POP3S, RTMP, RTMPE, RTMPS, RTMPT, RTMPTE, RTMPTS, RTSP, -SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS, WSS +MQTT, MQTTS, POP3, POP3S, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, +TFTP, WS, WSS You can set "ALL" as a short-cut to enable all protocols. Note that by setting all, you may enable protocols that were not supported the day you write this @@ -81,6 +81,10 @@ int main(int argc, char **argv) } ~~~ +# HISTORY + +RTMP and its related protocol schemes are not supported since curl 8.20.0 + # %AVAILABILITY% # RETURN VALUE diff --git a/docs/libcurl/opts/CURLOPT_REDIR_PROTOCOLS_STR.md b/docs/libcurl/opts/CURLOPT_REDIR_PROTOCOLS_STR.md index 2323829408..88d3620306 100644 --- a/docs/libcurl/opts/CURLOPT_REDIR_PROTOCOLS_STR.md +++ b/docs/libcurl/opts/CURLOPT_REDIR_PROTOCOLS_STR.md @@ -46,8 +46,8 @@ By default libcurl allows HTTP, HTTPS, FTP and FTPS on redirects (since These are the available protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, -MQTT, MQTTS, POP3, POP3S, RTMP, RTMPE, RTMPS, RTMPT, RTMPTE, RTMPTS, RTSP, -SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS, WSS +MQTT, MQTTS, POP3, POP3S, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, +TFTP, WS, WSS You can set "ALL" as a short-cut to enable all protocols. Note that by setting all, you may enable protocols that were not supported the day you write this diff --git a/docs/libcurl/symbols-in-versions b/docs/libcurl/symbols-in-versions index d88d45504a..cdfb0169f8 100644 --- a/docs/libcurl/symbols-in-versions +++ b/docs/libcurl/symbols-in-versions @@ -971,12 +971,12 @@ CURLPROTO_MQTT 7.71.0 CURLPROTO_MQTTS 8.19.0 CURLPROTO_POP3 7.20.0 CURLPROTO_POP3S 7.20.0 -CURLPROTO_RTMP 7.21.0 -CURLPROTO_RTMPE 7.21.0 -CURLPROTO_RTMPS 7.21.0 -CURLPROTO_RTMPT 7.21.0 -CURLPROTO_RTMPTE 7.21.0 -CURLPROTO_RTMPTS 7.21.0 +CURLPROTO_RTMP 7.21.0 8.20.0 +CURLPROTO_RTMPE 7.21.0 8.20.0 +CURLPROTO_RTMPS 7.21.0 8.20.0 +CURLPROTO_RTMPT 7.21.0 8.20.0 +CURLPROTO_RTMPTE 7.21.0 8.20.0 +CURLPROTO_RTMPTS 7.21.0 8.20.0 CURLPROTO_RTSP 7.20.0 CURLPROTO_SCP 7.19.4 CURLPROTO_SFTP 7.19.4 diff --git a/lib/Makefile.inc b/lib/Makefile.inc index 84b4e5425b..dc96bf6660 100644 --- a/lib/Makefile.inc +++ b/lib/Makefile.inc @@ -172,7 +172,6 @@ LIB_CFILES = \ curl_memrchr.c \ curl_ntlm_core.c \ curl_range.c \ - curl_rtmp.c \ curl_sasl.c \ curl_sha512_256.c \ curl_share.c \ @@ -304,7 +303,6 @@ LIB_HFILES = \ curl_ntlm_core.h \ curl_printf.h \ curl_range.h \ - curl_rtmp.h \ curl_sasl.h \ curl_setup.h \ curl_sha256.h \ diff --git a/lib/curl_config-cmake.h.in b/lib/curl_config-cmake.h.in index 1dcab9d897..ad73c496de 100644 --- a/lib/curl_config-cmake.h.in +++ b/lib/curl_config-cmake.h.in @@ -706,9 +706,6 @@ ${SIZEOF_TIME_T_CODE} /* if AmiSSL is in use */ #cmakedefine USE_AMISSL 1 -/* if librtmp/rtmpdump is in use */ -#cmakedefine USE_LIBRTMP 1 - /* if GSASL is in use */ #cmakedefine USE_GSASL 1 diff --git a/lib/curl_rtmp.c b/lib/curl_rtmp.c deleted file mode 100644 index 75b80913d8..0000000000 --- a/lib/curl_rtmp.c +++ /dev/null @@ -1,326 +0,0 @@ -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) Daniel Stenberg, , et al. - * Copyright (C) Howard Chu, - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at https://curl.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * SPDX-License-Identifier: curl - * - ***************************************************************************/ -#include "curl_setup.h" - -#include "curl_rtmp.h" -#include "urldata.h" - -#ifdef USE_LIBRTMP - -#include "url.h" -#include "curlx/nonblock.h" -#include "progress.h" /* for Curl_pgrsSetUploadSize */ -#include "transfer.h" -#include "bufref.h" - -#include - -#if defined(USE_WINSOCK) || defined(LWIP_SO_SNDRCVTIMEO_NONSTANDARD) -#define SET_RCVTIMEO(tv, s) int tv = s * 1000 -#else -#define SET_RCVTIMEO(tv, s) struct timeval tv = { s, 0 } -#endif - -#define DEF_BUFTIME (2 * 60 * 60 * 1000) /* 2 hours */ - -/* meta key for storing RTMP* at connection */ -#define CURL_META_RTMP_CONN "meta:proto:rtmp:conn" - -static Curl_recv rtmp_recv; -static Curl_send rtmp_send; - -static void rtmp_conn_dtor(void *key, size_t klen, void *entry) -{ - RTMP *r = entry; - (void)key; - (void)klen; - RTMP_Close(r); - RTMP_Free(r); -} - -static CURLcode rtmp_setup_connection(struct Curl_easy *data, - struct connectdata *conn) -{ - RTMP *r = RTMP_Alloc(); - if(!r || - Curl_conn_meta_set(conn, CURL_META_RTMP_CONN, r, rtmp_conn_dtor)) - return CURLE_OUT_OF_MEMORY; - - RTMP_Init(r); - RTMP_SetBufferMS(r, DEF_BUFTIME); - if(!RTMP_SetupURL(r, CURL_UNCONST(Curl_bufref_ptr(&data->state.url)))) - /* rtmp_conn_dtor() performs the cleanup */ - return CURLE_URL_MALFORMAT; - return CURLE_OK; -} - -static CURLcode rtmp_connect(struct Curl_easy *data, bool *done) -{ - struct connectdata *conn = data->conn; - RTMP *r = Curl_conn_meta_get(conn, CURL_META_RTMP_CONN); - SET_RCVTIMEO(tv, 10); - - if(!r) - return CURLE_FAILED_INIT; - - if(conn->sock[FIRSTSOCKET] > INT_MAX) { - /* The socket value is invalid for rtmp. */ - return CURLE_FAILED_INIT; - } - - r->m_sb.sb_socket = (int)conn->sock[FIRSTSOCKET]; - - /* We have to know if it is a write before we send the - * connect request packet - */ - if(data->state.upload) - r->Link.protocol |= RTMP_FEATURE_WRITE; - - /* For plain streams, use the buffer toggle trick to keep data flowing */ - if(!(r->Link.lFlags & RTMP_LF_LIVE) && - !(r->Link.protocol & RTMP_FEATURE_HTTP)) - r->Link.lFlags |= RTMP_LF_BUFX; - - (void)curlx_nonblock(r->m_sb.sb_socket, FALSE); - setsockopt(r->m_sb.sb_socket, SOL_SOCKET, SO_RCVTIMEO, - (char *)&tv, sizeof(tv)); - - if(!RTMP_Connect1(r, NULL)) - return CURLE_FAILED_INIT; - - /* Clients must send a periodic BytesReceived report to the server */ - r->m_bSendCounter = TRUE; - - *done = TRUE; - conn->recv[FIRSTSOCKET] = rtmp_recv; - conn->send[FIRSTSOCKET] = rtmp_send; - return CURLE_OK; -} - -static CURLcode rtmp_do(struct Curl_easy *data, bool *done) -{ - struct connectdata *conn = data->conn; - RTMP *r = Curl_conn_meta_get(conn, CURL_META_RTMP_CONN); - - if(!r || !RTMP_ConnectStream(r, 0)) - return CURLE_FAILED_INIT; - - if(data->state.upload) { - Curl_pgrsSetUploadSize(data, data->state.infilesize); - Curl_xfer_setup_send(data, FIRSTSOCKET); - } - else - Curl_xfer_setup_recv(data, FIRSTSOCKET, -1); - *done = TRUE; - return CURLE_OK; -} - -static CURLcode rtmp_done(struct Curl_easy *data, CURLcode status, - bool premature) -{ - (void)data; - (void)status; - (void)premature; - - return CURLE_OK; -} - -static CURLcode rtmp_disconnect(struct Curl_easy *data, - struct connectdata *conn, - bool dead_connection) -{ - RTMP *r = Curl_conn_meta_get(conn, CURL_META_RTMP_CONN); - (void)data; - (void)dead_connection; - if(r) - Curl_conn_meta_remove(conn, CURL_META_RTMP_CONN); - return CURLE_OK; -} - -static CURLcode rtmp_recv(struct Curl_easy *data, int sockindex, char *buf, - size_t len, size_t *pnread) -{ - struct connectdata *conn = data->conn; - RTMP *r = Curl_conn_meta_get(conn, CURL_META_RTMP_CONN); - CURLcode result = CURLE_OK; - ssize_t rv; - - (void)sockindex; - *pnread = 0; - if(!r) - return CURLE_FAILED_INIT; - - rv = RTMP_Read(r, buf, curlx_uztosi(len)); - if(!curlx_sztouz(rv, pnread)) { - if(r->m_read.status == RTMP_READ_COMPLETE || - r->m_read.status == RTMP_READ_EOF) { - data->req.size = data->req.bytecount; - } - else - result = CURLE_RECV_ERROR; - } - - return result; -} - -static CURLcode rtmp_send(struct Curl_easy *data, int sockindex, - const uint8_t *buf, size_t len, bool eos, - size_t *pnwritten) -{ - struct connectdata *conn = data->conn; - RTMP *r = Curl_conn_meta_get(conn, CURL_META_RTMP_CONN); - ssize_t rv; - - (void)sockindex; - (void)eos; - *pnwritten = 0; - if(!r) - return CURLE_FAILED_INIT; - - rv = RTMP_Write(r, (const char *)buf, curlx_uztosi(len)); - if(!curlx_sztouz(rv, pnwritten)) - return CURLE_SEND_ERROR; - - return CURLE_OK; -} - -void Curl_rtmp_version(char *version, size_t len) -{ - char suff[2]; - if(RTMP_LIB_VERSION & 0xff) { - suff[0] = (RTMP_LIB_VERSION & 0xff) + 'a' - 1; - suff[1] = '\0'; - } - else - suff[0] = '\0'; - - curl_msnprintf(version, len, "librtmp/%d.%d%s", - RTMP_LIB_VERSION >> 16, (RTMP_LIB_VERSION >> 8) & 0xff, - suff); -} - -/* - * RTMP protocol handler.h, based on https://rtmpdump.mplayerhq.hu/ - */ - -static const struct Curl_protocol Curl_protocol_rtmp = { - rtmp_setup_connection, /* setup_connection */ - rtmp_do, /* do_it */ - rtmp_done, /* done */ - ZERO_NULL, /* do_more */ - rtmp_connect, /* connect_it */ - ZERO_NULL, /* connecting */ - ZERO_NULL, /* doing */ - ZERO_NULL, /* proto_pollset */ - ZERO_NULL, /* doing_pollset */ - ZERO_NULL, /* domore_pollset */ - ZERO_NULL, /* perform_pollset */ - rtmp_disconnect, /* disconnect */ - ZERO_NULL, /* write_resp */ - ZERO_NULL, /* write_resp_hd */ - ZERO_NULL, /* connection_check */ - ZERO_NULL, /* attach connection */ - ZERO_NULL, /* follow */ -}; - -#endif /* USE_LIBRTMP */ - -const struct Curl_scheme Curl_scheme_rtmp = { - "rtmp", /* scheme */ -#ifndef USE_LIBRTMP - ZERO_NULL, -#else - &Curl_protocol_rtmp, -#endif - CURLPROTO_RTMP, /* protocol */ - CURLPROTO_RTMP, /* family */ - PROTOPT_NONE, /* flags */ - PORT_RTMP, /* defport */ -}; - -const struct Curl_scheme Curl_scheme_rtmpt = { - "rtmpt", /* scheme */ -#ifndef USE_LIBRTMP - ZERO_NULL, -#else - &Curl_protocol_rtmp, -#endif - CURLPROTO_RTMPT, /* protocol */ - CURLPROTO_RTMPT, /* family */ - PROTOPT_NONE, /* flags */ - PORT_RTMPT, /* defport */ -}; - -const struct Curl_scheme Curl_scheme_rtmpe = { - "rtmpe", /* scheme */ -#ifndef USE_LIBRTMP - ZERO_NULL, -#else - &Curl_protocol_rtmp, -#endif - CURLPROTO_RTMPE, /* protocol */ - CURLPROTO_RTMPE, /* family */ - PROTOPT_NONE, /* flags */ - PORT_RTMP, /* defport */ -}; - -const struct Curl_scheme Curl_scheme_rtmpte = { - "rtmpte", /* scheme */ -#ifndef USE_LIBRTMP - ZERO_NULL, -#else - &Curl_protocol_rtmp, -#endif - CURLPROTO_RTMPTE, /* protocol */ - CURLPROTO_RTMPTE, /* family */ - PROTOPT_NONE, /* flags */ - PORT_RTMPT, /* defport */ -}; - -const struct Curl_scheme Curl_scheme_rtmps = { - "rtmps", /* scheme */ -#ifndef USE_LIBRTMP - ZERO_NULL, -#else - &Curl_protocol_rtmp, -#endif - CURLPROTO_RTMPS, /* protocol */ - CURLPROTO_RTMP, /* family */ - PROTOPT_NONE, /* flags */ - PORT_RTMPS, /* defport */ -}; - -const struct Curl_scheme Curl_scheme_rtmpts = { - "rtmpts", /* scheme */ -#ifndef USE_LIBRTMP - ZERO_NULL, -#else - &Curl_protocol_rtmp, -#endif - CURLPROTO_RTMPTS, /* protocol */ - CURLPROTO_RTMPT, /* family */ - PROTOPT_NONE, /* flags */ - PORT_RTMPS, /* defport */ -}; diff --git a/lib/curl_rtmp.h b/lib/curl_rtmp.h deleted file mode 100644 index e57d20c33a..0000000000 --- a/lib/curl_rtmp.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef HEADER_CURL_RTMP_H -#define HEADER_CURL_RTMP_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) Howard Chu, - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at https://curl.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * SPDX-License-Identifier: curl - * - ***************************************************************************/ -extern const struct Curl_scheme Curl_scheme_rtmp; -extern const struct Curl_scheme Curl_scheme_rtmpt; -extern const struct Curl_scheme Curl_scheme_rtmpe; -extern const struct Curl_scheme Curl_scheme_rtmpte; -extern const struct Curl_scheme Curl_scheme_rtmps; -extern const struct Curl_scheme Curl_scheme_rtmpts; -#ifdef USE_LIBRTMP -void Curl_rtmp_version(char *version, size_t len); -#endif - -#endif /* HEADER_CURL_RTMP_H */ diff --git a/lib/url.c b/lib/url.c index 495de2297c..9ee5b08bf5 100644 --- a/lib/url.c +++ b/lib/url.c @@ -112,7 +112,6 @@ #include "imap.h" #include "url.h" #include "connect.h" -#include "curl_rtmp.h" #include "gopher.h" #include "mqtt.h" #include "rtsp.h" @@ -1485,55 +1484,49 @@ const struct Curl_scheme *Curl_getn_scheme(const char *scheme, size_t len) 6. make sure this function uses the same hash function that worked for schemetable.c */ - static const struct Curl_scheme * const all_schemes[67] = { - &Curl_scheme_file, - &Curl_scheme_mqtts, NULL, - &Curl_scheme_gophers, NULL, - &Curl_scheme_rtmpe, - &Curl_scheme_smtp, - &Curl_scheme_sftp, - &Curl_scheme_smb, - &Curl_scheme_smtps, - &Curl_scheme_telnet, - &Curl_scheme_gopher, - &Curl_scheme_tftp, NULL, NULL, NULL, - &Curl_scheme_ftps, - &Curl_scheme_http, - &Curl_scheme_imap, - &Curl_scheme_rtmps, - &Curl_scheme_rtmpt, NULL, NULL, NULL, - &Curl_scheme_ldaps, - &Curl_scheme_wss, - &Curl_scheme_https, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - &Curl_scheme_rtsp, - &Curl_scheme_smbs, - &Curl_scheme_scp, NULL, NULL, NULL, - &Curl_scheme_pop3, NULL, NULL, - &Curl_scheme_rtmp, NULL, NULL, NULL, - &Curl_scheme_rtmpte, NULL, NULL, NULL, - &Curl_scheme_dict, NULL, NULL, NULL, + static const struct Curl_scheme * const all_schemes[47] = { &Curl_scheme_mqtt, + &Curl_scheme_smtp, + &Curl_scheme_tftp, + &Curl_scheme_imap, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + &Curl_scheme_ldaps, + &Curl_scheme_dict, NULL, + &Curl_scheme_file, NULL, &Curl_scheme_pop3s, - &Curl_scheme_imaps, NULL, - &Curl_scheme_ws, NULL, - &Curl_scheme_rtmpts, - &Curl_scheme_ldap, NULL, NULL, &Curl_scheme_ftp, + &Curl_scheme_scp, + &Curl_scheme_mqtts, + &Curl_scheme_imaps, + &Curl_scheme_ldap, + &Curl_scheme_http, + &Curl_scheme_smb, NULL, NULL, + &Curl_scheme_telnet, + &Curl_scheme_https, + &Curl_scheme_gopher, + &Curl_scheme_rtsp, NULL, NULL, + &Curl_scheme_wss, NULL, + &Curl_scheme_gophers, + &Curl_scheme_smtps, + &Curl_scheme_pop3, + &Curl_scheme_ws, NULL, NULL, + &Curl_scheme_sftp, + &Curl_scheme_ftps, NULL, + &Curl_scheme_smbs, NULL, }; if(len && (len <= 7)) { const char *s = scheme; size_t l = len; const struct Curl_scheme *h; - unsigned int c = 978; + unsigned int c = 792; while(l) { - c <<= 5; + c <<= 4; c += (unsigned int)Curl_raw_tolower(*s); s++; l--; } - h = all_schemes[c % 67]; + h = all_schemes[c % 47]; if(h && curl_strnequal(scheme, h->name, len) && !h->name[len]) return h; } diff --git a/lib/urldata.h b/lib/urldata.h index b437771517..e8168a194b 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -45,9 +45,6 @@ #define PORT_SMTP 25 #define PORT_SMTPS 465 /* sometimes called SSMTP */ #define PORT_RTSP 554 -#define PORT_RTMP 1935 -#define PORT_RTMPT PORT_HTTP -#define PORT_RTMPS PORT_HTTPS #define PORT_GOPHER 70 #define PORT_MQTT 1883 #define PORT_MQTTS 8883 diff --git a/lib/version.c b/lib/version.c index 7ccd875dc8..97bccee9c4 100644 --- a/lib/version.c +++ b/lib/version.c @@ -46,11 +46,6 @@ #include #endif -#ifdef USE_LIBRTMP -#include -#include "curl_rtmp.h" -#endif - #ifdef HAVE_LIBZ #include #endif @@ -178,9 +173,6 @@ char *curl_version(void) #if !defined(CURL_DISABLE_HTTP) && defined(USE_HTTP3) char h3_version[30]; #endif -#ifdef USE_LIBRTMP - char rtmp_version[30]; -#endif #ifdef USE_GSASL char gsasl_buf[30]; #endif @@ -244,10 +236,6 @@ char *curl_version(void) Curl_quic_ver(h3_version, sizeof(h3_version)); src[i++] = h3_version; #endif -#ifdef USE_LIBRTMP - Curl_rtmp_version(rtmp_version, sizeof(rtmp_version)); - src[i++] = rtmp_version; -#endif #ifdef USE_GSASL curl_msnprintf(gsasl_buf, sizeof(gsasl_buf), "libgsasl/%s", gsasl_check_version(NULL)); @@ -350,14 +338,6 @@ static const char * const supported_protocols[] = { #if defined(USE_SSL) && !defined(CURL_DISABLE_POP3) "pop3s", #endif -#ifdef USE_LIBRTMP - "rtmp", - "rtmpe", - "rtmps", - "rtmpt", - "rtmpte", - "rtmpts", -#endif #ifndef CURL_DISABLE_RTSP "rtsp", #endif @@ -694,13 +674,5 @@ curl_version_info_data *curl_version_info(CURLversion stamp) feature_names[n] = NULL; /* Terminate array. */ version_info.features = features; -#ifdef USE_LIBRTMP - { - static char rtmp_version[30]; - Curl_rtmp_version(rtmp_version, sizeof(rtmp_version)); - version_info.rtmp_version = rtmp_version; - } -#endif - return &version_info; } diff --git a/projects/vms/generate_config_vms_h_curl.com b/projects/vms/generate_config_vms_h_curl.com index 245d072d20..8757a2982e 100644 --- a/projects/vms/generate_config_vms_h_curl.com +++ b/projects/vms/generate_config_vms_h_curl.com @@ -315,9 +315,6 @@ $write cvh "#endif" $write cvh "#ifdef USE_GNUTLS" $write cvh "#undef USE_GNUTLS" $write cvh "#endif" -$write cvh "#ifdef USE_LIBRTMP" -$write cvh "#undef USE_LIBRTMP" -$write cvh "#endif" $write cvh "#ifdef USE_MANUAL" $write cvh "#undef USE_MANUAL" $write cvh "#endif" diff --git a/scripts/cd2nroff b/scripts/cd2nroff index adc66216d7..598422e268 100755 --- a/scripts/cd2nroff +++ b/scripts/cd2nroff @@ -166,8 +166,6 @@ my %knownprotos = ( 'MQTT' => 1, 'POP3' => 1, 'POP3S' => 1, - 'RTMP' => 1, - 'RTMPS' => 1, 'RTSP' => 1, 'SCP' => 1, 'SFTP' => 1, diff --git a/scripts/ciconfig.pl b/scripts/ciconfig.pl index a02dfb768f..380fdfde7d 100755 --- a/scripts/ciconfig.pl +++ b/scripts/ciconfig.pl @@ -100,7 +100,6 @@ my %defaulton = ( 'ca-path' => 1, 'libssh2' => 1, 'nghttp2' => 1, - 'librtmp' => 1, 'libidn2' => 1, 'sysroot' => 1, 'lber-lib' => 1, diff --git a/scripts/schemetable.c b/scripts/schemetable.c index 49660c94d3..afa54c39af 100644 --- a/scripts/schemetable.c +++ b/scripts/schemetable.c @@ -46,12 +46,6 @@ static const char *scheme[] = { "mqtts", "pop3", "pop3s", - "rtmp", - "rtmpt", - "rtmpe", - "rtmpte", - "rtmps", - "rtmpts", "rtsp", "scp", "sftp", diff --git a/src/tool_help.c b/src/tool_help.c index 50cca52705..e2fa82636a 100644 --- a/src/tool_help.c +++ b/src/tool_help.c @@ -341,10 +341,7 @@ void tool_version_info(void) #endif /* !CURL_DISABLE_IPFS */ curl_mprintf("Protocols:"); for(builtin = built_in_protos; *builtin; ++builtin) { - /* Special case: do not list rtmp?* protocols. - They may only appear together with "rtmp" */ - if(!curl_strnequal(*builtin, "rtmp", 4) || !builtin[0][4]) - curl_mprintf(" %s", *builtin); + curl_mprintf(" %s", *builtin); #ifndef CURL_DISABLE_IPFS if(insert && insert == *builtin) { curl_mprintf(" ipfs ipns");