X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fhtparser.c;h=d10121cd6a2bb0e6af60a3b36e032ab468b9b002;hb=4350acb522111f385f74dd9c7f8b3e47443ff225;hp=bb235399885f41c823e758dedb34ed090cb49cee;hpb=a68db17def8493b7f338541d57bcb7ca0de64618;p=ashd.git diff --git a/src/htparser.c b/src/htparser.c index bb23539..d10121c 100644 --- a/src/htparser.c +++ b/src/htparser.c @@ -152,7 +152,7 @@ static off_t passdata(struct bufio *in, struct bufio *out, off_t max) static int recvchunks(struct bufio *in, struct bufio *out) { - size_t read, chlen; + ssize_t read, chlen; int c, r; while(1) { @@ -333,7 +333,8 @@ static void passduplex(struct bufio *a, int afd, struct bufio *b, int bfd) if(ev) pfd[n++] = (struct selected){.fd = bfd, .ev = ev}; } - sel = mblock(600, n, pfd); + if((sel = mblock(600, n, pfd)).ev == 0) + break; if(sel.fd == afd) sio = a; else if(sel.fd == bfd)