Merge pull request #7512 from neheb/crt
crtmpserver: Fix compilation without deprecated OpenSSL APIs
This commit is contained in:
commit
e49b131053
4 changed files with 59 additions and 30 deletions
|
@ -10,27 +10,26 @@ include $(TOPDIR)/rules.mk
|
||||||
PKG_NAME:=crtmpserver
|
PKG_NAME:=crtmpserver
|
||||||
PKG_REV:=b6fdcdb953d1e99c48a0c37a8c80f2cad2db443b
|
PKG_REV:=b6fdcdb953d1e99c48a0c37a8c80f2cad2db443b
|
||||||
PKG_VERSION:=2012-07-18+git-$(PKG_REV)
|
PKG_VERSION:=2012-07-18+git-$(PKG_REV)
|
||||||
PKG_RELEASE:=3
|
PKG_RELEASE:=4
|
||||||
PKG_BUILD_PARALLEL:=2
|
|
||||||
|
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_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
|
||||||
PKG_LICENSE:=GPL-3.0
|
PKG_LICENSE:=GPL-3.0
|
||||||
|
|
||||||
|
PKG_BUILD_PARALLEL:=1
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
include $(INCLUDE_DIR)/uclibc++.mk
|
||||||
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)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
define Package/crtmpserver
|
define Package/crtmpserver
|
||||||
SECTION:=multimedia
|
SECTION:=multimedia
|
||||||
CATEGORY:=Multimedia
|
CATEGORY:=Multimedia
|
||||||
DEPENDS:=+libopenssl +libstdcpp +liblua
|
DEPENDS:=$(CXX_DEPENDS) +libopenssl +liblua
|
||||||
TITLE:=C++ RTMP Server
|
TITLE:=C++ RTMP Server
|
||||||
URL:=http://www.rtmpd.com/
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/crtmpserver/description
|
define Package/crtmpserver/description
|
||||||
|
|
|
@ -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
|
--- a/sources/common/src/utils/logging/fileloglocation.cpp
|
||||||
+++ b/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/logging/fileloglocation.h"
|
||||||
#include "utils/lua/luautils.h"
|
#include "utils/lua/luautils.h"
|
||||||
#include "utils/misc/file.h"
|
|
||||||
|
|
46
multimedia/crtmpserver/patches/100-openssl-deprecated.patch
Normal file
46
multimedia/crtmpserver/patches/100-openssl-deprecated.patch
Normal 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 ¶meters) {
|
||||||
|
//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 ¶meters) {
|
||||||
|
OpenSSL_add_all_algorithms();
|
||||||
|
OpenSSL_add_all_ciphers();
|
||||||
|
OpenSSL_add_all_digests();
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
//initialize the random numbers generator
|
||||||
|
InitRandGenerator();
|
Loading…
Reference in a new issue