Changeset: f77371879cbe for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f77371879cbe
Modified Files:
        MonetDB5/src/modules/mal/remote.mx
        clients/src/mapilib/Mapi.mx
Branch: default
Log Message:

RMTresolve: fix connect to upstream merovingian

Make sure we connect to the same merovingian as we detected that was
running.  Use UNIX socket connection, and fix mapi_resolve to actually
deal with that.


diffs (41 lines):

diff -r 0d003f5bfc68 -r f77371879cbe MonetDB5/src/modules/mal/remote.mx
--- a/MonetDB5/src/modules/mal/remote.mx        Tue Dec 21 13:28:05 2010 +0100
+++ b/MonetDB5/src/modules/mal/remote.mx        Tue Dec 21 15:07:55 2010 +0100
@@ -216,8 +216,6 @@
        int fd;
        char **redirs;
        char **or;
-       str tmp;
-       int port;
 
        if (pat == NULL || *pat == NULL || strcmp(*pat, (str)str_nil) == 0)
                throw(ILLARG, "remote.resolve",
@@ -242,14 +240,8 @@
        if (list == NULL)
                throw(MAL, "remote.resolve", MAL_MALLOC_FAIL);
 
-       tmp = GDKgetenv("mero_port");
-       port = 0;
-       if (tmp != NULL)
-               port = atoi(tmp);
-       if (port == 0)
-               port = 50000;  /* hardcoded default from merovingian.c */
-       gethostname(path, 8096);
-       or = redirs = mapi_resolve(path, port, *pat);
+       snprintf(path, 8096, "%s/mapi_socket", GDKgetenv("gdk_dbfarm"));
+       or = redirs = mapi_resolve(path, 0, *pat);
 
        if (redirs == NULL)
                throw(MAL, "remote.resolve", "unknown failure when resolving 
pattern");
diff -r 0d003f5bfc68 -r f77371879cbe clients/src/mapilib/Mapi.mx
--- a/clients/src/mapilib/Mapi.mx       Tue Dec 21 13:28:05 2010 +0100
+++ b/clients/src/mapilib/Mapi.mx       Tue Dec 21 15:07:55 2010 +0100
@@ -3010,7 +3010,7 @@
        Mapi mid;
 
        /* if it doesn't make sense, don't try to crash */
-       if (host == NULL || port <= 0 || pattern == NULL)
+       if (host == NULL || (host[0] != '/' && port <= 0) || pattern == NULL)
                return NULL;
 
        mid = mapi_mapi(host, port, "mero", "mero", "resolve", pattern);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to