Update of /cvsroot/monetdb/sql/src/backends/monet5/merovingian
In directory 
23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv3143/src/backends/monet5/merovingian

Modified Files:
        merovingian_controlrunner.c 
Log Message:
propagated changes of Tuesday Sep 29 2009
from the Nov2009 branch to the development trunk

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/09/29 - mr-meltdown:
        src/backends/monet5/merovingian/merovingian_controlrunner.c,1.26.2.1
group multi-line response commands
Fix: do not keep waiting for data in case an error occurrs in multi-line
responses, always disconnect afterwards
Fix: have defaults being sent from the server, such that they are not
taken from the local host (see changes to monetdb.c)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/09/29 - mr-meltdown:
        src/backends/monet5/merovingian/merovingian_controlrunner.c,1.26.2.2
say bye to vanderdecken, he's a bit misplaced here, use the far more 
descriptive #all here
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Index: merovingian_controlrunner.c
===================================================================
RCS file: 
/cvsroot/monetdb/sql/src/backends/monet5/merovingian/merovingian_controlrunner.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- merovingian_controlrunner.c 25 Sep 2009 14:06:50 -0000      1.26
+++ merovingian_controlrunner.c 29 Sep 2009 10:59:25 -0000      1.27
@@ -413,43 +413,6 @@
                                                len = snprintf(buf2, 
sizeof(buf2), "OK\n");
                                                send(msgsock, buf2, len, 0);
                                        }
-                               } else if (strcmp(p, "get") == 0) {
-                                       confkeyval *props = getDefaultProps();
-                                       char *pbuf;
-
-                                       if ((e = SABAOTHgetStatus(&stats, q)) 
!= MAL_SUCCEED) {
-                                               len = snprintf(buf2, 
sizeof(buf2),
-                                                               "internal 
error, please review the logs\n");
-                                               send(msgsock, buf2, len, 0);
-                                               Mfprintf(_mero_ctlerr, "%s: 
get: SABAOTHgetStatus: "
-                                                               "%s\n", origin, 
e);
-                                               freeErr(e);
-                                               continue;
-                                       }
-                                       if (stats == NULL) {
-                                               Mfprintf(_mero_ctlerr, "%s: 
received get signal for "
-                                                               "unknown 
database: %s\n", origin, q);
-                                               len = snprintf(buf2, 
sizeof(buf2),
-                                                               "unknown 
database: %s\n", q);
-                                               send(msgsock, buf2, len, 0);
-                                               continue;
-                                       }
-
-                                       /* from here we'll always succeed, even 
if we don't
-                                        * send anything */
-                                       len = snprintf(buf2, sizeof(buf2), 
"OK\n");
-                                       send(msgsock, buf2, len, 0);
-                               
-                                       readProps(props, stats->path);
-                                       writePropsBuf(props, &pbuf);
-                                       send(msgsock, pbuf, strlen(pbuf), 0);
-                                       freeConfFile(props);
-                                       GDKfree(props);
-                                       SABAOTHfreeStatus(&stats);
-
-                                       Mfprintf(_mero_ctlout, "%s: served 
property list for "
-                                                       "database '%s'\n", 
origin, q);
-                                       break;
                                } else if (strncmp(p, "name=", strlen("name=")) 
== 0) {
                                        char *e;
 
@@ -555,14 +518,68 @@
                                        }
                                        len = snprintf(buf2, sizeof(buf2), 
"OK\n");
                                        send(msgsock, buf2, len, 0);
-                               } else if (strcmp(p, "status") == 0 || (
-                                                       strcmp(q, "flyghende") 
== 0 &&
-                                                       strcmp(p, "hollander") 
== 0 && (q = NULL) == NULL))
-                               {
+
+       /* comands below this point are multi line and hence you can't
+        * combine them, so they disconnect the client afterwards */
+                               } else if (strcmp(p, "get") == 0) {
+                                       confkeyval *props = getDefaultProps();
+                                       char *pbuf;
+
+                                       if (strcmp(q, "#defaults") == 0) {
+                                               /* send defaults to client */
+                                               len = snprintf(buf2, 
sizeof(buf2), "OK\n");
+                                               send(msgsock, buf2, len, 0);
+                                               writePropsBuf(_mero_props, 
&pbuf);
+                                               send(msgsock, pbuf, 
strlen(pbuf), 0);
+                                               GDKfree(props);
+
+                                               Mfprintf(_mero_ctlout, "%s: 
served default property "
+                                                               "list\n", 
origin);
+                                               break;
+                                       }
+
+                                       if ((e = SABAOTHgetStatus(&stats, q)) 
!= MAL_SUCCEED) {
+                                               len = snprintf(buf2, 
sizeof(buf2),
+                                                               "internal 
error, please review the logs\n");
+                                               send(msgsock, buf2, len, 0);
+                                               Mfprintf(_mero_ctlerr, "%s: 
get: SABAOTHgetStatus: "
+                                                               "%s\n", origin, 
e);
+                                               freeErr(e);
+                                               break;
+                                       }
+                                       if (stats == NULL) {
+                                               Mfprintf(_mero_ctlerr, "%s: 
received get signal for "
+                                                               "unknown 
database: %s\n", origin, q);
+                                               len = snprintf(buf2, 
sizeof(buf2),
+                                                               "unknown 
database: %s\n", q);
+                                               send(msgsock, buf2, len, 0);
+                                               break;
+                                       }
+
+                                       /* from here we'll always succeed, even 
if we don't
+                                        * send anything */
+                                       len = snprintf(buf2, sizeof(buf2), 
"OK\n");
+                                       send(msgsock, buf2, len, 0);
+                               
+                                       readProps(props, stats->path);
+                                       writePropsBuf(props, &pbuf);
+                                       send(msgsock, pbuf, strlen(pbuf), 0);
+                                       freeConfFile(props);
+                                       GDKfree(props);
+                                       SABAOTHfreeStatus(&stats);
+
+                                       Mfprintf(_mero_ctlout, "%s: served 
property list for "
+                                                       "database '%s'\n", 
origin, q);
+                                       break;
+                               } else if (strcmp(p, "status") == 0) {
                                        sabdb *stats;
                                        sabdb *topdb;
                                        char *sdb;
 
+                                       if (strcmp(q, "#all") == 0)
+                                               /* list all */
+                                               q = NULL;
+
                                        /* return a list of sabdb structs for 
our local
                                         * databases */
                                        if ((e = SABAOTHgetStatus(&stats, q)) 
!= MAL_SUCCEED) {
@@ -572,7 +589,7 @@
                                                Mfprintf(_mero_ctlerr, "%s: 
status: SABAOTHgetStatus: "
                                                                "%s\n", origin, 
e);
                                                freeErr(e);
-                                               continue;
+                                               break;
                                        }
                                        len = snprintf(buf2, sizeof(buf2), 
"OK\n");
                                        send(msgsock, buf2, len, 0);
@@ -595,9 +612,6 @@
                                        }
 
                                        SABAOTHfreeStatus(&topdb);
-
-                                       /* because this command is multi line, 
you can't
-                                        * combine it, disconnect the client */
                                        break;
                                } else if (strcmp(q, "anelosimus") == 0 &&
                                                strcmp(p, "eximius") == 0)
@@ -626,9 +640,6 @@
 
                                        Mfprintf(_mero_ctlout, "%s: served 
neighbour list\n",
                                                        origin);
-
-                                       /* because this command is multi line, 
you can't
-                                        * combine it, disconnect the client */
                                        break;
                                } else {
                                        Mfprintf(_mero_ctlerr, "%s: unknown 
control command: %s\n",


------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to