Changeset: c931022d0670 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c931022d0670
Modified Files:
        tools/merovingian/utils/control.c
Branch: default
Log Message:

monetdb: try to avoid unsupported merovingian server errors

Read a bit clumpsy to work around blockmode's two length bytes coming in
a separate package from the actual message.  This seems to solve
spurious (and random) "unsupported merovingian server" errors when
connecting to a remote merovingian.


diffs (17 lines):

diff --git a/tools/merovingian/utils/control.c 
b/tools/merovingian/utils/control.c
--- a/tools/merovingian/utils/control.c
+++ b/tools/merovingian/utils/control.c
@@ -100,8 +100,12 @@ char* control_send(
                        return(strdup(sbuf));
                }
                
+               /* try reading length */
+               len = recv(sock, sbuf, 2, 0);
+               if (len == 2)
+                       len += recv(sock, sbuf + len, sizeof(sbuf) - len, 0);
                /* perform login ritual */
-               if ((len = recv(sock, sbuf, sizeof(sbuf), 0)) <= 0) {
+               if (len <= 0) {
                        snprintf(sbuf, sizeof(sbuf), "no response from 
merovingian");
                        return(strdup(sbuf));
                }
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to