summaryrefslogtreecommitdiff
path: root/lib/http/server.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-09-19 01:00:24 -0700
committerOri Bernstein <ori@eigenstate.org>2017-09-19 01:01:56 -0700
commit0c522bb285e38a32f46afeadd554e6f0bc86e407 (patch)
tree4fa265614a544bdada002a72a15f8988302c6176 /lib/http/server.myr
parent203628871eb48f200087851741dbb5416b4e07a7 (diff)
downloadmc-0c522bb285e38a32f46afeadd554e6f0bc86e407.tar.gz
Write body without formatting.
Diffstat (limited to 'lib/http/server.myr')
-rw-r--r--lib/http/server.myr14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/http/server.myr b/lib/http/server.myr
index d256b18..0cfdcb0 100644
--- a/lib/http/server.myr
+++ b/lib/http/server.myr
@@ -55,15 +55,15 @@ const respond = {srv, s, resp
var sb
sb = std.mksb()
- bio.put(s.f, "HTTP/1.1 {} {}\r\n", resp.status, statusstr(resp.status))
- bio.put(s.f, "Content-Length: {}\r\n", resp.body.len)
- bio.put(s.f, "Encoding: {}\r\n", resp.enc)
+ ioput(s, "HTTP/1.1 {} {}\r\n", resp.status, statusstr(resp.status))
+ ioput(s, "Content-Length: {}\r\n", resp.body.len)
+ ioput(s, "Encoding: {}\r\n", resp.enc)
for (k, v) : resp.hdrs
- bio.put(s.f, "{}: {}\r\n", k, v)
+ ioput(s, "{}: {}\r\n", k, v)
;;
- bio.put(s.f, "\r\n")
- bio.write(s.f, resp.body)
- bio.flush(s.f)
+ ioput(s, "\r\n")
+ iowrite(s, resp.body)
+ ioflush(s)
}
const statusstr = {st