mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-07 06:06:08 +00:00
added --freebind option (Linux only)
This commit is contained in:
@@ -500,6 +500,17 @@ int bind_to_tcp(char *socket_name, int listen_queue, char *tcp_port) {
|
||||
uwsgi_nuclear_blast();
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
#ifdef IP_FREEBIND
|
||||
if (uwsgi.freebind) {
|
||||
if (setsockopt(serverfd, SOL_IP, IP_FREEBIND, (const void *) &uwsgi.freebind, sizeof(int)) < 0) {
|
||||
uwsgi_error("setsockopt()");
|
||||
uwsgi_nuclear_blast();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (uwsgi.reuse_port) {
|
||||
#ifdef SO_REUSEPORT
|
||||
if (setsockopt(serverfd, SOL_SOCKET, SO_REUSEPORT, (const void *) &uwsgi.reuse_port, sizeof(int)) < 0) {
|
||||
|
||||
@@ -57,6 +57,9 @@ static struct option long_base_options[] = {
|
||||
{"abstract-socket", no_argument, 0, 'a'},
|
||||
{"chmod-socket", optional_argument, 0, 'C'},
|
||||
{"chown-socket", required_argument, 0, LONG_ARGS_CHOWN_SOCKET},
|
||||
#ifdef __linux__
|
||||
{"freebind", no_argument, &uwsgi.freebind, 1},
|
||||
#endif
|
||||
{"map-socket", required_argument, 0, LONG_ARGS_MAP_SOCKET},
|
||||
{"chmod", optional_argument, 0, 'C'},
|
||||
#ifdef UWSGI_THREADING
|
||||
|
||||
Reference in New Issue
Block a user