diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 0f66b0d..cde7f1d 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -10,7 +10,7 @@
 static void ngx_http_process_request_headers(ngx_event_t *rev);
 static ssize_t ngx_http_read_request_header(ngx_http_request_t *r);
 
-static void ngx_http_writer(ngx_event_t *ev);
+static void ngx_http_set_write_handler(ngx_http_request_t *r);
 
 static void ngx_http_block_read(ngx_event_t *ev);
 static void ngx_http_read_discarded_body_event(ngx_event_t *rev);
@@ -112,6 +112,13 @@
         return;
     }
 
+    if (ngx_handle_read_event(rev) == NGX_ERROR) {
+        ngx_http_close_connection(c);
+        return;
+    }
+
+#if 0
+
     if (ngx_event_flags & NGX_HAVE_CLEAR_EVENT) {
         /* kqueue */
         event = NGX_CLEAR_EVENT;
@@ -124,6 +131,10 @@
     if (ngx_add_event(rev, NGX_READ_EVENT, event) == NGX_ERROR) {
         ngx_http_close_connection(c);
     }
+
+#endif
+
+    return;
 }
 
 
@@ -660,6 +671,7 @@
             }
 
             rev->event_handler = ngx_http_block_read;
+            c->write->event_handler = ngx_http_writer;
             ngx_http_handler(r);
             return;
 
@@ -743,6 +755,13 @@
             r->header_timeout_set = 1;
         }
 
+        if (ngx_handle_read_event(rev) == NGX_ERROR) {
+            ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
+            ngx_http_close_connection(r->connection);
+            return NGX_ERROR;
+        }
+
+#if 0
         if (!rev->active) {
             if (ngx_event_flags & NGX_HAVE_CLEAR_EVENT) {
                 /* kqueue */
@@ -759,6 +778,7 @@
                 return NGX_ERROR;
             }
         }
+#endif
 
         return NGX_AGAIN;
     }
@@ -780,17 +800,14 @@
 }
 
 
-void ngx_http_finalize_request(ngx_http_request_t *r, int error)
+void ngx_http_finalize_request(ngx_http_request_t *r, int rc)
 {
-    int           rc;
     ngx_event_t  *rev, *wev;
 
-    if (r->main) {
+    if (r->main || r->closed) {
         return;
     }
 
-    rc = error;
-
     if (rc >= NGX_HTTP_SPECIAL_RESPONSE) {
 
         rev = r->connection->read;
@@ -805,37 +822,18 @@
             wev->timer_set = 0;
         }
 
-        rc = ngx_http_special_response_handler(r, rc);
+        ngx_http_finalize_request(r, ngx_http_special_response_handler(r, rc));
 
-        if (rc == NGX_AGAIN) {
-            return;
-        }
-
-        if (rc == NGX_ERROR) {
-            ngx_http_close_request(r, 0);
-            ngx_http_close_connection(r->connection);
-            return;
-        }
-
-#if 1
         return;
-#endif
 
     } else if (rc == NGX_ERROR) {
-        r->keepalive = 0;
-        r->lingering_close = 0;
+        ngx_http_close_request(r, 0);
+        ngx_http_close_connection(r->connection);
+        return;
 
-    } else {
-        if (ngx_http_send_last(r) == NGX_ERROR) {
-            ngx_http_close_request(r, 0);
-            ngx_http_close_connection(r->connection);
-            return;
-        }
-
-        if (rc == NGX_AGAIN) {
-            ngx_http_set_write_handler(r);
-            return;
-        }
+    } else if (rc == NGX_AGAIN) {
+        ngx_http_set_write_handler(r);
+        return;
     }
 
     rev = r->connection->read;
@@ -865,7 +863,7 @@
 }
 
 
-void ngx_http_set_write_handler(ngx_http_request_t *r)
+static void ngx_http_set_write_handler(ngx_http_request_t *r)
 {
     int                        event;
     ngx_event_t               *wev;
@@ -883,6 +881,13 @@
     ngx_add_timer(wev, clcf->send_timeout);
     wev->timer_set = 1;
 
+    if (ngx_handle_write_event(wev, clcf->send_lowat) == NGX_ERROR) {
+        ngx_http_close_request(r, 0);
+        ngx_http_close_connection(r->connection);
+    }
+
+#if 0
+
     if (ngx_event_flags & (NGX_HAVE_AIO_EVENT|NGX_HAVE_EDGE_EVENT)) {
         /* aio, iocp, epoll */
         return;
@@ -910,11 +915,13 @@
         ngx_http_close_connection(r->connection);
     }
 
+#endif
+
     return;
 }
 
 
-static void ngx_http_writer(ngx_event_t *wev)
+void ngx_http_writer(ngx_event_t *wev)
 {
     int                        rc;
     ngx_event_t               *rev;
@@ -1454,6 +1461,10 @@
     ctx->url = NULL;
 
     ngx_destroy_pool(r->pool);
+
+    r->closed = 1;
+
+    return;
 }
 
 
@@ -1497,6 +1508,8 @@
     c->fd = -1;
 
     ngx_destroy_pool(c->pool);
+
+    return;
 }
 
 
