- case prog of
- (_, SOME body) =>
- let
- val body' = Reduce.reduceExp G' body
- in
- if !ErrorMsg.anyErrors then
- ()
- else
- Eval.exec StringMap.empty body'
- end
- | _ => ()
+ loop (C.Ptr.|+! C.S.uchar (buf, Int32.toInt r), Int32.- (len, r))
+ end
+ in
+ loop (buf, Int32.fromInt (size s));
+ C.free' buf
+ end
+
+fun request fname =
+ let
+ val bio = F_OpenSSL_SML_new_connect.f' dispatcher
+ in
+ if C.Ptr.isNull' bio then
+ (ssl_err ("Error initializating connection to dispatcher at " ^ Config.dispatcher);
+ F_OpenSSL_SML_free_all.f' bio)
+ else if F_OpenSSL_SML_do_connect.f' bio <= 0 then
+ (ssl_err ("Error connecting to dispatcher at " ^ Config.dispatcher);
+ F_OpenSSL_SML_free_all.f' bio)
+ else let
+ val inf = TextIO.openIn fname
+
+ fun loop () =
+ case TextIO.inputLine inf of
+ NONE => ()
+ | SOME line => (writeAll (bio, line);
+ loop ())
+ in
+ loop ();
+ TextIO.closeIn inf;
+ F_OpenSSL_SML_free_all.f' bio