mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-22 23:25:33 +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
|
||||
: # 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
|
||||
|
5
Makefile
5
Makefile
@ -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))
|
||||
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user