From f91cef843e9778d81df9e9650e039d5085d54935 Mon Sep 17 00:00:00 2001 From: "Wesley W. Terpstra" <w.terpstra@gsi.de> Date: Thu, 16 Feb 2012 13:18:49 +0000 Subject: [PATCH] Ignore protocol case and trailing slash --- api/transport/posix-ip.c | 4 ++-- api/transport/ssh.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/transport/posix-ip.c b/api/transport/posix-ip.c index b45d147..d9246fd 100644 --- a/api/transport/posix-ip.c +++ b/api/transport/posix-ip.c @@ -89,14 +89,14 @@ socklen_t eb_posix_ip_resolve(const char* prefix, const char* address, int type, const char* port, *slash; len = strlen(prefix); - if (strncmp(address, prefix, len)) + if (strncasecmp(address, prefix, len)) return -1; address += len; if (strlen(address) >= sizeof(host)-1) return -1; slash = strchr(address, '/'); - if (slash == 0) { + if (slash == 0 || *(slash+1) == 0) { strcpy(host, address); port = EB_DEFAULT_PORT_STR; } else { diff --git a/api/transport/ssh.c b/api/transport/ssh.c index bad77c1..a02c73f 100644 --- a/api/transport/ssh.c +++ b/api/transport/ssh.c @@ -60,14 +60,14 @@ eb_status_t eb_ssh_connect(struct eb_transport* transportp, struct eb_link* link link = (struct eb_ssh_link*)linkp; - if (strncmp(address, "ssh/", 4)) + if (strncasecmp(address, "ssh/", 4)) return EB_ADDRESS; address += 4; if (strlen(address) >= sizeof(host)-1) return EB_ADDRESS; slash = strchr(address, '/'); - if (slash == 0) { + if (slash == 0 || *(slash+1) == 0) { strcpy(host, address); command = "eb_proxy"; } else { -- GitLab