Skip to content

Commit

Permalink
update mirage files
Browse files Browse the repository at this point in the history
  • Loading branch information
amirmc committed Jan 19, 2015
1 parent 413f30d commit 2dd9de0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
7 changes: 3 additions & 4 deletions _mirage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ in this folder.
Since these files are copy/pasted from another repo, the following links
should help to check if things have been updated upstream

Files are from:
https://github.com/mirage/mirage-skeleton/commit/6c75202f5a0272a97b1de66dd12054982da91f6f
Files are from: https://github.com/mirage/mirage-skeleton/commit/1709bad5bac9484b8feb476aa6803e464d66057b

Latest versions:
Latest versions are:
- [config.ml][]
- [dispatch.ml][]

[1] https://github.com/mirage/mirage-skeleton
[1]: https://github.com/mirage/mirage-skeleton

[mirage unikernel]: http://openmirage.org
[Travis CI]: https://travis-ci.org
Expand Down
11 changes: 9 additions & 2 deletions _mirage/config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,19 @@ let stack console =
| `Socket, _ -> socket_stackv4 console [Ipaddr.V4.any]

let server =
http_server 80 (stack default_console)
conduit_direct (stack default_console)

let http_srv =
let mode = `TCP (`Port 80) in
http_server mode server

let main =
foreign "Dispatch.Main" (console @-> kv_ro @-> http @-> job)

let () =
add_to_ocamlfind_libraries ["re.str"];
add_to_opam_packages ["re"];

register "www" [
main $ default_console $ fs $ server
main $ default_console $ fs $ http_srv
]
4 changes: 2 additions & 2 deletions _mirage/dispatch.ml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ module Main (C:CONSOLE) (FS:KV_RO) (S:Cohttp_lwt.Server) = struct
let uri = S.Request.uri request in
dispatcher (split_path uri)
in
let conn_closed conn_id () =
let conn_closed (_,conn_id) =
let cid = Cohttp.Connection.to_string conn_id in
C.log c (Printf.sprintf "conn %s closed" cid)
in
http { S.callback; conn_closed }
http (S.make ~conn_closed ~callback ())

end

0 comments on commit 2dd9de0

Please sign in to comment.