Specifying encoding on database creation
[hcoop/domtool2.git] / src / msg.sml
index a8450dd..5eacaa2 100644 (file)
@@ -173,9 +173,10 @@ fun send (bio, m) =
       | MsgCreateDbUser {dbtype, passwd} => (OpenSSL.writeInt (bio, 16);
                                             OpenSSL.writeString (bio, dbtype);
                                             sendOption OpenSSL.writeString (bio, passwd))
       | MsgCreateDbUser {dbtype, passwd} => (OpenSSL.writeInt (bio, 16);
                                             OpenSSL.writeString (bio, dbtype);
                                             sendOption OpenSSL.writeString (bio, passwd))
-      | MsgCreateDb {dbtype, dbname} => (OpenSSL.writeInt (bio, 17);
-                                        OpenSSL.writeString (bio, dbtype);
-                                        OpenSSL.writeString (bio, dbname))
+      | MsgCreateDb {dbtype, dbname, encoding} => (OpenSSL.writeInt (bio, 17);
+                                                  OpenSSL.writeString (bio, dbtype);
+                                                  OpenSSL.writeString (bio, dbname);
+                                                  sendOption OpenSSL.writeString (bio, encoding))
       | MsgNewMailbox {domain, user, passwd, mailbox} =>
        (OpenSSL.writeInt (bio, 18);
         OpenSSL.writeString (bio, domain);
       | MsgNewMailbox {domain, user, passwd, mailbox} =>
        (OpenSSL.writeInt (bio, 18);
         OpenSSL.writeString (bio, domain);
@@ -289,9 +290,9 @@ fun recv bio =
                                (SOME dbtype, SOME passwd) =>
                                SOME (MsgCreateDbUser {dbtype = dbtype, passwd = passwd})
                              | _ => NONE)
                                (SOME dbtype, SOME passwd) =>
                                SOME (MsgCreateDbUser {dbtype = dbtype, passwd = passwd})
                              | _ => NONE)
-                  | 17 => (case (OpenSSL.readString bio, OpenSSL.readString bio) of
-                               (SOME dbtype, SOME dbname) =>
-                               SOME (MsgCreateDb {dbtype = dbtype, dbname = dbname})
+                  | 17 => (case (OpenSSL.readString bio, OpenSSL.readString bio, recvOption OpenSSL.readString bio) of
+                               (SOME dbtype, SOME dbname, SOME encoding) =>
+                               SOME (MsgCreateDb {dbtype = dbtype, dbname = dbname, encoding = encoding})
                              | _ => NONE)
                   | 18 => (case (OpenSSL.readString bio, OpenSSL.readString bio,
                                  OpenSSL.readString bio, OpenSSL.readString bio) of
                              | _ => NONE)
                   | 18 => (case (OpenSSL.readString bio, OpenSSL.readString bio,
                                  OpenSSL.readString bio, OpenSSL.readString bio) of