2
0
Эх сурвалжийг харах

Fixed potential deadlock when sending from buffer low callback

Paul-Louis Ageneau 5 жил өмнө
parent
commit
64be7a62f4
1 өөрчлөгдсөн 8 нэмэгдсэн , 2 устгасан
  1. 8 2
      src/sctptransport.cpp

+ 8 - 2
src/sctptransport.cpp

@@ -385,7 +385,13 @@ void SctpTransport::updateBufferedAmount(uint16_t streamId, long delta) {
 	else
 		it->second = amount;
 
-	mBufferedAmountCallback(streamId, amount);
+	mSendMutex.unlock();
+	try {
+		mBufferedAmountCallback(streamId, amount);
+	} catch (const std::exception &e) {
+		PLOG_WARNING << "SCTP buffered amount callback: " << e.what();
+	}
+	mSendMutex.lock();
 }
 
 void SctpTransport::sendReset(uint16_t streamId) {
@@ -421,7 +427,7 @@ bool SctpTransport::safeFlush() {
 		return true;
 
 	} catch (const std::exception &e) {
-		PLOG_ERROR << "SCTP flush: " << e.what();
+		PLOG_WARNING << "SCTP flush: " << e.what();
 		return false;
 	}
 }