Hi! This will fix my problem and regress still passes.
Index: usr.sbin/relayd/relay.c =================================================================== RCS file: /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 12:41:55 -0000 @@ -788,9 +788,12 @@ relay_write(struct bufferevent *bev, voi { struct ctl_relay_event *cre = arg; struct rsession *con = cre->con; + struct evbuffer *dst = EVBUFFER_OUTPUT(bev); getmonotime(&con->se_tv_last); + if (EVBUFFER_LENGTH(dst)) + return; if (con->se_done) goto done; if (relay_splice(cre->dst) == -1) Rivo On 23/08/2017, 14:42, "Alexander Bluhm" <alexander.bl...@gmx.net> wrote: On Tue, Aug 22, 2017 at 05:31:17PM +0000, Rivo Nurges wrote: > relay_error() sets se_done even if write buffer is not drained and > relay_write() will close the connection if se_done is set I have seen a sporadic fail with chunked encoding in the daily regression test run. So something might be wrong. Your idea of not closing the relay if there is data in the buffer, makes sense. Unfortunately the regression tests in /usr/src/regress/usr.sbin/relayd fail with your patch. It hangs as the EOF is not properly propagated. I think the change in relay_error() affects too much. bluhm