From: Marko Kreen Date: Wed, 1 Aug 2007 20:06:37 +0000 (+0000) Subject: remove if() before Assert(), some comment tuning X-Git-Tag: pgbouncer_1_1~73 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e646fa1bbb744a41402ff3b8357726ff4a9cacc8;p=pgbouncer remove if() before Assert(), some comment tuning --- diff --git a/src/sbuf.c b/src/sbuf.c index 6479244..f6e5830 100644 --- a/src/sbuf.c +++ b/src/sbuf.c @@ -271,8 +271,7 @@ static bool sbuf_call_proto(SBuf *sbuf, int event) 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; } @@ -492,10 +491,11 @@ static void sbuf_recv_cb(int sock, short flags, void *arg) /* * 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) {