comparison src/event/modules/ngx_eventport_module.c @ 326:f70f2f565fe0 NGINX_0_5_33

nginx 0.5.33 *) Change: now by default the "echo" SSI command uses entity encoding. *) Feature: the "encoding" parameter in the "echo" SSI command. *) Change: mail proxy was split on three modules: pop3, imap and smtp. *) Feature: the --without-mail_pop3_module, --without-mail_imap_module, and --without-mail_smtp_module configuration parameters. *) Feature: the "smtp_greeting_delay" and "smtp_client_buffer" directives of the ngx_mail_smtp_module. *) Feature: the "server_name" and "valid_referers" directives support regular expressions. *) Feature: the "server_name", "map", and "valid_referers" directives support the "www.example.*" wildcards. *) Bugfix: sub_filter did not work with empty substitution. *) Bugfix: in sub_filter parsing. *) Bugfix: a worker process may got caught in an endless loop, if the memcached was used. *) Bugfix: nginx supported low case only "close" and "keep-alive" values in the "Connection" request header line; bug appeared in 0.5.32. *) Bugfix: nginx could not start on Solaris if the shared PCRE library located in non-standard place was used.
author Igor Sysoev <http://sysoev.ru>
date Wed, 07 Nov 2007 00:00:00 +0300
parents 24def6198d7f
children 2eea67ed0bc2
comparison
equal deleted inserted replaced
325:5bb1b28ddeaa 326:f70f2f565fe0
38 typedef struct port_notify { 38 typedef struct port_notify {
39 int portnfy_port; /* bind request(s) to port */ 39 int portnfy_port; /* bind request(s) to port */
40 void *portnfy_user; /* user defined */ 40 void *portnfy_user; /* user defined */
41 } port_notify_t; 41 } port_notify_t;
42 42
43 typedef struct itimerspec { /* definition per POSIX.4 */ 43 typedef struct itimerspec { /* definition per POSIX.4 */
44 struct timespec it_interval; /* timer period */ 44 struct timespec it_interval;/* timer period */
45 struct timespec it_value; /* timer expiration */ 45 struct timespec it_value; /* timer expiration */
46 } itimerspec_t; 46 } itimerspec_t;
47 47
48 int port_create(void) 48 int port_create(void)
49 { 49 {
50 return -1; 50 return -1;
85 85
86 #endif 86 #endif
87 87
88 88
89 typedef struct { 89 typedef struct {
90 u_int events; 90 ngx_uint_t events;
91 } ngx_eventport_conf_t; 91 } ngx_eventport_conf_t;
92 92
93 93
94 static ngx_int_t ngx_eventport_init(ngx_cycle_t *cycle, ngx_msec_t timer); 94 static ngx_int_t ngx_eventport_init(ngx_cycle_t *cycle, ngx_msec_t timer);
95 static void ngx_eventport_done(ngx_cycle_t *cycle); 95 static void ngx_eventport_done(ngx_cycle_t *cycle);
96 static ngx_int_t ngx_eventport_add_event(ngx_event_t *ev, int event, 96 static ngx_int_t ngx_eventport_add_event(ngx_event_t *ev, ngx_int_t event,
97 u_int flags); 97 ngx_uint_t flags);
98 static ngx_int_t ngx_eventport_del_event(ngx_event_t *ev, int event, 98 static ngx_int_t ngx_eventport_del_event(ngx_event_t *ev, ngx_int_t event,
99 u_int flags); 99 ngx_uint_t flags);
100 static ngx_int_t ngx_eventport_process_events(ngx_cycle_t *cycle, 100 static ngx_int_t ngx_eventport_process_events(ngx_cycle_t *cycle,
101 ngx_msec_t timer, ngx_uint_t flags); 101 ngx_msec_t timer, ngx_uint_t flags);
102 102
103 static void *ngx_eventport_create_conf(ngx_cycle_t *cycle); 103 static void *ngx_eventport_create_conf(ngx_cycle_t *cycle);
104 static char *ngx_eventport_init_conf(ngx_cycle_t *cycle, void *conf); 104 static char *ngx_eventport_init_conf(ngx_cycle_t *cycle, void *conf);
105 105
106 static int ep = -1; 106 static int ep = -1;
107 static port_event_t *event_list; 107 static port_event_t *event_list;
108 static u_int nevents; 108 static ngx_uint_t nevents;
109 static timer_t event_timer = -1; 109 static timer_t event_timer = -1;
110 110
111 static ngx_str_t eventport_name = ngx_string("eventport"); 111 static ngx_str_t eventport_name = ngx_string("eventport");
112 112
113 113
259 nevents = 0; 259 nevents = 0;
260 } 260 }
261 261
262 262
263 static ngx_int_t 263 static ngx_int_t
264 ngx_eventport_add_event(ngx_event_t *ev, int event, u_int flags) 264 ngx_eventport_add_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
265 { 265 {
266 int events, prev; 266 ngx_int_t events, prev;
267 ngx_event_t *e; 267 ngx_event_t *e;
268 ngx_connection_t *c; 268 ngx_connection_t *c;
269 269
270 c = ev->data; 270 c = ev->data;
271 271
289 if (e->oneshot) { 289 if (e->oneshot) {
290 events |= prev; 290 events |= prev;
291 } 291 }
292 292
293 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0, 293 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
294 "eventport add event: fd:%d ev:%04Xd", c->fd, events); 294 "eventport add event: fd:%d ev:%04Xi", c->fd, events);
295 295
296 if (port_associate(ep, PORT_SOURCE_FD, c->fd, events, 296 if (port_associate(ep, PORT_SOURCE_FD, c->fd, events,
297 (void *) ((uintptr_t) ev | ev->instance)) 297 (void *) ((uintptr_t) ev | ev->instance))
298 == -1) 298 == -1)
299 { 299 {
308 return NGX_OK; 308 return NGX_OK;
309 } 309 }
310 310
311 311
312 static ngx_int_t 312 static ngx_int_t
313 ngx_eventport_del_event(ngx_event_t *ev, int event, u_int flags) 313 ngx_eventport_del_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
314 { 314 {
315 ngx_event_t *e; 315 ngx_event_t *e;
316 ngx_connection_t *c; 316 ngx_connection_t *c;
317 317
318 /* 318 /*
338 event = POLLIN; 338 event = POLLIN;
339 } 339 }
340 340
341 if (e->oneshot) { 341 if (e->oneshot) {
342 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0, 342 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
343 "eventport change event: fd:%d ev:%04Xd", c->fd, event); 343 "eventport change event: fd:%d ev:%04Xi", c->fd, event);
344 344
345 if (port_associate(ep, PORT_SOURCE_FD, c->fd, event, 345 if (port_associate(ep, PORT_SOURCE_FD, c->fd, event,
346 (void *) ((uintptr_t) ev | ev->instance)) 346 (void *) ((uintptr_t) ev | ev->instance))
347 == -1) 347 == -1)
348 { 348 {
394 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, 394 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
395 "eventport timer: %M", timer); 395 "eventport timer: %M", timer);
396 396
397 events = 1; 397 events = 1;
398 398
399 n = port_getn(ep, event_list, nevents, &events, tp); 399 n = port_getn(ep, event_list, (u_int) nevents, &events, tp);
400 400
401 err = ngx_errno; 401 err = ngx_errno;
402 402
403 if (flags & NGX_UPDATE_TIME) { 403 if (flags & NGX_UPDATE_TIME) {
404 ngx_time_update(0, 0); 404 ngx_time_update(0, 0);