summaryrefslogtreecommitdiff
path: root/sys/src/cmd/webfs/http.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2018-12-01 04:20:53 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2018-12-01 04:20:53 +0100
commitc4ecd0fee0f0cef485a223d6e638a56bafd5bbda (patch)
treeb212524734ab1c76e3cc6283779ddb45baf01609 /sys/src/cmd/webfs/http.c
parentec1976eb0521d668696c6b5946c045bdca6245b0 (diff)
webfs: write headers individually so they are not limited in sum to the 8k buffer
Diffstat (limited to 'sys/src/cmd/webfs/http.c')
-rw-r--r--sys/src/cmd/webfs/http.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/src/cmd/webfs/http.c b/sys/src/cmd/webfs/http.c
index 668d474f3..c279aeafe 100644
--- a/sys/src/cmd/webfs/http.c
+++ b/sys/src/cmd/webfs/http.c
@@ -683,7 +683,13 @@ http(char *m, Url *u, Key *shdr, Buq *qbody, Buq *qpost)
/* 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)