From d390c04ca9f3d5caaca5bc003c2437235590cfbf Mon Sep 17 00:00:00 2001 From: Paul-Louis Ageneau Date: Sat, 14 Nov 2020 21:40:29 +0100 Subject: [PATCH] Fixed wait on written condition --- src/sctptransport.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sctptransport.cpp b/src/sctptransport.cpp index 93db6f2..42025be 100644 --- a/src/sctptransport.cpp +++ b/src/sctptransport.cpp @@ -148,7 +148,7 @@ SctpTransport::SctpTransport(std::shared_ptr lower, uint16_t port, struct sctp_paddrparams spp = {}; #if USE_PMTUD - // Enabled SCTP path MTU discovery + // Enable SCTP path MTU discovery spp.spp_flags = SPP_PMTUD_ENABLE; #else // Fall back to a safe MTU value. @@ -305,7 +305,7 @@ void SctpTransport::incoming(message_ptr message) { // to be sent on our side (i.e. the local INIT) before proceeding. if (!mWrittenOnce) { // test the atomic boolean is not set first to prevent a lock contention std::unique_lock lock(mWriteMutex); - mWrittenCondition.wait(lock, [&]() { return mWrittenOnce || state() != State::Connected; }); + mWrittenCondition.wait(lock, [&]() { return mWrittenOnce.load(); }); } if (!message) {