* Make pa_parse_address recognize Unix socket addresses with
Windows-style absolute paths.
* Treat WASEINVAL as a stale socket.
* Make HAVE_AF_UNIX in config templates recognize winsock2.h.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/546>
default_conf.merge_from(cdata)
default_conf.set('PA_BINARY', cdata.get_unquoted('PA_BINARY'))
default_conf.set('PA_SOEXT', cdata.get_unquoted('PA_SOEXT'))
-default_conf.set10('HAVE_AF_UNIX', cc.has_header('sys/un.h'))
+default_conf.set10('HAVE_AF_UNIX', cc.has_header('sys/un.h') ? true : cc.has_header('winsock2.h'))
default_conf.set10('OS_IS_WIN32', host_machine.system() == 'windows')
default_conf.set10('HAVE_MKFIFO', cc.has_function('mkfifo'))
} else
p = name;
+#ifndef OS_IS_WIN32
if (*p == '/')
ret_p->type = PA_PARSED_ADDRESS_UNIX;
+#else
+ if (strlen(p) >= 3 && p[1] == ':' && p[2] == '\\' && ((p[0] >= 'A' && p[0] <= 'Z') || (p[0] >= 'a' && p[0] <= 'z')))
+ ret_p->type = PA_PARSED_ADDRESS_UNIX;
+#endif
else if (pa_startswith(p, "unix:")) {
ret_p->type = PA_PARSED_ADDRESS_UNIX;
p += sizeof("unix:")-1;
if (errno == ECONNREFUSED)
ret = 1;
#else
- if (WSAGetLastError() == WSAECONNREFUSED)
+ if (WSAGetLastError() == WSAECONNREFUSED || WSAGetLastError() == WSAEINVAL)
ret = 1;
#endif
} else