Skip to content

Commit

Permalink
Merge pull request #1298 from mrpre/master
Browse files Browse the repository at this point in the history
fix stream_sni in Tengine 2.3.1
  • Loading branch information
MengqiWu authored Jun 25, 2019
2 parents e7bde9e + 26160b4 commit cae4b1c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/stream/ngx_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,8 @@ ngx_stream_add_ports(ngx_conf_t *cf, ngx_array_t *ports,
addr = port->addrs.elts;

for (i = 0; i < port->addrs.nelts; i++) {
if (ngx_cmp_sockaddr(&listen->sockaddr.sockaddr, listen->socklen,
&addr[i].opt.sockaddr.sockaddr,
if (ngx_cmp_sockaddr(listen->sockaddr, listen->socklen,
addr[i].opt.sockaddr,
addr[i].opt.socklen, 0)
!= NGX_OK)
{
Expand Down
7 changes: 4 additions & 3 deletions src/stream/ngx_stream_core_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -944,9 +944,6 @@ ngx_stream_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return "\"proxy_protocol\" parameter is incompatible with \"udp\"";
}
}
#if (NGX_STREAM_SNI)
return NGX_CONF_OK;
#endif

als = cmcf->listen.elts;

Expand All @@ -958,6 +955,10 @@ ngx_stream_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ls[n].addr_text = u.addrs[n].name;
ls[n].wildcard = ngx_inet_wildcard(ls[n].sockaddr);

#if (NGX_STREAM_SNI)
continue;
#endif

for (i = 0; i < cmcf->listen.nelts - u.naddrs + n; i++) {
if (ls[n].type != als[i].type) {
continue;
Expand Down

0 comments on commit cae4b1c

Please sign in to comment.