Skip to content
Snippets Groups Projects
Commit 97babb50 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

If the FastCGI address starts with a '/', it's obviously a UNIX domain socket

We don't really need the "unix:" prefix now, but just leave that support in
for backward compatibility.
parent f601b1ca
Branches
Tags
No related merge requests found
......@@ -3929,7 +3929,7 @@ static SOCKET fastcgi_connect(const char *orig_path, SOCKET client_sock)
ulong val;
SOCKET sock;
if (strncmp(path, "unix:", 5) == 0) {
if (*path == '/' || strncmp(path, "unix:", 5) == 0) {
#if defined(_WIN32) && !defined(UDS_SUPPORT)
lprintf(LOG_ERR, "%04d UNIX DOMAIN SOCKETS ARE NOT SUPPORTED in %s", client_sock, __FUNCTION__);
return INVALID_SOCKET;
......@@ -3945,7 +3945,10 @@ static SOCKET fastcgi_connect(const char *orig_path, SOCKET client_sock)
}
addr.sun_family = AF_UNIX;
SAFECOPY(addr.sun_path, path + 5);
if(*path == '/')
SAFECOPY(addr.sun_path, path);
else
SAFECOPY(addr.sun_path, path + 5);
#ifdef SUN_LEN
addr_len = SUN_LEN(&addr);
#else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment