mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-23 15:48:03 +00:00
Updated compilation with Makefile and Jamfile
This commit is contained in:
9
Jamfile
9
Jamfile
@ -13,10 +13,19 @@ lib libdatachannel
|
|||||||
<link>static
|
<link>static
|
||||||
: # usage requirements
|
: # usage requirements
|
||||||
<include>./include
|
<include>./include
|
||||||
|
<library>/libdatachannel//plog
|
||||||
<cxxflags>-pthread
|
<cxxflags>-pthread
|
||||||
<linkflags>"`pkg-config --libs openssl glib-2.0 gobject-2.0 nice`"
|
<linkflags>"`pkg-config --libs openssl glib-2.0 gobject-2.0 nice`"
|
||||||
;
|
;
|
||||||
|
|
||||||
|
alias plog
|
||||||
|
: # no sources
|
||||||
|
: # no build requirements
|
||||||
|
: # no default build
|
||||||
|
: # usage requirements
|
||||||
|
<include>./deps/plog/include
|
||||||
|
;
|
||||||
|
|
||||||
alias usrsctp
|
alias usrsctp
|
||||||
: # no sources
|
: # no sources
|
||||||
: # no build requirements
|
: # no build requirements
|
||||||
|
5
Makefile
5
Makefile
@ -9,6 +9,7 @@ CXXFLAGS=-std=c++17
|
|||||||
LDFLAGS=-pthread
|
LDFLAGS=-pthread
|
||||||
LIBS=glib-2.0 gobject-2.0 nice
|
LIBS=glib-2.0 gobject-2.0 nice
|
||||||
USRSCTP_DIR=deps/usrsctp
|
USRSCTP_DIR=deps/usrsctp
|
||||||
|
PLOG_DIR=deps/plog
|
||||||
|
|
||||||
USE_GNUTLS ?= 0
|
USE_GNUTLS ?= 0
|
||||||
ifneq ($(USE_GNUTLS), 0)
|
ifneq ($(USE_GNUTLS), 0)
|
||||||
@ -20,7 +21,7 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
LDLIBS= $(shell pkg-config --libs $(LIBS))
|
LDLIBS= $(shell pkg-config --libs $(LIBS))
|
||||||
INCLUDES=-Iinclude/rtc -I$(USRSCTP_DIR)/usrsctplib $(shell pkg-config --cflags $(LIBS))
|
INCLUDES=-Iinclude/rtc -I$(PLOG_DIR)/include -I$(USRSCTP_DIR)/usrsctplib $(shell pkg-config --cflags $(LIBS))
|
||||||
|
|
||||||
SRCS=$(shell printf "%s " src/*.cpp)
|
SRCS=$(shell printf "%s " src/*.cpp)
|
||||||
OBJS=$(subst .cpp,.o,$(SRCS))
|
OBJS=$(subst .cpp,.o,$(SRCS))
|
||||||
@ -31,7 +32,7 @@ src/%.o: src/%.cpp
|
|||||||
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(INCLUDES) -MMD -MP -o $@ -c $<
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(INCLUDES) -MMD -MP -o $@ -c $<
|
||||||
|
|
||||||
test/%.o: test/%.cpp
|
test/%.o: test/%.cpp
|
||||||
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -Iinclude -MMD -MP -o $@ -c $<
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -Iinclude -I$(PLOG_DIR)/include -MMD -MP -o $@ -c $<
|
||||||
|
|
||||||
-include $(subst .cpp,.d,$(SRCS))
|
-include $(subst .cpp,.d,$(SRCS))
|
||||||
|
|
||||||
|
@ -27,8 +27,8 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <plog/Appenders/ColorConsoleAppender.h>
|
#include "plog/Appenders/ColorConsoleAppender.h"
|
||||||
#include <plog/Log.h>
|
#include "plog/Log.h"
|
||||||
|
|
||||||
namespace rtc {
|
namespace rtc {
|
||||||
|
|
||||||
|
@ -508,8 +508,9 @@ void DtlsTransport::InfoCallback(const SSL *ssl, int where, int ret) {
|
|||||||
static_cast<DtlsTransport *>(SSL_get_ex_data(ssl, DtlsTransport::TransportExIndex));
|
static_cast<DtlsTransport *>(SSL_get_ex_data(ssl, DtlsTransport::TransportExIndex));
|
||||||
|
|
||||||
if (where & SSL_CB_ALERT) {
|
if (where & SSL_CB_ALERT) {
|
||||||
if (ret != 256) // Close Notify
|
if (ret != 256) { // Close Notify
|
||||||
PLOG_ERROR << "DTLS alert: " << SSL_alert_desc_string_long(ret);
|
PLOG_ERROR << "DTLS alert: " << SSL_alert_desc_string_long(ret);
|
||||||
|
}
|
||||||
t->mIncomingQueue.stop(); // Close the connection
|
t->mIncomingQueue.stop(); // Close the connection
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -202,8 +202,9 @@ void SctpTransport::connect() {
|
|||||||
void SctpTransport::shutdown() {
|
void SctpTransport::shutdown() {
|
||||||
PLOG_DEBUG << "SCTP shutdown";
|
PLOG_DEBUG << "SCTP shutdown";
|
||||||
|
|
||||||
if (usrsctp_shutdown(mSock, SHUT_RDWR))
|
if (usrsctp_shutdown(mSock, SHUT_RDWR)) {
|
||||||
PLOG_WARNING << "SCTP shutdown failed, errno=" << errno;
|
PLOG_WARNING << "SCTP shutdown failed, errno=" << errno;
|
||||||
|
}
|
||||||
|
|
||||||
PLOG_INFO << "SCTP disconnected";
|
PLOG_INFO << "SCTP disconnected";
|
||||||
changeState(State::Disconnected);
|
changeState(State::Disconnected);
|
||||||
|
Reference in New Issue
Block a user