nginx-0.0.1-2003-10-09-11:00:45 import
diff --git a/src/http/modules/ngx_http_not_modified_filter.c b/src/http/modules/ngx_http_not_modified_filter.c
index ab22fa6..f1ccd44 100644
--- a/src/http/modules/ngx_http_not_modified_filter.c
+++ b/src/http/modules/ngx_http_not_modified_filter.c
@@ -39,7 +39,7 @@
 
     if (r->headers_out.status != NGX_HTTP_OK
         || r->headers_in.if_modified_since == NULL
-        || r->headers_out.last_modified_time == NULL)
+        || r->headers_out.last_modified_time == -1)
     {
         return next_header_filter(r);
     }
@@ -50,7 +50,7 @@
     ngx_log_debug(r->connection->log, "%d %d" _
                   ims _ r->headers_out.last_modified_time);
 
-    /* I think that the date equality is correcter */
+    /* I think that the equality of the dates is correcter */
 
     if (ims != NGX_ERROR && ims == r->headers_out.last_modified_time) {
         r->headers_out.status = NGX_HTTP_NOT_MODIFIED;
diff --git a/src/http/modules/ngx_http_static_handler.c b/src/http/modules/ngx_http_static_handler.c
index 8ea6a0a..784f3de 100644
--- a/src/http/modules/ngx_http_static_handler.c
+++ b/src/http/modules/ngx_http_static_handler.c
@@ -118,6 +118,7 @@
     }
 
     /* we need to allocate all before the header would be sent */
+
     ngx_test_null(h, ngx_pcalloc(r->pool, sizeof(ngx_hunk_t)),
                   NGX_HTTP_INTERNAL_SERVER_ERROR);
 
@@ -132,18 +133,28 @@
     }
 
     if (r->header_only) {
+        ngx_http_finalize_request(r, rc);
+
+#if 0
         if (rc == NGX_AGAIN) {
             ngx_http_set_write_handler(r);
 
         } else {
             ngx_http_finalize_request(r, 0);
         }
+#endif
 
         return NGX_OK;
     }
 
 
-    h->type = NGX_HUNK_FILE|NGX_HUNK_LAST;
+#if 0
+    h->type = r->main ? NGX_HUNK_FILE : NGX_HUNK_FILE|NGX_HUNK_LAST;
+#else
+    h->type = NGX_HUNK_FILE;
+#endif
+
+
     h->file_pos = 0;
     h->file_last = ngx_file_size(r->file.info);
 
@@ -152,6 +163,9 @@
 
     rc = ngx_http_output_filter(r, h);
 
+    ngx_http_finalize_request(r, rc);
+
+#if 0
     if (r->main == NULL) {
         if (rc == NGX_AGAIN) {
             ngx_http_set_write_handler(r);
@@ -160,6 +174,7 @@
             ngx_http_finalize_request(r, 0);
         }
     }
+#endif
 
     return NGX_OK;
 }