HCoop
/
hcoop
/
domtool2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bootstrap: ensure ca config exists before continuing
[hcoop/domtool2.git]
/
src
/
msg.sml
diff --git
a/src/msg.sml
b/src/msg.sml
index
0a50b6e
..
a1a52de
100644
(file)
--- a/
src/msg.sml
+++ b/
src/msg.sml
@@
-1,5
+1,6
@@
(* HCoop Domtool (http://hcoop.sourceforge.net/)
* Copyright (c) 2006, Adam Chlipala
(* HCoop Domtool (http://hcoop.sourceforge.net/)
* Copyright (c) 2006, Adam Chlipala
+ * Copyright (c) 2011,2014 Clinton Ebadi <clinton@unknownlamer.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@
-117,8
+118,9
@@
fun sendQuery (bio, q) =
OpenSSL.writeString (bio, s))
| QSocket s => (OpenSSL.writeInt (bio, 4);
OpenSSL.writeString (bio, s))
OpenSSL.writeString (bio, s))
| QSocket s => (OpenSSL.writeInt (bio, 4);
OpenSSL.writeString (bio, s))
- | QFirewall s => (OpenSSL.writeInt (bio, 5);
- OpenSSL.writeString (bio, s))
+ | QFirewall {node, user} => (OpenSSL.writeInt (bio, 5);
+ OpenSSL.writeString (bio, node);
+ OpenSSL.writeString (bio, user))
| QAptExists s => (OpenSSL.writeInt (bio, 6);
OpenSSL.writeString (bio, s))
| QAptExists s => (OpenSSL.writeInt (bio, 6);
OpenSSL.writeString (bio, s))
@@
-131,7
+133,9
@@
fun recvQuery bio =
| 2 => Option.map QFtp (OpenSSL.readString bio)
| 3 => Option.map QTrustedPath (OpenSSL.readString bio)
| 4 => Option.map QSocket (OpenSSL.readString bio)
| 2 => Option.map QFtp (OpenSSL.readString bio)
| 3 => Option.map QTrustedPath (OpenSSL.readString bio)
| 4 => Option.map QSocket (OpenSSL.readString bio)
- | 5 => Option.map QFirewall (OpenSSL.readString bio)
+ | 5 => (case ((OpenSSL.readString bio), (OpenSSL.readString bio)) of
+ (SOME node, SOME user) => SOME (QFirewall { node = node, user = user })
+ | _ => NONE)
| 6 => Option.map QAptExists (OpenSSL.readString bio)
| _ => NONE)
| NONE => NONE
| 6 => Option.map QAptExists (OpenSSL.readString bio)
| _ => NONE)
| NONE => NONE
@@
-242,6
+246,9
@@
fun send (bio, m) =
| MsgReUsers => OpenSSL.writeInt (bio, 41)
| MsgVmailChanged => OpenSSL.writeInt (bio, 42)
| MsgFirewallRegen => OpenSSL.writeInt (bio, 43)
| 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
fun checkIt v =
case v of
@@
-357,6
+364,9
@@
fun recv bio =
| 41 => SOME MsgReUsers
| 42 => SOME MsgVmailChanged
| 43 => SOME MsgFirewallRegen
| 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
| _ => NONE)
end