Updated compilation with Makefile and Jamfile

This commit is contained in:
Paul-Louis Ageneau
2019-12-21 11:44:50 +01:00
parent 03399e4b55
commit 1566c0ef21
5 changed files with 18 additions and 6 deletions

View File

@ -13,10 +13,19 @@ lib libdatachannel
<link>static
: # usage requirements
<include>./include
<library>/libdatachannel//plog
<cxxflags>-pthread
<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
: # no sources
: # no build requirements

View File

@ -9,6 +9,7 @@ CXXFLAGS=-std=c++17
LDFLAGS=-pthread
LIBS=glib-2.0 gobject-2.0 nice
USRSCTP_DIR=deps/usrsctp
PLOG_DIR=deps/plog
USE_GNUTLS ?= 0
ifneq ($(USE_GNUTLS), 0)
@ -20,7 +21,7 @@ else
endif
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)
OBJS=$(subst .cpp,.o,$(SRCS))
@ -31,7 +32,7 @@ src/%.o: src/%.cpp
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(INCLUDES) -MMD -MP -o $@ -c $<
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))

View File

@ -27,8 +27,8 @@
#include <string>
#include <vector>
#include <plog/Appenders/ColorConsoleAppender.h>
#include <plog/Log.h>
#include "plog/Appenders/ColorConsoleAppender.h"
#include "plog/Log.h"
namespace rtc {

View File

@ -508,8 +508,9 @@ void DtlsTransport::InfoCallback(const SSL *ssl, int where, int ret) {
static_cast<DtlsTransport *>(SSL_get_ex_data(ssl, DtlsTransport::TransportExIndex));
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);
}
t->mIncomingQueue.stop(); // Close the connection
}
}

View File

@ -202,8 +202,9 @@ void SctpTransport::connect() {
void SctpTransport::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_INFO << "SCTP disconnected";
changeState(State::Disconnected);