diff src/http/ngx_http_write_filter.c @ 154:eac26585476e

nginx-0.0.1-2003-10-22-11:05:29 import
author Igor Sysoev <igor@sysoev.ru>
date Wed, 22 Oct 2003 07:05:29 +0000
parents c71aeb75c071
children 46eb23d9471d
line wrap: on
line diff
--- a/src/http/ngx_http_write_filter.c
+++ b/src/http/ngx_http_write_filter.c
@@ -6,6 +6,11 @@
 
 
 typedef struct {
+    ssize_t  buffer_output;
+} ngx_http_write_filter_conf_t;
+
+
+typedef struct {
     ngx_chain_t  *out;
 } ngx_http_write_filter_ctx_t;
 
@@ -18,13 +23,6 @@ static int ngx_http_write_filter_init(ng
 
 static ngx_command_t ngx_http_write_filter_commands[] = {
 
-    {ngx_string("sendfile"),
-     NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
-     ngx_conf_set_flag_slot,
-     NGX_HTTP_LOC_CONF_OFFSET,
-     offsetof(ngx_http_write_filter_conf_t, sendfile),
-     NULL},
-
     {ngx_string("buffer_output"),
      NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
      ngx_conf_set_size_slot,
@@ -94,9 +92,6 @@ int ngx_http_write_filter(ngx_http_reque
         }
     }
 
-    conf = ngx_http_get_module_loc_conf(r->main ? r->main : r,
-                                        ngx_http_write_filter_module);
-
     /* add the new chain to the existent one */
 
     for (/* void */; in; in = in->next) {
@@ -107,10 +102,6 @@ int ngx_http_write_filter(ngx_http_reque
         *le = ce;
         le = &ce->next;
 
-        if (!(ngx_io.flags & NGX_IO_SENDFILE) || !conf->sendfile) {
-            ce->hunk->type &= ~NGX_HUNK_FILE;
-        }
-
         size += ngx_hunk_size(ce->hunk);
 
         if (ce->hunk->type & (NGX_HUNK_FLUSH|NGX_HUNK_RECYCLED)) {
@@ -128,6 +119,9 @@ int ngx_http_write_filter(ngx_http_reque
                   last _ flush _ size);
 #endif
 
+    conf = ngx_http_get_module_loc_conf(r->main ? r->main : r,
+                                        ngx_http_write_filter_module);
+
     /*
      * avoid the output if there is no last hunk, no flush point and
      * size of the hunks is smaller then "buffer_output"
@@ -174,7 +168,6 @@ static void *ngx_http_write_filter_creat
                   NULL);
 
     conf->buffer_output = NGX_CONF_UNSET;
-    conf->sendfile = NGX_CONF_UNSET;
 
     return conf;
 }
@@ -187,7 +180,6 @@ static char *ngx_http_write_filter_merge
     ngx_http_write_filter_conf_t *conf = child;
 
     ngx_conf_merge_size_value(conf->buffer_output, prev->buffer_output, 1460);
-    ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0);
 
     return NULL;
 }