Browse Source

Properly fixed deadlock on WebSocket server ping

Paul-Louis Ageneau 5 years ago
parent
commit
516a8ef848
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/tcptransport.cpp

+ 2 - 2
src/tcptransport.cpp

@@ -338,7 +338,7 @@ void TcpTransport::runLoop() {
 				throw std::runtime_error("Failed to wait on socket");
 				throw std::runtime_error("Failed to wait on socket");
 			} else if (ret == 0) {
 			} else if (ret == 0) {
 				PLOG_VERBOSE << "TCP is idle";
 				PLOG_VERBOSE << "TCP is idle";
-				mSockMutex.unlock(); // unlock now since the upper layer might send on incoming
+				lock.unlock(); // unlock now since the upper layer might send on incoming
 				incoming(make_message(0));
 				incoming(make_message(0));
 				continue;
 				continue;
 			}
 			}
@@ -360,7 +360,7 @@ void TcpTransport::runLoop() {
 				if (len == 0)
 				if (len == 0)
 					break; // clean close
 					break; // clean close
 
 
-				mSockMutex.unlock(); // unlock now since the upper layer might send on incoming
+				lock.unlock(); // unlock now since the upper layer might send on incoming
 				auto *b = reinterpret_cast<byte *>(buffer);
 				auto *b = reinterpret_cast<byte *>(buffer);
 				incoming(make_message(b, b + len));
 				incoming(make_message(b, b + len));
 			}
 			}