Begin analysis of posted messages

This commit is contained in:
Tony Garnock-Jones 2012-04-29 11:53:53 -04:00
parent 65bec8ddbf
commit d59ed16de4
3 changed files with 9 additions and 1 deletions

View File

@ -170,6 +170,11 @@ let render_fixed_content cout s headers_only =
output_string cout "\r\n";
if headers_only then () else output_string cout s
let string_of_content c =
match c with
| Fixed s -> s
| Variable s -> Stringstream.to_string s
let render_content cout v c headers_only =
match c with
| Fixed s ->

View File

@ -77,6 +77,9 @@ let api_tap_source r =
Stringstream.empty))
let api_tap_sink r =
List.iter
(fun (k, v) -> Printf.printf "%s = %s\n%!" k (match v with Some x -> x | None -> "..."))
(Httpd.parse_urlencoded (Httpd.string_of_content r.Httpd.req_body.Httpd.content));
Httpd.resp_generic 202 "Accepted" [] (Httpd.Fixed "")
let api_tap r =

View File

@ -34,7 +34,7 @@ function reset_tap_stream() {
},
message: function (event, stream) {
$("#debug_container").text(JSON.stringify(event.data));
stream.send({ok: true});
stream.send({data: JSON.stringify({ok: true})});
},
error: server_disconnected,
close: server_disconnected