diff options
Diffstat (limited to 'main/uwsgi/0002-core-socket-move-socket-buffer-size-setting-to-creat.patch')
-rw-r--r-- | main/uwsgi/0002-core-socket-move-socket-buffer-size-setting-to-creat.patch | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/main/uwsgi/0002-core-socket-move-socket-buffer-size-setting-to-creat.patch b/main/uwsgi/0002-core-socket-move-socket-buffer-size-setting-to-creat.patch deleted file mode 100644 index 88cb2b73a4..0000000000 --- a/main/uwsgi/0002-core-socket-move-socket-buffer-size-setting-to-creat.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 32b71268365456f246d20212e0acf63bfdf9ffe6 Mon Sep 17 00:00:00 2001 -From: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> -Date: Wed, 1 Jan 2014 23:46:02 +0200 -Subject: [PATCH 2/5] core/socket: move socket buffer size setting to - create_server_socket - ---- - core/socket.c | 58 ++++++++++++++++++++++------------------------------------ - 1 file changed, 22 insertions(+), 36 deletions(-) - -diff --git a/core/socket.c b/core/socket.c -index 7e47dc0..ee63b98 100644 ---- a/core/socket.c -+++ b/core/socket.c -@@ -81,7 +81,29 @@ static int create_server_socket(int domain, int type) { - if (serverfd < 0) { - uwsgi_error("socket()"); - uwsgi_nuclear_blast(); -+ return -1; -+ } -+ -+ if (type == SOCK_STREAM) { -+ if (uwsgi.so_sndbuf) { -+ socklen_t sndbuf = (socklen_t) uwsgi.so_sndbuf; -+ if (setsockopt(serverfd, SOL_SOCKET, SO_SNDBUF, &sndbuf, sizeof(socklen_t)) < 0) { -+ uwsgi_error("SO_SNDBUF setsockopt()"); -+ uwsgi_nuclear_blast(); -+ return -1; -+ } -+ } -+ -+ if (uwsgi.so_rcvbuf) { -+ socklen_t rcvbuf = (socklen_t) uwsgi.so_rcvbuf; -+ if (setsockopt(serverfd, SOL_SOCKET, SO_RCVBUF, &rcvbuf, sizeof(socklen_t)) < 0) { -+ uwsgi_error("SO_RCVBUF setsockopt()"); -+ uwsgi_nuclear_blast(); -+ return -1; -+ } -+ } - } -+ - return serverfd; - } - -@@ -157,24 +179,6 @@ int bind_to_unix(char *socket_name, int listen_queue, int chmod_socket, int abst - uwsgi_log("setting abstract socket mode (warning: only Linux supports this)\n"); - } - -- if (uwsgi.so_sndbuf) { -- socklen_t sndbuf = (socklen_t) uwsgi.so_sndbuf; -- if (setsockopt(serverfd, SOL_SOCKET, SO_SNDBUF, &sndbuf, sizeof(socklen_t)) < 0) { -- uwsgi_error("SO_SNDBUF setsockopt()"); -- uwsgi_nuclear_blast(); -- return -1; -- } -- } -- -- if (uwsgi.so_rcvbuf) { -- socklen_t rcvbuf = (socklen_t) uwsgi.so_rcvbuf; -- if (setsockopt(serverfd, SOL_SOCKET, SO_RCVBUF, &rcvbuf, sizeof(socklen_t)) < 0) { -- uwsgi_error("SO_RCVBUF setsockopt()"); -- uwsgi_nuclear_blast(); -- return -1; -- } -- } -- - uws_addr->sun_family = AF_UNIX; - if (socket_name[0] == '@') { - memcpy(uws_addr->sun_path + abstract_socket, socket_name + 1, UMIN(strlen(socket_name + 1), 101)); -@@ -668,24 +672,6 @@ int bind_to_tcp(char *socket_name, int listen_queue, char *tcp_port) { - serverfd = create_server_socket(family, SOCK_STREAM); - if (serverfd < 0) return -1; - -- if (uwsgi.so_sndbuf) { -- socklen_t sndbuf = (socklen_t) uwsgi.so_sndbuf; -- if (setsockopt(serverfd, SOL_SOCKET, SO_SNDBUF, &sndbuf, sizeof(socklen_t)) < 0) { -- uwsgi_error("SO_SNDBUF setsockopt()"); -- uwsgi_nuclear_blast(); -- return -1; -- } -- } -- -- if (uwsgi.so_rcvbuf) { -- socklen_t rcvbuf = (socklen_t) uwsgi.so_rcvbuf; -- if (setsockopt(serverfd, SOL_SOCKET, SO_RCVBUF, &rcvbuf, sizeof(socklen_t)) < 0) { -- uwsgi_error("SO_RCVBUF setsockopt()"); -- uwsgi_nuclear_blast(); -- return -1; -- } -- } -- - if (setsockopt(serverfd, SOL_SOCKET, SO_REUSEADDR, (const void *) &reuse, sizeof(int)) < 0) { - uwsgi_error("SO_REUSEADDR setsockopt()"); - uwsgi_nuclear_blast(); --- -1.8.4.2 - |