From: Fredrik Tolf Date: Sat, 14 May 2016 01:13:58 +0000 (+0200) Subject: accesslog: Fail as soon as possible on broken channels. X-Git-Url: http://www.dolda2000.com/gitweb/?p=ashd.git;a=commitdiff_plain;h=417b376e232e4276bb0dad7577625864517471fd accesslog: Fail as soon as possible on broken channels. --- 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); }