mirror of
https://github.com/nginx/nginx.git
synced 2025-06-13 06:12:44 +08:00
nginx-0.0.10-2004-08-30-23:24:51 import
This commit is contained in:
parent
8645ca1f16
commit
7105763f5b
@ -284,9 +284,6 @@ static ngx_int_t ngx_http_userid_set_uid(ngx_http_request_t *r,
|
|||||||
|
|
||||||
/* TODO: mutex for sequencers */
|
/* TODO: mutex for sequencers */
|
||||||
|
|
||||||
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
||||||
"service: %d", r->in_addr);
|
|
||||||
|
|
||||||
if (conf->enable == NGX_HTTP_USERID_V1) {
|
if (conf->enable == NGX_HTTP_USERID_V1) {
|
||||||
if (conf->service == NGX_CONF_UNSET) {
|
if (conf->service == NGX_CONF_UNSET) {
|
||||||
ctx->uid_set[0] = 0;
|
ctx->uid_set[0] = 0;
|
||||||
|
@ -257,11 +257,6 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
*h = ngx_http_find_location_config;
|
*h = ngx_http_find_location_config;
|
||||||
|
|
||||||
|
|
||||||
ngx_init_array(cmcf->phases[NGX_HTTP_MISC_PHASE].handlers,
|
|
||||||
cf->cycle->pool, 10, sizeof(ngx_http_handler_pt),
|
|
||||||
NGX_CONF_ERROR);
|
|
||||||
cmcf->phases[NGX_HTTP_MISC_PHASE].type = NGX_DECLINED;
|
|
||||||
|
|
||||||
ngx_init_array(cmcf->phases[NGX_HTTP_ACCESS_PHASE].handlers,
|
ngx_init_array(cmcf->phases[NGX_HTTP_ACCESS_PHASE].handlers,
|
||||||
cf->cycle->pool, 10, sizeof(ngx_http_handler_pt),
|
cf->cycle->pool, 10, sizeof(ngx_http_handler_pt),
|
||||||
NGX_CONF_ERROR);
|
NGX_CONF_ERROR);
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
static void ngx_http_phase_event_handler(ngx_event_t *rev);
|
static void ngx_http_phase_event_handler(ngx_event_t *rev);
|
||||||
static void ngx_http_run_phases(ngx_http_request_t *r);
|
static void ngx_http_run_phases(ngx_http_request_t *r);
|
||||||
static ngx_int_t ngx_http_find_location(ngx_http_request_t *r,
|
static ngx_int_t ngx_http_find_location(ngx_http_request_t *r,
|
||||||
ngx_array_t *locations);
|
ngx_array_t *locations, size_t len);
|
||||||
|
|
||||||
static void *ngx_http_core_create_main_conf(ngx_conf_t *cf);
|
static void *ngx_http_core_create_main_conf(ngx_conf_t *cf);
|
||||||
static char *ngx_http_core_init_main_conf(ngx_conf_t *cf, void *conf);
|
static char *ngx_http_core_init_main_conf(ngx_conf_t *cf, void *conf);
|
||||||
@ -486,7 +486,7 @@ ngx_int_t ngx_http_find_location_config(ngx_http_request_t *r)
|
|||||||
|
|
||||||
cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
|
cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
|
||||||
|
|
||||||
rc = ngx_http_find_location(r, &cscf->locations);
|
rc = ngx_http_find_location(r, &cscf->locations, 0);
|
||||||
|
|
||||||
if (rc == NGX_HTTP_INTERNAL_SERVER_ERROR) {
|
if (rc == NGX_HTTP_INTERNAL_SERVER_ERROR) {
|
||||||
return rc;
|
return rc;
|
||||||
@ -551,7 +551,7 @@ ngx_int_t ngx_http_find_location_config(ngx_http_request_t *r)
|
|||||||
|
|
||||||
|
|
||||||
static ngx_int_t ngx_http_find_location(ngx_http_request_t *r,
|
static ngx_int_t ngx_http_find_location(ngx_http_request_t *r,
|
||||||
ngx_array_t *locations)
|
ngx_array_t *locations, size_t len)
|
||||||
{
|
{
|
||||||
ngx_int_t n, rc;
|
ngx_int_t n, rc;
|
||||||
ngx_uint_t i, found;
|
ngx_uint_t i, found;
|
||||||
@ -604,14 +604,7 @@ static ngx_int_t ngx_http_find_location(ngx_http_request_t *r,
|
|||||||
return NGX_HTTP_LOCATION_EXACT;
|
return NGX_HTTP_LOCATION_EXACT;
|
||||||
}
|
}
|
||||||
|
|
||||||
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
if (len > clcfp[i]->name.len) {
|
||||||
|
|
||||||
#if 0
|
|
||||||
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
||||||
"p:%d c:%d", clcf->name.len, clcfp[i]->name.len);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (clcf->name.len > clcfp[i]->name.len) {
|
|
||||||
/* the previous match is longer */
|
/* the previous match is longer */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -625,7 +618,7 @@ static ngx_int_t ngx_http_find_location(ngx_http_request_t *r,
|
|||||||
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
||||||
|
|
||||||
if (clcf->locations.nelts) {
|
if (clcf->locations.nelts) {
|
||||||
rc = ngx_http_find_location(r, &clcf->locations);
|
rc = ngx_http_find_location(r, &clcf->locations, len);
|
||||||
|
|
||||||
if (rc != NGX_OK) {
|
if (rc != NGX_OK) {
|
||||||
return rc;
|
return rc;
|
||||||
@ -1629,6 +1622,10 @@ static char *ngx_set_root(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
lcf->alias = alias;
|
lcf->alias = alias;
|
||||||
lcf->root = value[1];
|
lcf->root = value[1];
|
||||||
|
|
||||||
|
if (!alias && lcf->root.data[lcf->root.len - 1] == '/') {
|
||||||
|
lcf->root.len--;
|
||||||
|
}
|
||||||
|
|
||||||
return NGX_CONF_OK;
|
return NGX_CONF_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@ typedef enum {
|
|||||||
|
|
||||||
NGX_HTTP_FIND_CONFIG_PHASE,
|
NGX_HTTP_FIND_CONFIG_PHASE,
|
||||||
|
|
||||||
NGX_HTTP_MISC_PHASE,
|
|
||||||
NGX_HTTP_ACCESS_PHASE,
|
NGX_HTTP_ACCESS_PHASE,
|
||||||
NGX_HTTP_CONTENT_PHASE,
|
NGX_HTTP_CONTENT_PHASE,
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user