From 875007d15f4a73cd2c1078d821b16008f34a8abf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Tue, 30 Oct 2018 16:25:54 +0100 Subject: [PATCH] afb-socket: Relax requirement of tcp ending slash MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The uri for tcp was requiring a slash (/) after the port. This change allows to not provide that slash. This is usefull for future implementation of HTTP server selection. Change-Id: I0a76d167065258d242845579b7c8728eefcc359f Signed-off-by: José Bollo --- src/afb-socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/afb-socket.c b/src/afb-socket.c index 63de2cf2..ee3cfbe2 100644 --- a/src/afb-socket.c +++ b/src/afb-socket.c @@ -165,7 +165,7 @@ static int open_tcp(const char *spec, int server) struct addrinfo hint, *rai, *iai; /* scan the uri */ - tail = strchr(spec, '/'); + tail = strchrnul(spec, '/'); service = strchr(spec, ':'); if (tail == NULL || service == NULL || tail < service) { errno = EINVAL; -- 2.16.6