exception Restart_HTTP_daemon;;
- (* thread action
+ (* reuquest handler action
@param syslogger Uwobo_logger.sysLogger instance used for logginf
@param styles Uwobo_styles.styles instance which keeps the stylesheets list
@param cmd_pipe output _channel_ used to _write_ update messages
return_error
(sprintf "Stylesheet chain application failed: %s" errmsg)
outchan)
- | "/help" ->
- output_string cmd_pipe "test\n";
- flush cmd_pipe;
- debug_print
- (sprintf "Grandchild: grandparent said '%s'" (input_line res_pipe));
- Http_daemon.respond ~body:usage_string outchan
+ | "/help" -> Http_daemon.respond ~body:usage_string outchan
| invalid_request ->
Http_daemon.respond_error ~status:(`Client_error `Bad_request) outchan);
syslogger#log `Debug (sprintf "%s done!" req#path);
let cmd_pipe = Unix.out_channel_of_descr cmd_pipe_entrance in
let res_pipe = Unix.in_channel_of_descr res_pipe_exit in
debug_print "Starting HTTP daemon ...";
+ (* next invocation doesn't return, process will keep on serving HTTP
+ requests until it will get killed by father *)
Http_daemon.start'~port ~mode:`Fork
(callback ~syslogger ~styles ~cmd_pipe ~res_pipe ())
| _ (* < 0 *) -> (* fork failed :-((( *)
main ()
with Sys.Break -> () (* 'die_nice' registered with at_exit *)
-