summaryrefslogtreecommitdiff
path: root/lib/http/server.myr
diff options
context:
space:
mode:
authorFrank Smit <frank@61924.nl>2021-07-27 15:25:41 +0200
committerOri Bernstein <ori@eigenstate.org>2021-08-20 01:08:07 -0400
commitba1476058afaffc3f24ca8fbde11234def04d1bf (patch)
tree412bdb2cb41e2bc3857def9df349e44aea425bd5 /lib/http/server.myr
parentd7740736da8f2ca830d558cdedd89266b9019375 (diff)
downloadmc-ba1476058afaffc3f24ca8fbde11234def04d1bf.tar.gz
lib/http: Free session and request when done.
Diffstat (limited to 'lib/http/server.myr')
-rw-r--r--lib/http/server.myr8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/http/server.myr b/lib/http/server.myr
index 3ffde95..9ab2ba1 100644
--- a/lib/http/server.myr
+++ b/lib/http/server.myr
@@ -41,23 +41,23 @@ const communicate = {srv, fd, fn
var s
s = mksrvsession(fd)
+
while !srv.quit
match parsereq(s)
| `std.Ok req:
fn(srv, s, req)
- freereq(s)
+ freereq(req)
| `std.Err e:
break
;;
;;
+
+ freesession(s)
std.close(fd)
unref(srv)
}
const respond = {srv, s, resp
- var sb
-
- sb = std.mksb()
ioput(s, "HTTP/1.1 {} {}\r\n", resp.status, statusstr(resp.status))
if resp.enc != `Chunked