aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/ngx_http.c')
-rw-r--r--src/http/ngx_http.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c
index 234992d58..9d53d8861 100644
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -46,8 +46,8 @@ ngx_module_t ngx_http_module = {
static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
- int mi, m, s, l, p, a, n;
- int port_found, addr_found, virtual_names;
+ ngx_uint_t mi, m, s, l, p, a, n;
+ ngx_uint_t port_found, addr_found, virtual_names;
char *rv;
struct sockaddr_in *addr_in;
ngx_conf_t pcf;
@@ -304,10 +304,8 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
* serves this address:port
*/
- if (lscf[l].flags & NGX_HTTP_DEFAULT_SERVER) {
- if (in_addr[a].flags
- & NGX_HTTP_DEFAULT_SERVER) {
-
+ if (lscf[l].default_server) {
+ if (in_addr[a].default_server) {
ngx_log_error(NGX_LOG_ERR, cf->log, 0,
"duplicate default server in %s:%d",
lscf[l].file_name.data,
@@ -316,8 +314,8 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_ERROR;
}
- in_addr[a].flags |= NGX_HTTP_DEFAULT_SERVER;
in_addr[a].core_srv_conf = cscfp[s];
+ in_addr[a].default_server = 1;
}
addr_found = 1;
@@ -340,7 +338,7 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
sizeof(ngx_http_in_addr_t));
in_addr[a].addr = lscf[l].addr;
- in_addr[a].flags = lscf[l].flags;
+ in_addr[a].default_server = lscf[l].default_server;
in_addr[a].core_srv_conf = cscfp[s];
/*
@@ -370,7 +368,7 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
NGX_CONF_ERROR);
inaddr->addr = lscf[l].addr;
- inaddr->flags = lscf[l].flags;
+ inaddr->default_server = lscf[l].default_server;
inaddr->core_srv_conf = cscfp[s];
/*
@@ -397,7 +395,8 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ngx_test_null(in_port->port_name.data, ngx_palloc(cf->pool, 7),
NGX_CONF_ERROR);
- in_port->port_name.len = ngx_snprintf(in_port->port_name.data,
+ in_port->port_name.len = ngx_snprintf((char *)
+ in_port->port_name.data,
7, ":%d",
in_port->port);
@@ -413,7 +412,7 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
/* ... and add the address to this list */
inaddr->addr = lscf[l].addr;
- inaddr->flags = lscf[l].flags;
+ inaddr->default_server = lscf[l].default_server;
inaddr->core_srv_conf = cscfp[s];
/*
@@ -495,14 +494,15 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
NGX_CONF_ERROR);
ls->addr_text.len =
- ngx_snprintf(ls->addr_text.data
+ ngx_snprintf((char *) ls->addr_text.data
+ ngx_inet_ntop(AF_INET,
- (char *) &in_addr[a].addr,
+ (u_char *)
+ &in_addr[a].addr,
ls->addr_text.data,
INET_ADDRSTRLEN),
6, ":%d", in_port[p].port);
- ls->fd = -1;
+ ls->fd = (ngx_socket_t) -1;
ls->family = AF_INET;
ls->type = SOCK_STREAM;
ls->protocol = IPPROTO_IP;
@@ -596,8 +596,8 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
"port: %d %08x", in_port[p].port, &in_port[p]);
in_addr = in_port[p].addrs.elts;
for (a = 0; a < in_port[p].addrs.nelts; a++) {
- char ip[20];
- ngx_inet_ntop(AF_INET, (char *) &in_addr[a].addr, ip, 20);
+ u_char ip[20];
+ ngx_inet_ntop(AF_INET, (u_char *) &in_addr[a].addr, ip, 20);
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, cf->log, 0,
"%s %08x", ip, in_addr[a].core_srv_conf);
s_name = in_addr[a].names.elts;