diff --git a/plugins/fastrouter/fastrouter.c b/plugins/fastrouter/fastrouter.c index 1424b749..26acb840 100644 --- a/plugins/fastrouter/fastrouter.c +++ b/plugins/fastrouter/fastrouter.c @@ -437,7 +437,7 @@ void fastrouter_loop() { iov[1].iov_len = fr_session->uh.pktsize; // fd passing: PERFORMANCE EXTREME BOOST !!! - if (fr_session->pass_fd) { + if (fr_session->pass_fd && !uwsgi.no_fd_passing) { msg.msg_name = NULL; msg.msg_namelen = 0; msg.msg_iov = iov; diff --git a/plugins/http/http.c b/plugins/http/http.c index dc091cc1..dd28eeeb 100644 --- a/plugins/http/http.c +++ b/plugins/http/http.c @@ -710,7 +710,7 @@ void http_loop() { #ifndef __sun__ // fd passing: PERFORMANCE EXTREME BOOST !!! - if (uhttp_session->pass_fd && !uhttp_session->remains) { + if (uhttp_session->pass_fd && !uhttp_session->remains && !uwsgi.no_fd_passing) { msg.msg_name = NULL; msg.msg_namelen = 0; msg.msg_iov = uhttp_session->iov; diff --git a/proto/uwsgi.c b/proto/uwsgi.c index ddf35bdb..e3e3cdd0 100644 --- a/proto/uwsgi.c +++ b/proto/uwsgi.c @@ -84,6 +84,9 @@ int uwsgi_proto_uwsgi_parser(struct wsgi_request *wsgi_req) { return UWSGI_OK; #endif + if (uwsgi.no_fd_passing) + return UWSGI_OK; + cmsg = CMSG_FIRSTHDR(&wsgi_req->msg); while (cmsg != NULL) { if (cmsg->cmsg_len == CMSG_LEN(sizeof(int)) && cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type && SCM_RIGHTS) { diff --git a/uwsgi.c b/uwsgi.c index d9d69d3c..885b56ed 100644 --- a/uwsgi.c +++ b/uwsgi.c @@ -77,6 +77,7 @@ static struct option long_base_options[] = { {"reaper", no_argument, 0, 'r'}, {"max-requests", required_argument, 0, 'R'}, {"socket-timeout", required_argument, 0, 'z'}, + {"no-fd-passing", no_argument, &uwsgi.no_fd_passing, 1}, {"sharedarea", required_argument, 0, 'A'}, {"cache", required_argument, 0, LONG_ARGS_CACHE}, {"cache-blocksize", required_argument, 0, LONG_ARGS_CACHE_BLOCKSIZE}, diff --git a/uwsgi.h b/uwsgi.h index 84113848..0819846c 100644 --- a/uwsgi.h +++ b/uwsgi.h @@ -843,6 +843,8 @@ struct uwsgi_server { int master_as_root; int die_on_term; + int no_fd_passing; + time_t current_time; uint64_t master_cycles;