From bfe75927050dd0ceaf4fd8ed25abefbbfe01ca45 Mon Sep 17 00:00:00 2001 From: Felix von Leitner Date: Mon, 26 Jan 2004 01:17:39 +0000 Subject: [PATCH] the mmap+write version of io_sendfile sent too much at the end and/or went into an infinite loop sometimes. --- io/io_sendfile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/io/io_sendfile.c b/io/io_sendfile.c index 000246d..45fa04f 100644 --- a/io/io_sendfile.c +++ b/io/io_sendfile.c @@ -128,6 +128,7 @@ int64 io_sendfile(int64 out,int64 in,uint64 off,uint64 bytes) { mapok: c=(const char*)(e->mmapped)+(off&0xffff); left=e->maplen-(off&0xffff); + if (left>bytes) left=bytes; while (left>0) { m=write(out,c,left); if (m==-1) {