From cb4d8ca5e09d4be20348d32f6540e6c9fcad4098 Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Sat, 11 Aug 2007 07:01:13 +0000 Subject: [PATCH] comment out the recv() avoidance logic --- src/sbuf.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/sbuf.c b/src/sbuf.c index 40eb41a..057b5bf 100644 --- a/src/sbuf.c +++ b/src/sbuf.c @@ -175,25 +175,23 @@ void sbuf_pause(SBuf *sbuf) /* resume from pause, start waiting for data */ void sbuf_continue(SBuf *sbuf) { - bool do_recv = true; + bool do_recv = DO_RECV; AssertActive(sbuf); sbuf_wait_for_data(sbuf); /* - * FIXME: is it safe? + * It's tempting to try to avoid the recv() but that would + * only work if no code wants to see full packet. * - * if avail > SMALL_PKT in buffer, skip the recv(). + * This is not true in ServerParameter case. */ - if (sbuf->recv_pos - sbuf->pkt_pos >= SMALL_PKT) - do_recv = false; - /* - * There may be some data already received, - * but not certain, so avoid SKIP_RECV. - * Anyway, it affects only client sockets. + * if (sbuf->recv_pos - sbuf->pkt_pos >= SMALL_PKT) + * do_recv = false; */ - sbuf_main_loop(sbuf, DO_RECV); + + sbuf_main_loop(sbuf, do_recv); } /* -- 2.50.1