comparison src/event/modules/ngx_poll_module.c @ 5802:a4e9c7e6e062

Events: changed nevents type to unsigned in poll module.
author Yves Crespin <yves.crespin@e-quartz.fr>
date Thu, 07 Aug 2014 14:56:57 +0200
parents 4406168861e8
children ecfc601f1225
comparison
equal deleted inserted replaced
5801:ab48149b77a6 5802:a4e9c7e6e062
20 ngx_uint_t flags); 20 ngx_uint_t flags);
21 static char *ngx_poll_init_conf(ngx_cycle_t *cycle, void *conf); 21 static char *ngx_poll_init_conf(ngx_cycle_t *cycle, void *conf);
22 22
23 23
24 static struct pollfd *event_list; 24 static struct pollfd *event_list;
25 static ngx_int_t nevents; 25 static ngx_uint_t nevents;
26 26
27 27
28 static ngx_str_t poll_name = ngx_string("poll"); 28 static ngx_str_t poll_name = ngx_string("poll");
29 29
30 ngx_event_module_t ngx_poll_module_ctx = { 30 ngx_event_module_t ngx_poll_module_ctx = {
196 "poll del event: fd:%d ev:%i", c->fd, event); 196 "poll del event: fd:%d ev:%i", c->fd, event);
197 197
198 if (e == NULL || e->index == NGX_INVALID_INDEX) { 198 if (e == NULL || e->index == NGX_INVALID_INDEX) {
199 nevents--; 199 nevents--;
200 200
201 if (ev->index < (ngx_uint_t) nevents) { 201 if (ev->index < nevents) {
202 202
203 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0, 203 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
204 "index: copy event %ui to %i", nevents, ev->index); 204 "index: copy event %ui to %i", nevents, ev->index);
205 205
206 event_list[ev->index] = event_list[nevents]; 206 event_list[ev->index] = event_list[nevents];
210 if (c->fd == -1) { 210 if (c->fd == -1) {
211 ngx_log_error(NGX_LOG_ALERT, ev->log, 0, 211 ngx_log_error(NGX_LOG_ALERT, ev->log, 0,
212 "unexpected last event"); 212 "unexpected last event");
213 213
214 } else { 214 } else {
215 if (c->read->index == (ngx_uint_t) nevents) { 215 if (c->read->index == nevents) {
216 c->read->index = ev->index; 216 c->read->index = ev->index;
217 } 217 }
218 218
219 if (c->write->index == (ngx_uint_t) nevents) { 219 if (c->write->index == nevents) {
220 c->write->index = ev->index; 220 c->write->index = ev->index;
221 } 221 }
222 } 222 }
223 } 223 }
224 224
238 static ngx_int_t 238 static ngx_int_t
239 ngx_poll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags) 239 ngx_poll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
240 { 240 {
241 int ready, revents; 241 int ready, revents;
242 ngx_err_t err; 242 ngx_err_t err;
243 ngx_int_t i, nready; 243 ngx_int_t nready;
244 ngx_uint_t found, level; 244 ngx_uint_t i, found, level;
245 ngx_event_t *ev, **queue; 245 ngx_event_t *ev, **queue;
246 ngx_connection_t *c; 246 ngx_connection_t *c;
247 247
248 /* NGX_TIMER_INFINITE == INFTIM */ 248 /* NGX_TIMER_INFINITE == INFTIM */
249 249