Skip to content

Commit

Permalink
Merge pull request #169 from dsugisawa-mixi/master
Browse files Browse the repository at this point in the history
fix build error with nginx 1.14.2
  • Loading branch information
yaoweibin authored Jan 14, 2019
2 parents 121c026 + 1c48f1d commit b8a3028
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions ngx_tcp_core_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
#include <ngx_tcp.h>
#include <nginx.h>

#ifndef NGX_CONF_MULTI
#define NGX_CONF_MULTI 0
#endif


static void *ngx_tcp_core_create_main_conf(ngx_conf_t *cf);
static void *ngx_tcp_core_create_srv_conf(ngx_conf_t *cf);
Expand Down Expand Up @@ -480,8 +484,11 @@ ngx_tcp_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
port = sin->sin_port;
break;
}

#if defined(nginx_version) && nginx_version >= 1014002
if (ngx_memcmp(ls[i].sockaddr + off, ((char*)&u.sockaddr) + off, len) != 0) {
#else
if (ngx_memcmp(ls[i].sockaddr + off, u.sockaddr + off, len) != 0) {
#endif
continue;
}

Expand All @@ -501,8 +508,11 @@ ngx_tcp_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)

ngx_memzero(ls, sizeof(ngx_tcp_listen_t));

#if defined(nginx_version) && nginx_version >= 1014002
ngx_memcpy(ls->sockaddr, &u.sockaddr, u.socklen);
#else
ngx_memcpy(ls->sockaddr, u.sockaddr, u.socklen);

#endif
ls->socklen = u.socklen;
ls->wildcard = u.wildcard;
ls->ctx = cf->ctx;
Expand Down

0 comments on commit b8a3028

Please sign in to comment.