Closed simon-budig closed 7 years ago
Hi Simon, thanks for catching this bug!
I've investigated the issue, and committed a different fix in 5d8da39 that I think is better: it ensures that we never attempt to recv
zero bytes, and prevents the server from stalling (waiting for data that it doesn't need) when the header says there are zero pixels.
When the client sends a (useless) package with a zero lenght (i.e. no message data beyond the header) the opc-server inadvertedly closes the connection.
This patch fixes this behaviour, by explicitely checking if the recv() returned 0 (in this case the remote really has closed the connection) and setting "received" to -1 explicitely then.