]> git.kaiwu.me - nginx.git/commitdiff
nginx-0.0.3-2004-05-04-21:56:58 import
authorIgor Sysoev <igor@sysoev.ru>
Tue, 4 May 2004 17:56:58 +0000 (17:56 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Tue, 4 May 2004 17:56:58 +0000 (17:56 +0000)
src/event/ngx_event.c
src/http/ngx_http_request.c
src/http/ngx_http_special_response.c

index 18fa6b6ef63d76bfdbb7d84b2eeddab5d4236a73..87747c3ebf508a6f946b6fecc516732ce22a8c5c 100644 (file)
@@ -220,7 +220,8 @@ static ngx_int_t ngx_event_process_init(ngx_cycle_t *cycle)
     ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
     ecf = ngx_event_get_conf(cycle->conf_ctx, ngx_event_core_module);
 
-    if (ccf->worker_processes > 1 && ecf->accept_mutex) {
+    if (ngx_accept_mutex_ptr && ccf->worker_processes > 1 && ecf->accept_mutex)
+    {
         ngx_accept_mutex = ngx_accept_mutex_ptr;
         ngx_accept_mutex_held = 1;
         ngx_accept_mutex_delay = ecf->accept_mutex_delay;
index d5496e227b1b141319f9c29736def77c4cbe988a..a8c4aeed26d647e2dbe1083e0e922484ff31f586 100644 (file)
@@ -871,6 +871,7 @@ static ngx_int_t ngx_http_process_request_header(ngx_http_request_t *r)
             {
                 r->srv_conf = name[i].core_srv_conf->ctx->srv_conf;
                 r->loc_conf = name[i].core_srv_conf->ctx->loc_conf;
+                r->server_name = &name[i].name;
 
                 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
                 r->connection->log->file = clcf->err_log->file;
index ba879692570dbd9906cbdd32001f4aac471bc996..55f4bb3ac305c4d6225bf5c886cda7c2cb8a7a85 100644 (file)
@@ -240,8 +240,15 @@ int ngx_http_special_response_handler(ngx_http_request_t *r, int error)
 
     if (error_pages[err].len) {
         r->headers_out.content_length_n = error_pages[err].len
-                                          + sizeof(error_tail) - 1
-                                          + sizeof(msie_stub) - 1;
+                                          + sizeof(error_tail) - 1;
+
+        if (clcf->msie_padding
+            && r->http_version >= NGX_HTTP_VERSION_10
+            && error >= NGX_HTTP_BAD_REQUEST
+            && error != NGX_HTTP_REQUEST_URI_TOO_LARGE)
+        {
+            r->headers_out.content_length_n += sizeof(msie_stub) - 1;
+        }
 
         if (!(r->headers_out.content_type =
                    ngx_http_add_header(&r->headers_out, ngx_http_headers_out)))
@@ -300,8 +307,7 @@ int ngx_http_special_response_handler(ngx_http_request_t *r, int error)
     if (clcf->msie_padding
         && r->http_version >= NGX_HTTP_VERSION_10
         && error >= NGX_HTTP_BAD_REQUEST
-        && error != NGX_HTTP_REQUEST_URI_TOO_LARGE
-       )
+        && error != NGX_HTTP_REQUEST_URI_TOO_LARGE)
     {
         if (!(h = ngx_calloc_hunk(r->pool))) {
             return NGX_ERROR;