Update of /cvsroot/monetdb/sql/src/backends/monet5/merovingian
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4662
Modified Files:
merovingian.c merovingian_discoveryrunner.c
Log Message:
send out the controlport, if enabled at all. Needs rethinking if this doesn't
require each merovingian to be sending its control url around...
U merovingian.c
Index: merovingian.c
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian/merovingian.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- merovingian.c 23 Sep 2009 11:41:51 -0000 1.64
+++ merovingian.c 24 Sep 2009 14:15:31 -0000 1.65
@@ -157,6 +157,8 @@
static FILE *_mero_discout = NULL;
/* stream to the stderr for the neighbour discovery service */
static FILE *_mero_discerr = NULL;
+/* the port merovingian listens for TCP control commands */
+static unsigned short _mero_controlport = 0;
/* stream to the stdout for the control runner */
static FILE *_mero_ctlout = NULL;
/* stream to the stderr for the control runner */
@@ -437,7 +439,6 @@
int csock = -1;
char doproxy = 1;
unsigned short discoveryport;
- unsigned short controlport;
struct stat sb;
FILE *oerr = NULL;
pthread_mutexattr_t mta;
@@ -571,7 +572,6 @@
}
discoveryport = (unsigned short)ret;
}
- controlport = 0;
kv = findConfKey(ckv, "mero_controlport");
if (kv && kv->val != NULL) {
ret = atoi(kv->val);
@@ -579,7 +579,7 @@
Mfprintf(stderr, "invalid port number: %s\n", kv->val);
MERO_EXIT(1);
}
- controlport = (unsigned short)ret;
+ _mero_controlport = (unsigned short)ret;
}
/* where is the mserver5 binary we fork on demand? */
@@ -647,7 +647,7 @@
}
/* see if we have the passphrase if we do remote control stuff */
- if (controlport != 0) {
+ if (_mero_controlport != 0) {
struct stat statbuf;
FILE *secretf;
size_t len;
@@ -886,7 +886,7 @@
(e = openConnectionTCP(&sock, _mero_port, stdout)) ==
NO_ERR &&
(e = openConnectionUDP(&usock, discoveryport)) ==
NO_ERR &&
(e = openConnectionUNIX(&unsock, buf)) == NO_ERR &&
- (controlport == 0 || (e = openConnectionTCP(&csock,
controlport, _mero_ctlout)) == NO_ERR)
+ (_mero_controlport == 0 || (e =
openConnectionTCP(&csock, _mero_controlport, _mero_ctlout)) == NO_ERR)
)
{
pthread_t ctid = 0;
U merovingian_discoveryrunner.c
Index: merovingian_discoveryrunner.c
===================================================================
RCS file:
/cvsroot/monetdb/sql/src/backends/monet5/merovingian/merovingian_discoveryrunner.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- merovingian_discoveryrunner.c 24 Sep 2009 13:22:56 -0000 1.4
+++ merovingian_discoveryrunner.c 24 Sep 2009 14:15:32 -0000 1.5
@@ -164,7 +164,8 @@
/* start shouting around that we're here ;) request others to tell
* what databases they have */
- snprintf(buf, 512, "HELO %s:%hu", _mero_hostname, _mero_port);
+ snprintf(buf, 512, "HELO %s:%hu", _mero_hostname,
+ _mero_controlport == 0 ? _mero_port :
_mero_controlport);
broadcast(buf);
ckv = getDefaultProps();
@@ -206,9 +207,10 @@
if (orig != NULL) {
SABAOTHfreeStatus(&orig);
- } else if (forceannc == 1) {
+ } else if (forceannc == 1 && _mero_controlport != 0) {
/* no databases, yet still announce we're here
*/
- snprintf(buf, 512, "AVAI %s:%hu",
_mero_hostname, _mero_port);
+ snprintf(buf, 512, "AVAI %s:%hu",
+ _mero_hostname,
_mero_controlport);
broadcast(buf);
}
forceannc = 0;
@@ -362,8 +364,9 @@
SABAOTHfreeStatus(&orig);
/* deregister this merovingian, so it doesn't remain a stale entry */
- if (c == 0) {
- snprintf(buf, 512, "LEAV * %s:%hu", _mero_hostname, _mero_port);
+ if (c == 0 && _mero_controlport != 0) {
+ snprintf(buf, 512, "LEAV * %s:%hu",
+ _mero_hostname, _mero_controlport);
broadcast(buf);
}
------------------------------------------------------------------------------
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