The problem here was that with the packet code set to serialise, we
can have multiple packets 'processing' at once, and previously the
second packet (allowed because we are spining on an event context down
the stack) would clear the flag.
Andrew Bartlett
*/
static void stream_io_handler(struct stream_connection *conn, uint16_t flags)
{
- conn->processing = true;
+ conn->processing++;
if (flags & EVENT_FD_WRITE) {
conn->ops->send_handler(conn, flags);
} else if (flags & EVENT_FD_READ) {
conn->ops->recv_handler(conn, flags);
}
- conn->processing = false;
+ conn->processing--;
if (conn->terminate) {
stream_terminate_connection(conn, conn->terminate);