X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/blobdiff_plain/7af7d4cb58acc571a75b51c0dd0f1b4d9c92e619..976657583f419a6a204400ea90f9758d15243acb:/src/main.sml?ds=sidebyside diff --git a/src/main.sml b/src/main.sml index 19162a3..490f66d 100644 --- a/src/main.sml +++ b/src/main.sml @@ -212,21 +212,21 @@ fun service () = TextIO.closeOut outf; (eval outname; Msg.send (bio, MsgOk)) - handle ErrorMsg.Error => - (print "Compilation error\n"; - Msg.send (bio, - MsgError "Error during configuration evaluation")) - | OpenSSL.OpenSSL s => - (print "OpenSSL error\n"; - Msg.send (bio, - MsgError - ("Error during configuration evaluation: " - ^ s))); - OS.FileSys.remove outname; - (ignore (OpenSSL.readChar bio); - OpenSSL.close bio) - handle OpenSSL.OpenSSL _ => (); - loop () + handle ErrorMsg.Error => + (print "Compilation error\n"; + Msg.send (bio, + MsgError "Error during configuration evaluation")) + | OpenSSL.OpenSSL s => + (print "OpenSSL error\n"; + Msg.send (bio, + MsgError + ("Error during configuration evaluation: " + ^ s))); + OS.FileSys.remove outname; + (ignore (OpenSSL.readChar bio); + OpenSSL.close bio) + handle OpenSSL.OpenSSL _ => (); + loop () end | _ => (Msg.send (bio, MsgError "Unexpected command") @@ -237,6 +237,16 @@ fun service () = in cmdLoop () end + handle OpenSSL.OpenSSL s => + (print ("OpenSSL error: " ^ s ^ "\n"); + OpenSSL.close bio + handle OpenSSL.OpenSSL _ => (); + loop ()) + | OS.SysErr (s, _) => + (print ("System error: " ^ s ^ "\n"); + OpenSSL.close bio + handle OpenSSL.OpenSSL _ => (); + loop ()) in print "Listening for connections....\n"; loop ();