Update of /cvsroot/monetdb/sql/src/backends/monet5
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv11537

Modified Files:
        merovingian.mx 
Log Message:
Merovingian now sends a list of discovered databases (tested with nc)

% nc -U $INSTALL_DIR/var/MonetDB5/dbfarm/.merovingian_control
anelosimus eximius
sdss    mapi:monetdb://tweek.ins.cwi.nl:50000/



U merovingian.mx
Index: merovingian.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian.mx,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- merovingian.mx      30 Aug 2008 10:52:12 -0000      1.53
+++ merovingian.mx      30 Aug 2008 11:17:12 -0000      1.54
@@ -805,19 +805,6 @@
        return(NO_ERR);
 }
 
-static void
-listDiscoveries(stream *fout)
-{
-       remotedb rdb;
-
-       rdb = _merovingian_remotedbs;
-       while (rdb != NULL) {
-               stream_printf(fout, "%s\t%s\t%d\n",
-                               rdb->dbname, rdb->conn, rdb->ttl);
-               rdb = rdb->next;
-       }
-}
-
 static err
 handleClient(int sock)
 {
@@ -945,15 +932,6 @@
                        *s = 0;
        }
 
-       if (strcmp(lang, "eximius") == 0) {
-               /* return a list of remote databases from our Aranita */
-               listDiscoveries(fout);
-               stream_flush(fout);
-               close_stream(fout);
-               close_stream(fdin);
-               return(NO_ERR);
-       }
-
        if (*database == '\0') {
                /* we need to have a database, if we haven't gotten one,
                 * complain */
@@ -1363,6 +1341,22 @@
                                                                "%s is not 
controlled by merovingian\n", q);
                                                send(msgsock, buf2, len, 0);
                                        }
+                               } else if (strcmp(q, "anelosimus") == 0 &&
+                                               strcmp(p, "eximius") == 0)
+                               {
+                                       /* return a list of remote databases 
from our Aranita */
+                                       remotedb rdb;
+
+                                       rdb = _merovingian_remotedbs;
+                                       while (rdb != NULL) {
+                                               len = snprintf(buf2, 
sizeof(buf2), "%s\t%s\n",
+                                                               rdb->dbname, 
rdb->conn);
+                                               send(msgsock, buf2, len, 0);
+                                               rdb = rdb->next;
+                                       }
+                                       /* because this command is multi line, 
you can't
+                                        * combine it, disconnect the client */
+                                       break;
                                } else {
                                        fprintf(stderr, "unknown control 
command: %s", p);
                                        len = snprintf(buf2, sizeof(buf2),


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to