Changeset: 8e85b7cff237 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8e85b7cff237
Modified Files:
        clients/mapilib/connect.c
        clients/mapilib/parseurl.c
Branch: monetdburl
Log Message:

Need to parse mapi:merovingian redirects


diffs (58 lines):

diff --git a/clients/mapilib/connect.c b/clients/mapilib/connect.c
--- a/clients/mapilib/connect.c
+++ b/clients/mapilib/connect.c
@@ -150,9 +150,9 @@ establish_connection(Mapi mid)
                // connection.
                if (!mid->connected) {
                        msg = connect_socket(mid);
+                       if (msg != MOK)
+                               return msg;
                }
-               if (msg != MOK)
-                       return msg;
                msg = mapi_handshake(mid);
        }
 
diff --git a/clients/mapilib/parseurl.c b/clients/mapilib/parseurl.c
--- a/clients/mapilib/parseurl.c
+++ b/clients/mapilib/parseurl.c
@@ -428,12 +428,39 @@ parse_classic_unix(msettings *mp, scanne
                        return false;
        }
 
+       // should have consumed everything
+       if (sc->c != '\0' && sc-> c != '#')
+               return unexpected(sc);
+
+       return true;
+}
+
+static bool
+parse_classic_merovingian(msettings *mp, scanner *sc)
+{
+       if (sc->c == '?') {
+               if (!parse_classic_query_parameters(mp, sc))
+                       return false;
+       }
+
+       // should have consumed everything
+       if (sc->c != '\0' && sc-> c != '#')
+               return unexpected(sc);
+
        return true;
 }
 
 static bool
 parse_classic(msettings *mp, scanner *sc)
 {
+       // we accept mapi:merovingian but we don't want to
+       // expose that we do
+       if (sc->p[0] == 'm' && sc->p[1] == 'e') {
+               if (!consume(sc, "merovingian://proxy"))
+                       return false;
+               return parse_classic_merovingian(mp, sc);
+       }
+
        if (!consume(sc, "monetdb://"))
                return false;
 
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to