mirror of
				https://github.com/eledio-devices/thirdparty-AsyncTCPSock.git
				synced 2025-10-31 16:14:15 +01:00 
			
		
		
		
	Protect write buffer queue with a per-client mutex
This prevents a race condicion of the ::add() method modifying the queue and being preempted by the high-priority asyncTcpSock task that in turn flushes the same queue to the socket, therefore modifying the queue.
This commit is contained in:
		| @@ -180,6 +180,7 @@ class AsyncClient : public AsyncSocketBase | ||||
|     } queued_writebuf; | ||||
|  | ||||
|     // Queue of buffers to write to socket | ||||
|     SemaphoreHandle_t _write_mutex; | ||||
|     std::deque<queued_writebuf> _writeQueue; | ||||
|     bool _ack_timeout_signaled = false; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user