This commit is contained in:
agentzh (章亦春)
2012-06-07 17:50:33 +08:00
parent 938d3731c8
commit 914c4c5ac4
3 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,36 @@
--- nginx-1.0.15/src/event/modules/ngx_poll_module.c 2012-02-06 04:02:59.000000000 +0800
+++ nginx-1.0.15-patched/src/event/modules/ngx_poll_module.c 2012-06-07 17:22:43.538168219 +0800
@@ -205,19 +205,21 @@
event_list[ev->index] = event_list[nevents];
- c = ngx_cycle->files[event_list[nevents].fd];
+ if (ngx_cycle->files) {
+ c = ngx_cycle->files[event_list[nevents].fd];
- if (c->fd == -1) {
- ngx_log_error(NGX_LOG_ALERT, ev->log, 0,
- "unexpected last event");
-
- } else {
- if (c->read->index == (ngx_uint_t) nevents) {
- c->read->index = ev->index;
- }
-
- if (c->write->index == (ngx_uint_t) nevents) {
- c->write->index = ev->index;
+ if (c->fd == -1) {
+ ngx_log_error(NGX_LOG_ALERT, ev->log, 0,
+ "unexpected last event");
+
+ } else {
+ if (c->read->index == (ngx_uint_t) nevents) {
+ c->read->index = ev->index;
+ }
+
+ if (c->write->index == (ngx_uint_t) nevents) {
+ c->write->index = ev->index;
+ }
}
}
}