summaryrefslogtreecommitdiff
path: root/lib/http/server.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-09-12 21:06:38 -0700
committerOri Bernstein <ori@eigenstate.org>2017-09-12 21:07:13 -0700
commit52a9615661dfd2c9d4114b1a6f1d48830c3e3427 (patch)
tree45b03bc265ee9d04d88ae9c8638dc0cc6162f079 /lib/http/server.myr
parent615d1d878c603e55120b5d4250d3173fba19f135 (diff)
downloadmc-52a9615661dfd2c9d4114b1a6f1d48830c3e3427.tar.gz
Make announce API more cross platform.
Encapsulate announcement into a struct.
Diffstat (limited to 'lib/http/server.myr')
-rw-r--r--lib/http/server.myr10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/http/server.myr b/lib/http/server.myr
index 90fba7e..d256b18 100644
--- a/lib/http/server.myr
+++ b/lib/http/server.myr
@@ -16,10 +16,10 @@ pkg http =
const announce = {ds
match std.announce(ds)
| `std.Err e: -> `std.Err `Econn
- | `std.Ok lfd:
+ | `std.Ok a:
-> `std.Ok std.mk([
.refs=1,
- .lfd=lfd,
+ .ann=a,
.quit=false
])
;;
@@ -76,14 +76,12 @@ const statusstr = {st
}
const shutdown = {srv
- std.close(srv.lfd)
+ std.aclose(srv.ann)
srv.quit = true
-
}
-
const waitconn = {srv
- match std.accept(srv.lfd)
+ match std.accept(srv.ann)
| `std.Ok fd: -> `std.Ok fd
| `std.Err e: -> `std.Err `Econn
;;