diff src/event/ngx_event.h @ 452:23fb87bddda1 release-0.1.1

nginx-0.1.1-RELEASE import *) Feature: the gzip_types directive. *) Feature: the tcp_nodelay directive. *) Feature: the send_lowat directive is working not only on OSes that support kqueue NOTE_LOWAT, but also on OSes that support SO_SNDLOWAT. *) Feature: the setproctitle() emulation for Linux and Solaris. *) Bugfix: the "Location" header rewrite bug fixed while the proxying. *) Bugfix: the ngx_http_chunked_module module may get caught in an endless loop. *) Bugfix: the /dev/poll module bugs fixed. *) Bugfix: the responses were corrupted when the temporary files were used while the proxying. *) Bugfix: the unescaped requests were passed to the backend. *) Bugfix: while the build configuration on Linux 2.4 the --with-poll_module parameter was required.
author Igor Sysoev <igor@sysoev.ru>
date Mon, 11 Oct 2004 15:07:03 +0000
parents 42d11f017717
children 295d97d70c69
line wrap: on
line diff
--- a/src/event/ngx_event.h
+++ b/src/event/ngx_event.h
@@ -207,7 +207,7 @@ typedef struct {
     ngx_int_t  (*add_conn)(ngx_connection_t *c);
     ngx_int_t  (*del_conn)(ngx_connection_t *c, u_int flags);
 
-    ngx_int_t  (*process_changes)(ngx_cycle_t *cycle, ngx_uint_t try);
+    ngx_int_t  (*process_changes)(ngx_cycle_t *cycle, ngx_uint_t nowait);
     ngx_int_t  (*process_events)(ngx_cycle_t *cycle);
 
     ngx_int_t  (*init)(ngx_cycle_t *cycle);
@@ -479,6 +479,9 @@ int ngx_event_post_acceptex(ngx_listenin
 #endif
 
 
+ngx_int_t ngx_send_lowat(ngx_connection_t *c, size_t lowat);
+
+
 /* used in ngx_log_debugX() */
 #define ngx_event_ident(p)  ((ngx_connection_t *) (p))->fd
 
@@ -497,7 +500,7 @@ ngx_inline static int ngx_handle_read_ev
 {
     if (ngx_event_flags & NGX_USE_CLEAR_EVENT) {
 
-        /* kqueue */
+        /* kqueue, epoll */
 
         if (!rev->active && !rev->ready) {
             if (ngx_add_event(rev, NGX_READ_EVENT, NGX_CLEAR_EVENT)
@@ -531,7 +534,7 @@ ngx_inline static int ngx_handle_read_ev
         }
     }
 
-    /* aio, iocp, epoll, rtsig */
+    /* aio, iocp, rtsig */
 
     return NGX_OK;
 }
@@ -563,14 +566,25 @@ ngx_inline static int ngx_handle_level_r
 }
 
 
-ngx_inline static int ngx_handle_write_event(ngx_event_t *wev, u_int flags)
+ngx_inline static int ngx_handle_write_event(ngx_event_t *wev, size_t lowat)
 {
+    ngx_connection_t  *c;
+
+    if (lowat) {
+        c = wev->data;
+
+        if (ngx_send_lowat(c, lowat) == NGX_ERROR) {
+            return NGX_ERROR;
+        }
+    }
+
     if (ngx_event_flags & NGX_USE_CLEAR_EVENT) {
 
-        /* kqueue */
+        /* kqueue, epoll */
 
         if (!wev->active && !wev->ready) {
-            if (ngx_add_event(wev, NGX_WRITE_EVENT, NGX_CLEAR_EVENT|flags)
+            if (ngx_add_event(wev, NGX_WRITE_EVENT,
+                              NGX_CLEAR_EVENT | (lowat ? NGX_LOWAT_EVENT : 0))
                                                                   == NGX_ERROR)
             {
                 return NGX_ERROR;
@@ -602,7 +616,7 @@ ngx_inline static int ngx_handle_write_e
         }
     }
 
-    /* aio, iocp, epoll, rtsig */
+    /* aio, iocp, rtsig */
 
     return NGX_OK;
 }