Thereby, we correct a bug in do_send(), one of the callers of try_send(),
which was not checking the try_send() return value.
}
while (rc->txq.n > 0) {
int error = try_send(rc);
- if (error == EAGAIN) {
+ if (error) {
break;
- } else if (error) {
- disconnect(rc, error);
- return;
}
}
}
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++;