From 417b376e232e4276bb0dad7577625864517471fd Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Sat, 14 May 2016 03:13:58 +0200 Subject: [PATCH] accesslog: Fail as soon as possible on broken channels. --- src/accesslog.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/accesslog.c b/src/accesslog.c index 7328c4d..d77a467 100644 --- a/src/accesslog.c +++ b/src/accesslog.c @@ -223,9 +223,12 @@ static int passdata(struct bufio *in, struct bufio *out, off_t *passed) total = 0; while(!bioeof(in)) { - if((read = biocopysome(out, in)) < 0) - return(-1); - total += read; + if((read = biordata(in)) > 0) { + if((read = biowritesome(out, in->rbuf.b + in->rh, read)) < 0) + return(-1); + in->rh += read; + total += read; + } if(biorspace(in) && (biofillsome(in) < 0)) return(-1); } -- 2.11.0