Check user exists before opening incoming ports
[hcoop/domtool2.git] / src / msg.sml
index 0a50b6e..22f548c 100644 (file)
@@ -242,6 +242,9 @@ fun send (bio, m) =
       | MsgReUsers => OpenSSL.writeInt (bio, 41)
       | MsgVmailChanged => OpenSSL.writeInt (bio, 42)
       | MsgFirewallRegen => OpenSSL.writeInt (bio, 43)
+      | MsgAptQuery {section, description} => (OpenSSL.writeInt (bio, 44);
+                                              OpenSSL.writeString (bio, section);
+                                              OpenSSL.writeString (bio, description))
 
 fun checkIt v =
     case v of
@@ -357,6 +360,9 @@ fun recv bio =
                   | 41 => SOME MsgReUsers
                   | 42 => SOME MsgVmailChanged
                   | 43 => SOME MsgFirewallRegen
+                  | 44 => (case (OpenSSL.readString bio, OpenSSL.readString bio) of
+                               (SOME section, SOME description) => SOME (MsgAptQuery {section = section, description = description})
+                             | _ => NONE)
                   | _ => NONE)
         
 end