diff src/event/modules/ngx_epoll_module.c @ 324:f7cd062ee035 NGINX_0_6_6

nginx 0.6.6 *) Feature: the --sysconfdir=PATH option in configure. *) Feature: named locations. *) Feature: the $args variable can be set with the "set" directive. *) Feature: the $is_args variable. *) Bugfix: fair big weight upstream balancer. *) Bugfix: if a client has closed connection to mail proxy then nginx might not close connection to backend. *) Bugfix: if the same host without specified port was used as backend for HTTP and HTTPS, then nginx used only one port - 80 or 443. *) Bugfix: fix building on Solaris/amd64 by Sun Studio 11 and early versions; bug appeared in 0.6.4.
author Igor Sysoev <http://sysoev.ru>
date Mon, 30 Jul 2007 00:00:00 +0400
parents 56688ed172c8
children 12defd37f578
line wrap: on
line diff
--- a/src/event/modules/ngx_epoll_module.c
+++ b/src/event/modules/ngx_epoll_module.c
@@ -66,16 +66,19 @@ int epoll_wait(int epfd, struct epoll_ev
 
 
 typedef struct {
-    u_int  events;
+    ngx_uint_t  events;
 } ngx_epoll_conf_t;
 
 
 static ngx_int_t ngx_epoll_init(ngx_cycle_t *cycle, ngx_msec_t timer);
 static void ngx_epoll_done(ngx_cycle_t *cycle);
-static ngx_int_t ngx_epoll_add_event(ngx_event_t *ev, int event, u_int flags);
-static ngx_int_t ngx_epoll_del_event(ngx_event_t *ev, int event, u_int flags);
+static ngx_int_t ngx_epoll_add_event(ngx_event_t *ev, ngx_int_t event,
+    ngx_uint_t flags);
+static ngx_int_t ngx_epoll_del_event(ngx_event_t *ev, ngx_int_t event,
+    ngx_uint_t flags);
 static ngx_int_t ngx_epoll_add_connection(ngx_connection_t *c);
-static ngx_int_t ngx_epoll_del_connection(ngx_connection_t *c, u_int flags);
+static ngx_int_t ngx_epoll_del_connection(ngx_connection_t *c,
+    ngx_uint_t flags);
 static ngx_int_t ngx_epoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
     ngx_uint_t flags);
 
@@ -84,7 +87,7 @@ static char *ngx_epoll_init_conf(ngx_cyc
 
 static int                  ep = -1;
 static struct epoll_event  *event_list;
-static u_int                nevents;
+static ngx_uint_t           nevents;
 
 
 static ngx_str_t      epoll_name = ngx_string("epoll");
@@ -205,7 +208,7 @@ ngx_epoll_done(ngx_cycle_t *cycle)
 
 
 static ngx_int_t
-ngx_epoll_add_event(ngx_event_t *ev, int event, u_int flags)
+ngx_epoll_add_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
 {
     int                  op;
     uint32_t             events, prev;
@@ -240,7 +243,7 @@ ngx_epoll_add_event(ngx_event_t *ev, int
         op = EPOLL_CTL_ADD;
     }
 
-    ee.events = events | flags;
+    ee.events = events | (uint32_t) flags;
     ee.data.ptr = (void *) ((uintptr_t) c | ev->instance);
 
     ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ev->log, 0,
@@ -263,7 +266,7 @@ ngx_epoll_add_event(ngx_event_t *ev, int
 
 
 static ngx_int_t
-ngx_epoll_del_event(ngx_event_t *ev, int event, u_int flags)
+ngx_epoll_del_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
 {
     int                  op;
     uint32_t             prev;
@@ -295,7 +298,7 @@ ngx_epoll_del_event(ngx_event_t *ev, int
 
     if (e->active) {
         op = EPOLL_CTL_MOD;
-        ee.events = prev | flags;
+        ee.events = prev | (uint32_t) flags;
         ee.data.ptr = (void *) ((uintptr_t) c | ev->instance);
 
     } else {
@@ -345,10 +348,10 @@ ngx_epoll_add_connection(ngx_connection_
 
 
 static ngx_int_t
-ngx_epoll_del_connection(ngx_connection_t *c, u_int flags)
+ngx_epoll_del_connection(ngx_connection_t *c, ngx_uint_t flags)
 {
-    int                  op;
-    struct epoll_event   ee;
+    int                 op;
+    struct epoll_event  ee;
 
     /*
      * when the file descriptor is closed the epoll automatically deletes
@@ -399,7 +402,7 @@ ngx_epoll_process_events(ngx_cycle_t *cy
     ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
                    "epoll timer: %M", timer);
 
-    events = epoll_wait(ep, event_list, nevents, timer);
+    events = epoll_wait(ep, event_list, (int) nevents, timer);
 
     if (events == -1) {
         err = ngx_errno;