diff src/event/modules/ngx_eventport_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 fc223117327f
children a39aab45a53f
line wrap: on
line diff
--- a/src/event/modules/ngx_eventport_module.c
+++ b/src/event/modules/ngx_eventport_module.c
@@ -40,9 +40,9 @@ typedef struct  port_notify {
     void       *portnfy_user;   /* user defined */
 } port_notify_t;
 
-typedef struct itimerspec {         /* definition per POSIX.4 */
-    struct timespec it_interval;    /* timer period */
-    struct timespec it_value;       /* timer expiration */
+typedef struct itimerspec {     /* definition per POSIX.4 */
+    struct timespec it_interval;/* timer period */
+    struct timespec it_value;   /* timer expiration */
 } itimerspec_t;
 
 int port_create(void)
@@ -87,16 +87,16 @@ int timer_delete(timer_t timerid)
 
 
 typedef struct {
-    u_int  events;
+    ngx_uint_t  events;
 } ngx_eventport_conf_t;
 
 
 static ngx_int_t ngx_eventport_init(ngx_cycle_t *cycle, ngx_msec_t timer);
 static void ngx_eventport_done(ngx_cycle_t *cycle);
-static ngx_int_t ngx_eventport_add_event(ngx_event_t *ev, int event,
-    u_int flags);
-static ngx_int_t ngx_eventport_del_event(ngx_event_t *ev, int event,
-    u_int flags);
+static ngx_int_t ngx_eventport_add_event(ngx_event_t *ev, ngx_int_t event,
+    ngx_uint_t flags);
+static ngx_int_t ngx_eventport_del_event(ngx_event_t *ev, ngx_int_t event,
+    ngx_uint_t flags);
 static ngx_int_t ngx_eventport_process_events(ngx_cycle_t *cycle,
     ngx_msec_t timer, ngx_uint_t flags);
 
@@ -105,7 +105,7 @@ static char *ngx_eventport_init_conf(ngx
 
 static int            ep = -1;
 static port_event_t  *event_list;
-static u_int          nevents;
+static ngx_uint_t     nevents;
 static timer_t        event_timer = -1;
 
 static ngx_str_t      eventport_name = ngx_string("eventport");
@@ -261,9 +261,9 @@ ngx_eventport_done(ngx_cycle_t *cycle)
 
 
 static ngx_int_t
-ngx_eventport_add_event(ngx_event_t *ev, int event, u_int flags)
+ngx_eventport_add_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
 {
-    int                events, prev;
+    ngx_int_t          events, prev;
     ngx_event_t       *e;
     ngx_connection_t  *c;
 
@@ -291,7 +291,7 @@ ngx_eventport_add_event(ngx_event_t *ev,
     }
 
     ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
-                   "eventport add event: fd:%d ev:%04Xd", c->fd, events);
+                   "eventport add event: fd:%d ev:%04Xi", c->fd, events);
 
     if (port_associate(ep, PORT_SOURCE_FD, c->fd, events,
                        (void *) ((uintptr_t) ev | ev->instance))
@@ -310,7 +310,7 @@ ngx_eventport_add_event(ngx_event_t *ev,
 
 
 static ngx_int_t
-ngx_eventport_del_event(ngx_event_t *ev, int event, u_int flags)
+ngx_eventport_del_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
 {
     ngx_event_t       *e;
     ngx_connection_t  *c;
@@ -340,7 +340,7 @@ ngx_eventport_del_event(ngx_event_t *ev,
 
     if (e->oneshot) {
         ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
-                       "eventport change event: fd:%d ev:%04Xd", c->fd, event);
+                       "eventport change event: fd:%d ev:%04Xi", c->fd, event);
 
         if (port_associate(ep, PORT_SOURCE_FD, c->fd, event,
                            (void *) ((uintptr_t) ev | ev->instance))
@@ -396,7 +396,7 @@ ngx_eventport_process_events(ngx_cycle_t
 
     events = 1;
 
-    n = port_getn(ep, event_list, nevents, &events, tp);
+    n = port_getn(ep, event_list, (u_int) nevents, &events, tp);
 
     err = ngx_errno;