res = sbuf->proto_handler(sbuf, event, &mbuf, sbuf->arg);
AssertSanity(sbuf);
- if (event == SBUF_EV_READ && res)
- Assert(sbuf->sock > 0);
+ Assert(event != SBUF_EV_READ || !res || sbuf->sock > 0);
return res;
}
/*
* Main recv-parse-send-repeat loop.
*
- * The problem with extra recv() is EOF from socket. Currently that means
- * that the pending data is dropped. Fortunately server sockets are not
- * paused and dropping data from client is no problem. So only place
- * where skip_recv is important is sbuf_send_cb().
+ * Reason for skip_recv is to avoid extra recv(). The problem with it
+ * is EOF from socket. Currently that means that the pending data is
+ * dropped. Fortunately server sockets are not paused and dropping
+ * data from client is no problem. So only place where skip_recv is
+ * important is sbuf_send_cb().
*/
static void sbuf_main_loop(SBuf *sbuf, bool skip_recv)
{