Update of /cvsroot/monetdb/sql/src/backends/monet5/merovingian
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27159
Modified Files:
merovingian_controlrunner.c monetdb.c
Log Message:
Allow client to see errors also for list responses: in that case an OK is sent
as first line, if not it'll be an error
U merovingian_controlrunner.c
Index: merovingian_controlrunner.c
===================================================================
RCS file:
/cvsroot/monetdb/sql/src/backends/monet5/merovingian/merovingian_controlrunner.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- merovingian_controlrunner.c 14 Sep 2009 19:23:39 -0000 1.14
+++ merovingian_controlrunner.c 16 Sep 2009 09:37:28 -0000 1.15
@@ -288,6 +288,8 @@
len = snprintf(buf2,
sizeof(buf2), "OK\n");
send(msgsock, buf2, len, 0);
}
+ } else if (strcmp(p, "get") == 0) {
+
} else if (strncmp(p, "share=",
strlen("share=")) == 0) {
sabdb *stats;
err e;
@@ -439,6 +441,8 @@
freeErr(e);
continue;
}
+ len = snprintf(buf2, sizeof(buf2),
"OK\n");
+ send(msgsock, buf2, len, 0);
for (topdb = stats; stats != NULL;
stats = stats->next) {
/* currently never fails (just
crashes) */
@@ -466,6 +470,10 @@
pthread_mutex_lock(&_mero_remotedb_lock);
+ /* this never fails */
+ len = snprintf(buf2, sizeof(buf2),
"OK\n");
+ send(msgsock, buf2, len, 0);
+
rdb = _mero_remotedbs;
while (rdb != NULL) {
len = snprintf(buf2,
sizeof(buf2), "%s%s%s\t%s\n",
U monetdb.c
Index: monetdb.c
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian/monetdb.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- monetdb.c 16 Sep 2009 09:12:03 -0000 1.51
+++ monetdb.c 16 Sep 2009 09:37:28 -0000 1.52
@@ -461,7 +461,11 @@
orig = NULL;
if ((p = strtok(buf, "\n")) != NULL) {
- do {
+ if (strcmp(p, "OK") != 0) {
+ fprintf(stderr, "status: %s\n", p);
+ exit(2);
+ }
+ while ((p = strtok(NULL, "\n")) != NULL) {
e = SABAOTHdeserialise(&stats, &p);
if (e != NULL) {
printf("WARNING: failed to parse
response from "
@@ -474,7 +478,7 @@
} else {
w = w->next = stats;
}
- } while ((p = strtok(NULL, "\n")) != NULL);
+ }
}
}
@@ -621,7 +625,11 @@
}
if ((p = strtok(buf, "\n")) != NULL) {
- do {
+ if (strcmp(p, "OK") != 0) {
+ fprintf(stderr, "status: %s\n", p);
+ exit(2);
+ }
+ while ((p = strtok(NULL, "\n")) != NULL) {
if ((q = strchr(p, '\t')) == NULL) {
/* doesn't look correct */
printf("discover: WARNING: discarding incorrect
line: %s\n", p);
@@ -642,7 +650,7 @@
if (strlen(location) > loclen)
loclen = strlen(location);
}
- } while ((p = strtok(NULL, "\n")) != NULL);
+ }
}
free(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