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

Exit SCTP recv loop on disconnected state

Paul-Louis Ageneau 4 жил өмнө
parent
commit
2bae3f62c4

+ 1 - 1
src/sctptransport.cpp

@@ -336,7 +336,7 @@ void SctpTransport::doRecv() {
 	std::lock_guard lock(mRecvMutex);
 	std::lock_guard lock(mRecvMutex);
 	--mPendingRecvCount;
 	--mPendingRecvCount;
 	try {
 	try {
-		while (true) {
+		while (state() != State::Disconnected && state() != State::Failed) {
 			const size_t bufferSize = 65536;
 			const size_t bufferSize = 65536;
 			byte buffer[bufferSize];
 			byte buffer[bufferSize];
 			socklen_t fromlen = 0;
 			socklen_t fromlen = 0;