From 453084ed49d8419343ce80ce3c464bb411148b14 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 14 Jul 2008 13:31:56 -0700 Subject: [PATCH] rconn: Push detection of send errors into try_send(). Thereby, we correct a bug in do_send(), one of the callers of try_send(), which was not checking the try_send() return value. --- lib/rconn.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/rconn.c b/lib/rconn.c index 066a5466..c410e736 100644 --- a/lib/rconn.c +++ b/lib/rconn.c @@ -180,11 +180,8 @@ rconn_run(struct rconn *rc) } while (rc->txq.n > 0) { int error = try_send(rc); - if (error == EAGAIN) { + if (error) { break; - } else if (error) { - disconnect(rc, error); - return; } } } @@ -378,6 +375,9 @@ try_send(struct rconn *rc) struct buffer *next = rc->txq.head->next; retval = vconn_send(rc->vconn, rc->txq.head); if (retval) { + if (retval != EAGAIN) { + disconnect(rc, retval); + } return retval; } rc->packets_sent++; -- 2.30.2