mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-21 09:51:50 +00:00
The quit-on-monitor-client-disconnect test was non-deterministic depending on load (eg, other concurrently running tests). Under load, it was likely that the server did not process the "monitor quit" command before checking for disconnect, so the server did not terminate. The fix was to make the monitor interface read and process all queued input from the client before checking for HUP or ERR condition on the socket. With this fix, the "sleep 1" kludges before and after the echo "monitor quit" to the console command are no longer needed. In the process the monitor interface code was modernised: eg, now it calls read_nonblock() instead of read(2).