ref: 92adcda61567b2223d6f3147f2215035a71d3018
parent: 823514dafae253e38d9006a873124022e266c8e0
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Nov 30 23:20:53 EST 2018
webfs: write headers individually so they are not limited in sum to the 8k buffer
--- a/sys/src/cmd/webfs/http.c
+++ b/sys/src/cmd/webfs/http.c
@@ -683,7 +683,13 @@
/* only send proxy headers when establishing tunnel */
if(h->tunnel && cistrncmp(k->key, "Proxy-", 6) != 0)
continue;
- n += snprint(buf+n, sizeof(buf)-2 - n, "%s: %s\r\n", k->key, k->val);
+ if(n > 0){+ if(debug)
+ fprint(2, "-> %.*s", n, buf);
+ if(hwrite(h, buf, n) != n)
+ goto Badflush;
+ }
+ n = snprint(buf, sizeof(buf)-2, "%s: %s\r\n", k->key, k->val);
}
n += snprint(buf+n, sizeof(buf)-n, "\r\n");
if(debug)
--
⑨