Ran successful client/server interaction on deleuze
authorAdam Chlipala <adamc@hcoop.net>
Sat, 9 Dec 2006 18:11:13 +0000 (18:11 +0000)
committerAdam Chlipala <adamc@hcoop.net>
Sat, 9 Dec 2006 18:11:13 +0000 (18:11 +0000)
Makefile
bin/.cvsignore
configDefault/domtool.cfg
openssl/mlton/libssl-h.sml
openssl/smlnj/libssl-h.sml
src/.cvsignore
src/main-client.sml [new file with mode: 0644]
src/main.sml

index bbd19f3..fd671a9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,9 +3,9 @@ all: mlton
 COMMON_DEPS := configDefault/config.sig configDefault/configDefault.sml \
        openssl/openssl_sml.so
 
 COMMON_DEPS := configDefault/config.sig configDefault/configDefault.sml \
        openssl/openssl_sml.so
 
-.PHONY: all mlton smlnj
+.PHONY: all mlton smlnj install
 
 
-mlton: bin/domtool-server
+mlton: bin/domtool-server bin/domtool-client
 
 smlnj: $(COMMON_DEPS) openssl/smlnj/FFI/libssl.h.cm src/domtool.cm
 
 
 smlnj: $(COMMON_DEPS) openssl/smlnj/FFI/libssl.h.cm src/domtool.cm
 
@@ -42,6 +42,12 @@ src/domtool-server.mlb: Makefile src/prefix.mlb src/sources src/suffix.mlb
                | sed 's/^\(.*\).lex$$/\1.lex.sml/' >src/domtool-server.mlb
        echo "main-server.sml" >>src/domtool-server.mlb
 
                | sed 's/^\(.*\).lex$$/\1.lex.sml/' >src/domtool-server.mlb
        echo "main-server.sml" >>src/domtool-server.mlb
 
+src/domtool-client.mlb: Makefile src/prefix.mlb src/sources src/suffix.mlb
+       cat src/prefix.mlb src/sources src/suffix.mlb \
+               | sed 's/^\(.*\).grm$$/\1.grm.sig\n\1.grm.sml/' \
+               | sed 's/^\(.*\).lex$$/\1.lex.sml/' >src/domtool-client.mlb
+       echo "main-client.sml" >>src/domtool-client.mlb
+
 openssl/smlnj/FFI/libssl.h.cm: openssl/openssl_sml.h
        cd openssl/smlnj ; ml-nlffigen -d FFI -lh LibsslH.libh -include ../libssl-h.sml \
        -cm libssl.h.cm -D__builtin_va_list="void*" \
 openssl/smlnj/FFI/libssl.h.cm: openssl/openssl_sml.h
        cd openssl/smlnj ; ml-nlffigen -d FFI -lh LibsslH.libh -include ../libssl-h.sml \
        -cm libssl.h.cm -D__builtin_va_list="void*" \
@@ -61,5 +67,16 @@ openssl/mlton/FFI/libssl.h.mlb: openssl/openssl_sml.h
 bin/domtool-server: openssl/mlton/FFI/libssl.h.mlb \
                src/domtool-server.mlb src/domtool.lex.sml \
                src/domtool.grm.sig src/domtool.grm.sml \
 bin/domtool-server: openssl/mlton/FFI/libssl.h.mlb \
                src/domtool-server.mlb src/domtool.lex.sml \
                src/domtool.grm.sig src/domtool.grm.sml \
-               $(COMMON_DEPS)
+               $(COMMON_DEPS) src/*.sig src/*.sml
        mlton -output bin/domtool-server -link-opt -ldl src/domtool-server.mlb
        mlton -output bin/domtool-server -link-opt -ldl src/domtool-server.mlb
+
+bin/domtool-client: openssl/mlton/FFI/libssl.h.mlb \
+               src/domtool-client.mlb src/domtool.lex.sml \
+               src/domtool.grm.sig src/domtool.grm.sml \
+               $(COMMON_DEPS) src/*.sig src/*.sml
+       mlton -output bin/domtool-client -link-opt -ldl src/domtool-client.mlb
+
+install:
+       -cp openssl/openssl_sml.so /usr/local/lib/
+       -cp bin/domtool-server /usr/local/sbin/
+       -cp bin/domtool-client /usr/local/bin/domtool
index 5775e09..1f7b05a 100644 (file)
@@ -1 +1,3 @@
 domtool-server
 domtool-server
+domtool-client
+domtool-slave
index 7aa3022..d83c398 100644 (file)
@@ -30,7 +30,7 @@ val queueSize = 5
 
 val bufSize = 1024
 
 
 val bufSize = 1024
 
-val trustStore = "/afs/hcoop.net/common/etc/domtool/TrustKey.pem"
+val trustStore = "/afs/hcoop.net/common/etc/domtool/TrustStore.pem"
 val serverCert = "/afs/hcoop.net/common/etc/domtool/servercert.pem"
 val serverKey = "/etc/domtool/serverkey.pem"
 
 val serverCert = "/afs/hcoop.net/common/etc/domtool/servercert.pem"
 val serverKey = "/etc/domtool/serverkey.pem"
 
index 6e4b191..7bf5f0b 100644 (file)
@@ -1,7 +1,7 @@
 structure LibsslH = struct
     local
         val lh = DynLinkage.open_lib
 structure LibsslH = struct
     local
         val lh = DynLinkage.open_lib
-             { name = "openssl/openssl_sml.so", global = true, lazy = true }
+             { name = "/usr/local/lib/openssl_sml.so", global = true, lazy = true }
            handle DynLinkage.DynLinkError s => raise Fail s
     in
         fun libh s = let
            handle DynLinkage.DynLinkError s => raise Fail s
     in
         fun libh s = let
index 6e4b191..7bf5f0b 100644 (file)
@@ -1,7 +1,7 @@
 structure LibsslH = struct
     local
         val lh = DynLinkage.open_lib
 structure LibsslH = struct
     local
         val lh = DynLinkage.open_lib
-             { name = "openssl/openssl_sml.so", global = true, lazy = true }
+             { name = "/usr/local/lib/openssl_sml.so", global = true, lazy = true }
            handle DynLinkage.DynLinkError s => raise Fail s
     in
         fun libh s = let
            handle DynLinkage.DynLinkError s => raise Fail s
     in
         fun libh s = let
index 5358fb1..ab70953 100644 (file)
@@ -3,3 +3,5 @@
 *.grm.*
 domtool.cm
 domtool-server.mlb
 *.grm.*
 domtool.cm
 domtool-server.mlb
+domtool-client.mlb
+domtool-slave.mlb
diff --git a/src/main-client.sml b/src/main-client.sml
new file mode 100644 (file)
index 0000000..d6fe010
--- /dev/null
@@ -0,0 +1,24 @@
+(* HCoop Domtool (http://hcoop.sourceforge.net/)
+ * Copyright (c) 2006, Adam Chlipala
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *)
+
+(* Driver for server *)
+
+val _ =
+    case CommandLine.arguments () of
+       [fname] => Main.request fname
+      | _ => print "Invalid command-line arguments\n"
index 461207a..9f01855 100644 (file)
@@ -238,6 +238,7 @@ fun service () =
                    cmdLoop ()
                end
     in
                    cmdLoop ()
                end
     in
+       print "Listening for connections....\n";
        loop ();
        OpenSSL.shutdown sock
     end
        loop ();
        OpenSSL.shutdown sock
     end