diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2019-06-01 22:51:50 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2019-06-01 22:51:50 +0300 |
commit | 20eceebc77378727c836f846f8432d20c0ec4ac7 (patch) | |
tree | c03d7ecf6f0291d6402d2763421cd2dca04a3f9a /src/microhttpd/daemon.c | |
parent | 2c93aa35f75d41aac2dd19bbb3e3935c88a3b80a (diff) | |
download | libmicrohttpd-20eceebc77378727c836f846f8432d20c0ec4ac7.tar.gz libmicrohttpd-20eceebc77378727c836f846f8432d20c0ec4ac7.zip |
Properly handle port detection if AF_UNIX socket is used on *BSD, macOS
Diffstat (limited to 'src/microhttpd/daemon.c')
-rw-r--r-- | src/microhttpd/daemon.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 7d186025..a5051c01 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -6124,6 +6124,14 @@ MHD_start_daemon_va (unsigned int flags, | |||
6124 | _("Failed to get listen port number (`struct sockaddr_storage` too small!?)\n")); | 6124 | _("Failed to get listen port number (`struct sockaddr_storage` too small!?)\n")); |
6125 | #endif /* HAVE_MESSAGES */ | 6125 | #endif /* HAVE_MESSAGES */ |
6126 | } | 6126 | } |
6127 | #ifndef __linux__ | ||
6128 | else if (0 == addrlen) | ||
6129 | { | ||
6130 | /* Many non-Linux-based platforms return zero addrlen | ||
6131 | * for AF_UNIX sockets */ | ||
6132 | daemon->port = 0; /* special value for UNIX domain sockets */ | ||
6133 | } | ||
6134 | #endif /* __linux__ */ | ||
6127 | #endif /* MHD_POSIX_SOCKETS */ | 6135 | #endif /* MHD_POSIX_SOCKETS */ |
6128 | else | 6136 | else |
6129 | { | 6137 | { |