Browse Source

Merge pull request #7512 from neheb/crt

crtmpserver: Fix compilation without deprecated OpenSSL APIs
lilik-openwrt-22.03
Thomas Heil 6 years ago
committed by GitHub
parent
commit
e49b131053
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 59 additions and 30 deletions
  1. +10
    -11
      multimedia/crtmpserver/Makefile
  2. +3
    -19
      multimedia/crtmpserver/patches/060-add-missing-includes.patch
  3. +0
    -0
      multimedia/crtmpserver/patches/090-openssl-1.1-compat.patch
  4. +46
    -0
      multimedia/crtmpserver/patches/100-openssl-deprecated.patch

+ 10
- 11
multimedia/crtmpserver/Makefile View File

@ -10,27 +10,26 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=crtmpserver
PKG_REV:=b6fdcdb953d1e99c48a0c37a8c80f2cad2db443b
PKG_VERSION:=2012-07-18+git-$(PKG_REV)
PKG_RELEASE:=3
PKG_BUILD_PARALLEL:=2
PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/j0sh/crtmpserver/tar.gz/$(PKG_REV)?
PKG_HASH:=e210eeb99d39334e7beb0a1be27dcf23d1f851383f87cf63d7fb98209ef96cee
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_REV)
PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
PKG_LICENSE:=GPL-3.0
PKG_BUILD_PARALLEL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_MIRROR_HASH:=8d887996b6b8cb465ec59f3f713fca46161cbb804cacd2b5405f836083fb58ba
PKG_SOURCE_URL:=https://github.com/j0sh/crtmpserver.git
PKG_SOURCE_SUBDIR:=crtmpserver-$(PKG_VERSION)
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE_PROTO:=git
include $(INCLUDE_DIR)/uclibc++.mk
include $(INCLUDE_DIR)/package.mk
define Package/crtmpserver
SECTION:=multimedia
CATEGORY:=Multimedia
DEPENDS:=+libopenssl +libstdcpp +liblua
DEPENDS:=$(CXX_DEPENDS) +libopenssl +liblua
TITLE:=C++ RTMP Server
URL:=http://www.rtmpd.com/
endef
define Package/crtmpserver/description


+ 3
- 19
multimedia/crtmpserver/patches/060-add-missing-includes.patch View File

@ -1,26 +1,10 @@
--- a/sources/common/include/common.h
+++ b/sources/common/include/common.h
@@ -20,6 +20,10 @@
#ifndef _COMMON_H
#define _COMMON_H
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/types.h>
+
#include "defines.h"
#include "platform/platform.h"
#include "utils/utils.h"
--- a/sources/common/src/utils/logging/fileloglocation.cpp
+++ b/sources/common/src/utils/logging/fileloglocation.cpp
@@ -18,6 +18,10 @@
@@ -17,6 +17,7 @@
* along with crtmpserver. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <ctime>
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/types.h>
+
#include "utils/logging/fileloglocation.h"
#include "utils/lua/luautils.h"
#include "utils/misc/file.h"

multimedia/crtmpserver/patches/090-openssl-1.1-compat.diff → multimedia/crtmpserver/patches/090-openssl-1.1-compat.patch View File


+ 46
- 0
multimedia/crtmpserver/patches/100-openssl-deprecated.patch View File

@ -0,0 +1,46 @@
--- a/sources/common/src/utils/misc/crypto.cpp
+++ b/sources/common/src/utils/misc/crypto.cpp
@@ -350,6 +350,7 @@ string unhex(string source) {
return result;
}
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
void CleanupSSL() {
ERR_remove_state(0);
ENGINE_cleanup();
@@ -358,3 +359,4 @@ void CleanupSSL() {
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
}
+#endif
--- a/sources/crtmpserver/src/crtmpserver.cpp
+++ b/sources/crtmpserver/src/crtmpserver.cpp
@@ -298,8 +298,10 @@ void Cleanup() {
delete gRs.pConfigFile;
gRs.pConfigFile = NULL;
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
WARN("Doing final OpenSSL cleanup");
CleanupSSL();
+#endif
WARN("Shutting down the logger leaving you in the dark. Bye bye... :(");
Logger::Free(true);
--- a/sources/thelib/src/protocols/ssl/basesslprotocol.cpp
+++ b/sources/thelib/src/protocols/ssl/basesslprotocol.cpp
@@ -43,6 +43,7 @@ BaseSSLProtocol::~BaseSSLProtocol() {
bool BaseSSLProtocol::Initialize(Variant &parameters) {
//1. Initialize the SSL library
if (!_libraryInitialized) {
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
//3. This is the first time we use the library. So we have to
//initialize it first
SSL_library_init();
@@ -55,6 +56,7 @@ bool BaseSSLProtocol::Initialize(Variant &parameters) {
OpenSSL_add_all_algorithms();
OpenSSL_add_all_ciphers();
OpenSSL_add_all_digests();
+#endif
//initialize the random numbers generator
InitRandGenerator();

Loading…
Cancel
Save