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

Modified Files:
        merovingian.c 
Log Message:
first, wrong, implementation of shared property in merovingian


U merovingian.c
Index: merovingian.c
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian/merovingian.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- merovingian.c       4 Jun 2009 20:38:55 -0000       1.12
+++ merovingian.c       6 Jun 2009 20:44:28 -0000       1.13
@@ -1592,6 +1592,8 @@
        int forceannc = 0;
        sabdb *orig;
        sabdb *stats;
+       confkeyval *ckv;
+       confkeyval *kv;
        err e;
        remotedb rdb;
        remotedb prv;
@@ -1638,6 +1640,8 @@
                fprintf(stderr, "HELO message: error while sending "
                                "message: %s\n", strerror(errno));
 
+       ckv = getDefaultProps();
+
        /* main loop */
        while (_keepListening == 1) {
                now = time(NULL);
@@ -1656,22 +1660,24 @@
                                return;
                        }
 
-                       orig = stats;
-                       while (stats != NULL) {
-                               /* craft ANNC messages for each db */
-                               snprintf(buf, 512, "ANNC %s 
mapi:monetdb://%s:%hu/ %d",
-                                               stats->dbname,
-                                               lhost,
-                                               ntohs(((struct sockaddr_in 
*)&local)->sin_port),
-                                               discoveryttl + 60);
-
-                               c = strlen(buf) + 1;
-                               if (sendto(bcs, buf, c, 0,
-                                                       (struct sockaddr 
*)&brdcst, sizeof(brdcst)) != c)
-                                       fprintf(stderr, "ANNC message: error 
while sending "
-                                                       "message: %s\n", 
strerror(errno));
+                       for (orig = stats; stats != NULL; stats = stats->next) {
+                               readProps(ckv, stats->path);
+                               kv = findConfKey(ckv, "shared");
+                               if (kv->val == NULL || strcmp(kv->val, "no") != 
0) {
+                                       /* craft ANNC messages for each db */
+                                       snprintf(buf, 512, "ANNC %s 
mapi:monetdb://%s:%hu/ %d",
+                                                       stats->dbname,
+                                                       lhost,
+                                                       ntohs(((struct 
sockaddr_in *)&local)->sin_port),
+                                                       discoveryttl + 60);
 
-                               stats = stats->next;
+                                       c = strlen(buf) + 1;
+                                       if (sendto(bcs, buf, c, 0,
+                                                               (struct 
sockaddr *)&brdcst, sizeof(brdcst)) != c)
+                                               fprintf(stderr, "ANNC message: 
error while sending "
+                                                               "message: 
%s\n", strerror(errno));
+                               }
+                               freeConfFile(ckv);
                        }
 
                        if (orig != NULL)
@@ -1882,6 +1888,7 @@
        if (orig != NULL)
                SABAOTHfreeStatus(&orig);
 
+       GDKfree(ckv); /* can make ckv static and reuse it all the time */
        close(bcs);
 }
 


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to