Skip to content

Commit ccb88c6

Browse files
authored
Merge pull request #1689 from harry-xm/stream
Rename NGX_STREAM_SNI macro to T_NGX_STREAM_SNI
2 parents 3652122 + b03f713 commit ccb88c6

7 files changed

Lines changed: 35 additions & 35 deletions

File tree

auto/modules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,7 @@ if [ $STREAM != NO ]; then
11951195
echo "--with-stream_ssl_module is needed by --with-stream_sni"
11961196
exit 1;
11971197
fi
1198-
have=NGX_STREAM_SNI . auto/have
1198+
have=T_NGX_STREAM_SNI . auto/have
11991199
fi
12001200
fi
12011201

src/stream/ngx_stream.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ ngx_stream_init_phases(ngx_conf_t *cf, ngx_stream_core_main_conf_t *cmcf)
317317
return NGX_OK;
318318
}
319319

320-
#if (NGX_STREAM_SNI)
320+
#if (T_NGX_STREAM_SNI)
321321

322322
static int ngx_libc_cdecl
323323
ngx_stream_cmp_dns_wildcards(const void *one, const void *two)
@@ -555,7 +555,7 @@ ngx_stream_add_ports(ngx_conf_t *cf, ngx_array_t *ports,
555555
struct sockaddr *sa;
556556
ngx_stream_conf_port_t *port;
557557
ngx_stream_conf_addr_t *addr;
558-
#if (NGX_STREAM_SNI)
558+
#if (T_NGX_STREAM_SNI)
559559
ngx_stream_core_srv_conf_t *cscf;
560560
#endif
561561

@@ -595,7 +595,7 @@ ngx_stream_add_ports(ngx_conf_t *cf, ngx_array_t *ports,
595595
}
596596

597597
found:
598-
#if (NGX_STREAM_SNI)
598+
#if (T_NGX_STREAM_SNI)
599599

600600
cscf = listen->ctx->srv_conf[ngx_stream_core_module.ctx_index];
601601
addr = port->addrs.elts;
@@ -662,7 +662,7 @@ ngx_stream_optimize_servers(ngx_conf_t *cf, ngx_array_t *ports)
662662
ngx_stream_conf_addr_t *addr;
663663
ngx_stream_core_srv_conf_t *cscf;
664664

665-
#if (NGX_STREAM_SNI)
665+
#if (T_NGX_STREAM_SNI)
666666
ngx_stream_core_main_conf_t *cmcf;
667667
#endif
668668
port = ports->elts;
@@ -743,7 +743,7 @@ ngx_stream_optimize_servers(ngx_conf_t *cf, ngx_array_t *ports)
743743

744744
stport->naddrs = i + 1;
745745

746-
#if (NGX_STREAM_SNI)
746+
#if (T_NGX_STREAM_SNI)
747747
cmcf = addr->opt.ctx->main_conf[ngx_stream_core_module.ctx_index];
748748
/*Because of ssl_sni_force we have to do this even one server*/
749749
if (addr[i].servers.nelts >= 1) {
@@ -784,7 +784,7 @@ ngx_stream_add_addrs(ngx_conf_t *cf, ngx_stream_port_t *stport,
784784
ngx_uint_t i;
785785
struct sockaddr_in *sin;
786786
ngx_stream_in_addr_t *addrs;
787-
#if (NGX_STREAM_SNI)
787+
#if (T_NGX_STREAM_SNI)
788788
ngx_stream_virtual_names_t *vn;
789789
#endif
790790

@@ -808,7 +808,7 @@ ngx_stream_add_addrs(ngx_conf_t *cf, ngx_stream_port_t *stport,
808808
addrs[i].conf.proxy_protocol = addr[i].opt.proxy_protocol;
809809
addrs[i].conf.addr_text = addr[i].opt.addr_text;
810810

811-
#if (NGX_STREAM_SNI)
811+
#if (T_NGX_STREAM_SNI)
812812
addrs[i].conf.default_server = addr[i].default_server;
813813

814814
if (addr[i].hash.buckets == NULL
@@ -847,7 +847,7 @@ ngx_stream_add_addrs6(ngx_conf_t *cf, ngx_stream_port_t *stport,
847847
ngx_uint_t i;
848848
struct sockaddr_in6 *sin6;
849849
ngx_stream_in6_addr_t *addrs6;
850-
#if (NGX_STREAM_SNI)
850+
#if (T_NGX_STREAM_SNI)
851851
ngx_stream_virtual_names_t *vn;
852852
#endif
853853

@@ -871,7 +871,7 @@ ngx_stream_add_addrs6(ngx_conf_t *cf, ngx_stream_port_t *stport,
871871
addrs6[i].conf.proxy_protocol = addr[i].opt.proxy_protocol;
872872
addrs6[i].conf.addr_text = addr[i].opt.addr_text;
873873

874-
#if (NGX_STREAM_SNI)
874+
#if (T_NGX_STREAM_SNI)
875875
addrs6[i].conf.default_server = addr[i].default_server;
876876

877877
if (addr[i].hash.buckets == NULL

src/stream/ngx_stream.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ typedef struct {
6666
int rcvbuf;
6767
int sndbuf;
6868
int type;
69-
#if (NGX_STREAM_SNI)
69+
#if (T_NGX_STREAM_SNI)
7070
unsigned default_server;
7171
#endif
7272
} ngx_stream_listen_t;
@@ -77,7 +77,7 @@ typedef struct {
7777
ngx_str_t addr_text;
7878
unsigned ssl:1;
7979
unsigned proxy_protocol:1;
80-
#if (NGX_STREAM_SNI)
80+
#if (T_NGX_STREAM_SNI)
8181
void *default_server;
8282
void *virtual_names;
8383
#endif
@@ -116,7 +116,7 @@ typedef struct {
116116

117117
typedef struct {
118118
ngx_stream_listen_t opt;
119-
#if (NGX_STREAM_SNI)
119+
#if (T_NGX_STREAM_SNI)
120120
void *default_server;
121121
ngx_array_t servers; /* array of ngx_stream_core_srv_conf_t */
122122
ngx_hash_t hash;
@@ -181,7 +181,7 @@ typedef struct {
181181

182182
ngx_stream_phase_t phases[NGX_STREAM_LOG_PHASE + 1];
183183

184-
#if (NGX_STREAM_SNI)
184+
#if (T_NGX_STREAM_SNI)
185185
ngx_uint_t server_names_hash_max_size;
186186
ngx_uint_t server_names_hash_bucket_size;
187187
#endif
@@ -209,14 +209,14 @@ typedef struct {
209209

210210
ngx_uint_t listen; /* unsigned listen:1; */
211211

212-
#if (NGX_STREAM_SNI)
212+
#if (T_NGX_STREAM_SNI)
213213
/* array of the ngx_stream_server_name_t, "server_name" directive */
214214
ngx_array_t server_names;
215215
ngx_str_t server_name;
216216
#endif
217217
} ngx_stream_core_srv_conf_t;
218218

219-
#if (NGX_STREAM_SNI)
219+
#if (T_NGX_STREAM_SNI)
220220
/* list of structures to find core_srv_conf quickly at run time */
221221
typedef struct {
222222
ngx_stream_core_srv_conf_t *server; /* virtual name server conf */
@@ -262,7 +262,7 @@ struct ngx_stream_session_s {
262262
unsigned stat_processing:1;
263263

264264
unsigned health_check:1;
265-
#if (NGX_STREAM_SNI)
265+
#if (T_NGX_STREAM_SNI)
266266
ngx_stream_addr_conf_t *addr_conf;
267267
#endif
268268

src/stream/ngx_stream_core_module.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static char *ngx_stream_core_listen(ngx_conf_t *cf, ngx_command_t *cmd,
2525
static char *ngx_stream_core_resolver(ngx_conf_t *cf, ngx_command_t *cmd,
2626
void *conf);
2727

28-
#if (NGX_STREAM_SNI)
28+
#if (T_NGX_STREAM_SNI)
2929
static char *ngx_stream_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd,
3030
void *conf);
3131
#endif
@@ -109,7 +109,7 @@ static ngx_command_t ngx_stream_core_commands[] = {
109109
offsetof(ngx_stream_core_srv_conf_t, preread_timeout),
110110
NULL },
111111

112-
#if (NGX_STREAM_SNI)
112+
#if (T_NGX_STREAM_SNI)
113113
{ ngx_string("server_name"),
114114
NGX_STREAM_SRV_CONF|NGX_CONF_1MORE,
115115
ngx_stream_core_server_name,
@@ -398,7 +398,7 @@ ngx_stream_core_create_main_conf(ngx_conf_t *cf)
398398
cmcf->variables_hash_max_size = NGX_CONF_UNSET_UINT;
399399
cmcf->variables_hash_bucket_size = NGX_CONF_UNSET_UINT;
400400

401-
#if (NGX_STREAM_SNI)
401+
#if (T_NGX_STREAM_SNI)
402402
cmcf->server_names_hash_max_size = NGX_CONF_UNSET_UINT;
403403
cmcf->server_names_hash_bucket_size = NGX_CONF_UNSET_UINT;
404404
#endif
@@ -415,7 +415,7 @@ ngx_stream_core_init_main_conf(ngx_conf_t *cf, void *conf)
415415
ngx_conf_init_uint_value(cmcf->variables_hash_max_size, 1024);
416416
ngx_conf_init_uint_value(cmcf->variables_hash_bucket_size, 64);
417417

418-
#if (NGX_STREAM_SNI)
418+
#if (T_NGX_STREAM_SNI)
419419
ngx_conf_init_uint_value(cmcf->server_names_hash_max_size, 512);
420420
ngx_conf_init_uint_value(cmcf->server_names_hash_bucket_size,
421421
ngx_cacheline_size);
@@ -457,7 +457,7 @@ ngx_stream_core_create_srv_conf(ngx_conf_t *cf)
457457
cscf->preread_buffer_size = NGX_CONF_UNSET_SIZE;
458458
cscf->preread_timeout = NGX_CONF_UNSET_MSEC;
459459

460-
#if (NGX_STREAM_SNI)
460+
#if (T_NGX_STREAM_SNI)
461461
if (ngx_array_init(&cscf->server_names, cf->temp_pool, 4,
462462
sizeof(ngx_stream_server_name_t))
463463
!= NGX_OK)
@@ -475,7 +475,7 @@ ngx_stream_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
475475
{
476476
ngx_stream_core_srv_conf_t *prev = parent;
477477
ngx_stream_core_srv_conf_t *conf = child;
478-
#if (NGX_STREAM_SNI)
478+
#if (T_NGX_STREAM_SNI)
479479
ngx_str_t name;
480480
ngx_stream_server_name_t *sn;
481481
#endif
@@ -528,7 +528,7 @@ ngx_stream_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
528528
ngx_conf_merge_msec_value(conf->preread_timeout,
529529
prev->preread_timeout, 30000);
530530

531-
#if (NGX_STREAM_SNI)
531+
#if (T_NGX_STREAM_SNI)
532532
if (conf->server_names.nelts == 0) {
533533
/* the array has 4 empty preallocated elements, so push cannot fail */
534534
sn = ngx_array_push(&conf->server_names);
@@ -705,7 +705,7 @@ ngx_stream_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
705705
}
706706
#endif
707707

708-
#if (NGX_STREAM_SNI)
708+
#if (T_NGX_STREAM_SNI)
709709
if (ngx_strcmp(value[i].data, "default_server") == 0
710710
|| ngx_strcmp(value[i].data, "default") == 0) {
711711

@@ -957,7 +957,7 @@ ngx_stream_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
957957
ls[n].addr_text = u.addrs[n].name;
958958
ls[n].wildcard = ngx_inet_wildcard(ls[n].sockaddr);
959959

960-
#if (NGX_STREAM_SNI)
960+
#if (T_NGX_STREAM_SNI)
961961
continue;
962962
#endif
963963

@@ -1005,7 +1005,7 @@ ngx_stream_core_resolver(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
10051005
return NGX_CONF_OK;
10061006
}
10071007

1008-
#if (NGX_STREAM_SNI)
1008+
#if (T_NGX_STREAM_SNI)
10091009
static char *
10101010
ngx_stream_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
10111011
{

src/stream/ngx_stream_handler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ ngx_stream_init_connection(ngx_connection_t *c)
125125
s->main_conf = addr_conf->ctx->main_conf;
126126
s->srv_conf = addr_conf->ctx->srv_conf;
127127

128-
#if (NGX_STREAM_SNI)
128+
#if (T_NGX_STREAM_SNI)
129129
s->addr_conf = addr_conf;
130130
s->main_conf = ((ngx_stream_core_srv_conf_t*)addr_conf->default_server)->ctx->main_conf;
131131
s->srv_conf = ((ngx_stream_core_srv_conf_t*)addr_conf->default_server)->ctx->srv_conf;

src/stream/ngx_stream_ssl_module.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static char *ngx_stream_ssl_session_cache(ngx_conf_t *cf, ngx_command_t *cmd,
4747
void *conf);
4848
static ngx_int_t ngx_stream_ssl_init(ngx_conf_t *cf);
4949

50-
#if (NGX_STREAM_SNI)
50+
#if (T_NGX_STREAM_SNI)
5151
int ngx_stream_ssl_servername(ngx_ssl_conn_t *ssl_conn, int *ad,
5252
void *arg);
5353
#endif
@@ -251,7 +251,7 @@ static ngx_command_t ngx_stream_ssl_commands[] = {
251251
offsetof(ngx_stream_ssl_conf_t, crl),
252252
NULL },
253253

254-
#if (NGX_STREAM_SNI)
254+
#if (T_NGX_STREAM_SNI)
255255
{ ngx_string("ssl_sni_force"),
256256
NGX_STREAM_MAIN_CONF|NGX_STREAM_SRV_CONF|NGX_CONF_FLAG,
257257
ngx_conf_set_flag_slot,
@@ -514,7 +514,7 @@ ngx_stream_ssl_handshake_handler(ngx_connection_t *c)
514514
ngx_stream_core_run_phases(s);
515515
}
516516

517-
#ifdef NGX_STREAM_SNI
517+
#ifdef T_NGX_STREAM_SNI
518518
static ngx_int_t
519519
ngx_stream_find_virtual_server(ngx_connection_t *c,
520520
ngx_stream_virtual_names_t *virtual_names, ngx_str_t *host,
@@ -807,7 +807,7 @@ ngx_stream_ssl_create_conf(ngx_conf_t *cf)
807807
scf->session_tickets = NGX_CONF_UNSET;
808808
scf->session_ticket_keys = NGX_CONF_UNSET_PTR;
809809

810-
#if (NGX_STREAM_SNI)
810+
#if (T_NGX_STREAM_SNI)
811811
scf->sni_force = NGX_CONF_UNSET;
812812
#endif
813813

@@ -873,7 +873,7 @@ ngx_stream_ssl_merge_conf(ngx_conf_t *cf, void *parent, void *child)
873873

874874
ngx_conf_merge_str_value(conf->ciphers, prev->ciphers, NGX_DEFAULT_CIPHERS);
875875

876-
#if (NGX_STREAM_SNI)
876+
#if (T_NGX_STREAM_SNI)
877877
ngx_conf_merge_value(conf->sni_force, prev->sni_force, 0);
878878
#endif
879879

@@ -972,7 +972,7 @@ ngx_stream_ssl_merge_conf(ngx_conf_t *cf, void *parent, void *child)
972972
cln->handler = ngx_ssl_cleanup_ctx;
973973
cln->data = &conf->ssl;
974974

975-
#if (NGX_STREAM_SNI)
975+
#if (T_NGX_STREAM_SNI)
976976
#if (SSL_CTRL_SET_TLSEXT_HOSTNAME)
977977
if (SSL_CTX_set_tlsext_servername_callback(conf->ssl.ctx,
978978
ngx_stream_ssl_servername)

src/stream/ngx_stream_ssl_module.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ typedef struct {
6262
ngx_str_t sign_certificate;
6363
ngx_str_t sign_certificate_key;
6464
#endif
65-
#if (NGX_STREAM_SNI)
65+
#if (T_NGX_STREAM_SNI)
6666
ngx_flag_t sni_force;
6767
#endif
6868
} ngx_stream_ssl_conf_t;

0 commit comments

Comments
 (0)