Closed andersk-auto closed 10 years ago
Imported from trac issue 100. Created by jhutz@CS.CMU.EDU on 2013-02-18T15:44:37, last modified: 2013-02-27T00:22:59
Trac comment by Karl Ramm kcr@1ts.org on 2013-02-27 00:22:59:
In [864eb7e746c2d3a1fe03d230d01d74de97160b63/zephyr]: {{{
Treat obviously non-zephyr packets as bad
When Z_ReadWait receives a packet which doesn't start with a zephyr version header, it considers the packet to be "obviously non-zephyr". Such packets are discarded and, previously, caused Z_ReadWait to return ZERR_NONE. Unfortunately, this can cause things to block for up to 60s when a caller was expecting a non-blocking call to pick up a new packet if there is one.
This changes Z_ReadWait to return ZERR_BADPKT in this situation, eliminating the potential wait.
This fixes #100 }}}
If the server receives certain types of bad packets (specifically, one that Z_ReadWait thinks is "obviously" not a zephyr packet), it may block up to 60s waiting for another packet to arrive. During this time, other events, such as timers and incoming brain dump traffic, will not be processed.