Merge pull request #186 from chadwill/master

Nginx: bugfix, shouldnot pollute `socket type`
This commit is contained in:
logwang 2018-04-10 19:18:33 +08:00 committed by GitHub
commit 559f532025
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -44,12 +44,13 @@ ngx_event_connect_peer(ngx_peer_connection_t *pc)
to explicitly call the needed socket() function. to explicitly call the needed socket() function.
*/ */
if (!pc->belong_to_host) { if (!pc->belong_to_host) {
type |= SOCK_FSTACK; s = ngx_socket(pc->sockaddr->sa_family, type | SOCK_FSTACK, 0);
} else {
s = ngx_socket(pc->sockaddr->sa_family, type, 0);
} }
#endif #else
s = ngx_socket(pc->sockaddr->sa_family, type, 0); s = ngx_socket(pc->sockaddr->sa_family, type, 0);
#endif
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, pc->log, 0, "%s socket %d", ngx_log_debug2(NGX_LOG_DEBUG_EVENT, pc->log, 0, "%s socket %d",
(type == SOCK_STREAM) ? "stream" : "dgram", s); (type == SOCK_STREAM) ? "stream" : "dgram", s);