From: Ben Pfaff Date: Mon, 14 Jul 2008 20:31:56 +0000 (-0700) Subject: rconn: Push detection of send errors into try_send(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=453084ed49d8419343ce80ce3c464bb411148b14;p=openvswitch 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. --- 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++;