diff --git a/src/core/ngx_connection.h b/src/core/ngx_connection.h
index 2794a1c..2450ea3 100644
--- a/src/core/ngx_connection.h
+++ b/src/core/ngx_connection.h
@@ -14,9 +14,13 @@
 #endif
 
 struct ngx_connection_s {
-    ngx_socket_t      fd;
+    ngx_socket_t     fd;
     void            *data;
 
+    /* STUB */
+    ngx_array_t     *requests;
+    int              requests_len;
+
 #ifdef NGX_EVENT
     ngx_event_t      *read;
     ngx_event_t      *write;
diff --git a/src/event/modules/ngx_kqueue_module.c b/src/event/modules/ngx_kqueue_module.c
index aad8581..3b65f80 100644
--- a/src/event/modules/ngx_kqueue_module.c
+++ b/src/event/modules/ngx_kqueue_module.c
@@ -2,10 +2,6 @@
  * Copyright (C) 2002 Igor Sysoev, http://sysoev.ru
  */
 
-/*
-    NEED ? : unify change_list and event_list:
-       event_list = change_list;
-*/
 
 #include <ngx_config.h>
 #include <ngx_core.h>
@@ -66,6 +62,17 @@
 
 int ngx_kqueue_del_event(ngx_event_t *ev, int event)
 {
+    ngx_event_t *e;
+
+    if (ev->index <= nchanges && change_list[ev->index].udata == ev) {
+        change_list[ev->index] = change_list[nchanges];
+        e = (ngx_event_t *) change_list[ev->index].udata;
+        e->index = ev->index;
+        nchanges--;
+
+        return NGX_OK;
+    }
+
     return ngx_kqueue_set_event(ev, event, EV_DELETE);
 }
 
@@ -94,6 +101,10 @@
     change_list[nchanges].fflags = 0;
     change_list[nchanges].data = 0;
     change_list[nchanges].udata = ev;
+
+    if (flags == EV_ADD)
+        ev->index = nchanges;
+
     nchanges++;
 
     return NGX_OK;
diff --git a/src/event/ngx_event.c b/src/event/ngx_event.c
index 8fbdbe5..68b6bf8 100644
--- a/src/event/ngx_event.c
+++ b/src/event/ngx_event.c
@@ -21,7 +21,7 @@
 
 #if !(USE_KQUEUE)
 
-#if 1
+#if 0
 ngx_event_type_e     ngx_event_type = NGX_SELECT_EVENT;
 #else
 ngx_event_type_e     ngx_event_type = NGX_KQUEUE_EVENT;
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c
index 7cecd5d..83ce8dd 100644
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -31,8 +31,8 @@
 #if (WIN32)
     ngx_http_server.doc_root = "html";
 #else
-    ngx_http_server.doc_root = "/home/is/dox/";
     ngx_http_server.doc_root = "/home/is/work/xml/site-1.0.0/html";
+    ngx_http_server.doc_root = "/home/is/dox/";
 #endif
     ngx_http_server.doc_root_len = strlen(ngx_http_server.doc_root) + 1;
 
diff --git a/src/http/ngx_http.h b/src/http/ngx_http.h
index 28c4321..026c167 100644
--- a/src/http/ngx_http.h
+++ b/src/http/ngx_http.h
@@ -122,14 +122,15 @@
     unsigned  logging:1;
 
     unsigned  header_only:1;
-    unsigned  unusual_uri:1;
-    unsigned  complex_uri:1;
+    unsigned  unusual_uri:1;  /* URI is not started with '/' - "GET http://" */
+    unsigned  complex_uri:1;  /* URI with "./" or with "//" */
 
     int    state;
     char  *uri_start;
     char  *uri_end;
     char  *uri_ext;
     char  *args_start;
+    char  *request_end;
     char  *header_name_start;
     char  *header_name_end;
     char  *header_start;
diff --git a/src/http/ngx_http_event.c b/src/http/ngx_http_event.c
index aa56704..258a6c7 100644
--- a/src/http/ngx_http_event.c
+++ b/src/http/ngx_http_event.c
@@ -47,6 +47,7 @@
 static int ngx_http_error(ngx_http_request_t *r, int error);
 
 static int ngx_http_close_request(ngx_http_request_t *r);
+static int ngx_http_close_connection(ngx_event_t *ev);
 static size_t ngx_http_log_error(void *data, char *buf, size_t len);
 
 
@@ -69,12 +70,19 @@
 
     ev = c->read;
     ev->event_handler = ngx_http_init_request;
+
     srv = (ngx_http_server_t *) c->server;
 
     ngx_test_null(c->pool,
                   ngx_create_pool(srv->connection_pool_size, ev->log),
                   NGX_ERROR);
 
+    ngx_test_null(c->requests, ngx_create_array(c->pool, 10, sizeof(char *)),
+                  NGX_ERROR);
+
+    ev->close_handler = ngx_http_close_connection;
+    c->write->close_handler = ngx_http_close_connection;
+
     ngx_test_null(addr, ngx_palloc(c->pool, c->socklen), NGX_ERROR);
     ngx_memcpy(addr, c->sockaddr, c->socklen);
     c->sockaddr = addr;
@@ -240,17 +248,35 @@
 
 static int ngx_http_process_request_line(ngx_http_request_t *r)
 {
-    int rc;
+    int     rc, len;
+    char  **request;
+    ngx_connection_t    *c;
     ngx_http_log_ctx_t  *ctx;
 
     rc = ngx_read_http_request_line(r);
 
+    c = r->connection;
+
     if (rc == NGX_OK) {
         ngx_test_null(r->uri,
                       ngx_palloc(r->pool, r->uri_end - r->uri_start + 1), 
                       ngx_http_close_request(r));
         ngx_cpystrn(r->uri, r->uri_start, r->uri_end - r->uri_start + 1);
 
+        ngx_test_null(request, ngx_push_array(c->requests),
+                      ngx_http_close_request(r));
+
+        if (r->request_end)
+            len = r->request_end - r->header_in->start + 1;
+        else
+            len = 1;
+        c->requests_len += len;
+        ngx_test_null(*request, ngx_palloc(c->pool, len),
+                      ngx_http_close_request(r));
+        ngx_cpystrn(*request, r->header_in->start, len);
+
+        ngx_log_debug(c->log, "REQ: '%s'" _ *request);
+
         if (r->uri_ext) {
             ngx_test_null(r->exten,
                           ngx_palloc(r->pool, r->uri_end - r->uri_ext + 1), 
@@ -862,6 +888,42 @@
 }
 
 
+static int ngx_http_close_connection(ngx_event_t *ev)
+{
+    int    i, len;
+    char **requests, *requests_line, *prev, *new;
+    ngx_connection_t *c = (ngx_connection_t *) ev->data;
+
+    if (c->requests->nelts > 1) {
+        len = c->requests_len + c->requests->nelts * 2 - 1;
+
+        ngx_test_null(requests_line, ngx_palloc(c->pool, len),
+                      ngx_event_close_connection(ev));
+
+        requests = (char **) c->requests->elts;
+        prev = requests_line;
+        new = ngx_cpystrn(prev, requests[0], len);
+        len -= new - prev;
+        prev = new;
+
+        for (i = 1; i < c->requests->nelts; i++) { 
+            new = ngx_cpystrn(prev, ", ", len);
+            new = ngx_cpystrn(new, requests[i], len);
+            len -= new - prev;
+            prev = new;
+        }
+
+    } else {
+        requests_line = * (char **) c->requests->elts;
+    }
+
+    ngx_log_error(NGX_LOG_INFO, c->log, 0,
+                  "REQUESTS: %d, '%s'", c->requests->nelts, requests_line);
+
+    return ngx_event_close_connection(ev);
+}
+
+
 static size_t ngx_http_log_error(void *data, char *buf, size_t len)
 {
     ngx_http_log_ctx_t *ctx = (ngx_http_log_ctx_t *) data;
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c
index 155dec6..8f2db68 100644
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -32,7 +32,7 @@
        state, p, r->header_in->last, ch, p);
 */
 
-        /* GCC 2.95.2 and VC 6.0 compiles this switch as jump table */
+        /* GCC 2.95.2 and VC 6.0 compile this switch as jump table */
 
         switch (state) {
 
@@ -257,7 +257,6 @@
                 return NGX_HTTP_PARSE_INVALID_REQUEST;
 
             r->http_minor = ch - '0';
-
             state = sw_minor_digit;
             break;
 
@@ -281,6 +280,7 @@
 
         /* end of request line */
         case sw_almost_done:
+            r->request_end = p - 2;
             switch (ch) {
             case LF:
                 state = sw_done;
@@ -295,6 +295,8 @@
     r->header_in->pos.mem = p;
 
     if (state == sw_done) {
+        if (r->request_end == NULL)
+            r->request_end = p - 1;
         r->http_version = r->http_major * 1000 + r->http_minor;
         r->state = sw_start;
         if (r->http_version == 9 && r->method == NGX_HTTP_HEAD)
