On Fri, Aug 25, 2017 at 06:38:01AM +0000, Rivo Nurges wrote:
> Your version works for me.

Good.

Any ok for this diff then?

bluhm

Index: usr.sbin/relayd/relay.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/usr.sbin/relayd/relay.c,v
retrieving revision 1.225
diff -u -p -r1.225 relay.c
--- usr.sbin/relayd/relay.c     9 Aug 2017 21:29:17 -0000       1.225
+++ usr.sbin/relayd/relay.c     24 Aug 2017 14:02:38 -0000
@@ -791,12 +791,12 @@ relay_write(struct bufferevent *bev, voi
 
        getmonotime(&con->se_tv_last);
 
-       if (con->se_done)
+       if (con->se_done && EVBUFFER_LENGTH(EVBUFFER_OUTPUT(bev)) == 0)
                goto done;
-       if (relay_splice(cre->dst) == -1)
-               goto fail;
        if (cre->dst->bev)
                bufferevent_enable(cre->dst->bev, EV_READ);
+       if (relay_splice(cre->dst) == -1)
+               goto fail;
 
        return;
  done:

Reply via email to