diff --git a/CMakeLists.txt b/CMakeLists.txt index be3386b51..c83329e76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -310,13 +310,7 @@ else() add_library(Usrsctp::Usrsctp ALIAS usrsctp) if(INSTALL_DEPS_LIBS) - # usrsctp lacks an export set - install(TARGETS usrsctp EXPORT UsrsctpTargets) - install(EXPORT UsrsctpTargets - FILE UsrsctpTargets.cmake - NAMESPACE Usrsctp:: - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/usrsctp - EXCLUDE_FROM_ALL) + install(TARGETS usrsctp EXPORT LibDataChannelTargets) # Fix directories set_target_properties(usrsctp PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "") target_include_directories(usrsctp INTERFACE @@ -383,7 +377,7 @@ else() if(NOT TARGET srtp2) add_subdirectory(deps/libsrtp EXCLUDE_FROM_ALL) if(INSTALL_DEPS_LIBS) - install(TARGETS srtp2) + install(TARGETS srtp2 EXPORT LibDataChannelTargets) endif() endif() target_compile_definitions(datachannel PRIVATE RTC_SYSTEM_SRTP=0) @@ -463,7 +457,7 @@ else() else() add_subdirectory(deps/libjuice EXCLUDE_FROM_ALL) if(INSTALL_DEPS_LIBS) - install(TARGETS juice) + install(TARGETS juice EXPORT LibDataChannelTargets) endif() target_compile_definitions(datachannel PRIVATE RTC_SYSTEM_JUICE=0) target_compile_definitions(datachannel-static PRIVATE RTC_SYSTEM_JUICE=0) diff --git a/src/impl/tcptransport.cpp b/src/impl/tcptransport.cpp index a83fda958..9f1a64a95 100644 --- a/src/impl/tcptransport.cpp +++ b/src/impl/tcptransport.cpp @@ -200,23 +200,23 @@ void TcpTransport::resolve() { } void TcpTransport::attempt() { - std::lock_guard lock(mSendMutex); + try { + std::lock_guard lock(mSendMutex); - if (state() != State::Connecting) - return; // Cancelled + if (state() != State::Connecting) + return; // Cancelled - if (mSock == INVALID_SOCKET) { - ::closesocket(mSock); - mSock = INVALID_SOCKET; - } + if (mSock == INVALID_SOCKET) { + ::closesocket(mSock); + mSock = INVALID_SOCKET; + } - if (mResolved.empty()) { - PLOG_WARNING << "Connection to " << mHostname << ":" << mService << " failed"; - changeState(State::Failed); - return; - } + if (mResolved.empty()) { + PLOG_WARNING << "Connection to " << mHostname << ":" << mService << " failed"; + changeState(State::Failed); + return; + } - try { auto [addr, addrlen] = mResolved.front(); mResolved.pop_front();