let rdf_map = new Http_getter_map.map Http_getter_env.rdf_dbm in
let xsl_map = new Http_getter_map.map Http_getter_env.xsl_dbm in
+let save_maps () = xml_map#close; rdf_map#close; xsl_map#close in
let map_of_uri = function
| uri when is_xml_uri uri -> xml_map
| uri when is_rdf_uri uri -> rdf_map
| "/getempty" ->
Http_daemon.respond ~body:Http_getter_const.empty_xml outchan
| invalid_request ->
- Http_daemon.respond_error ~status:(`Client_error `Bad_request) outchan)
+ Http_daemon.respond_error ~status:(`Client_error `Bad_request) outchan);
+ debug_print "Done!"
with
| Http_types.Param_not_found attr_name ->
return_400 (sprintf "Parameter '%s' is missing" attr_name) outchan
Http_getter_env.dump_env ();
flush stdout;
Unix.putenv "http_proxy" "";
-Http_daemon.start'
- ~timeout:None ~port:Http_getter_env.port ~mode:`Thread callback
+Sys.catch_break true;
+try
+ Http_daemon.start'
+ ~timeout:None ~port:Http_getter_env.port ~mode:`Thread callback
+with Sys.Break ->
+ save_maps ()