this fix httpread trying to be too smart and ocationating problems. "webfsget https://mail.google.com/mail/help/images/logo1.gif" is an example. federico Reference: /n/sources/patch/applied/webfs-httpread-too-smart Date: Sat Jul 8 17:49:12 CES 2006 Signed-off-by: benavento@gmail.com --- /sys/src/cmd/webfs/http.c Sat Jul 8 17:48:07 2006 +++ /sys/src/cmd/webfs/http.c Sat Jul 8 17:48:02 2006 @@ -446,29 +446,15 @@ int httpread(Client *c, Req *r) { - char *dst; HttpState *hs; - int n; - long rlen, tot, len; + long n; hs = c->aux; - dst = r->ofcall.data; - len = r->ifcall.count; - tot = 0; - while (tot < len){ - rlen = len - tot; - n = readibuf(&hs->b, dst + tot, rlen); - if(n == 0) - break; - else if(n < 0){ - if(tot == 0) - return -1; - else - return tot; - } - tot += n; - } - r->ofcall.count = tot; + n = readibuf(&hs->b, r->ofcall.data, r->ifcall.count); + if(n < 0) + return -1; + + r->ofcall.count = n; return 0; }