mirror of https://github.com/openresty/openresty
updated resolver_wev_handler_segfault_with_poll.patch to Ruslan Ermilov's version.
parent
fc1929f37d
commit
8e35463045
@ -1,29 +1,31 @@
|
|||||||
--- nginx-1.2.6/src/core/ngx_resolver.c 2012-11-12 10:47:07.000000000 -0800
|
--- nginx-1.2.6/src/event/modules/ngx_poll_module.c 2012-01-18 07:07:43.000000000 -0800
|
||||||
+++ nginx-1.2.6-patched/src/core/ngx_resolver.c 2013-01-22 14:52:42.716434183 -0800
|
+++ nginx-1.2.6-patched/src/event/modules/ngx_poll_module.c 2013-01-23 12:34:13.990781456 -0800
|
||||||
@@ -91,6 +91,7 @@ static void *ngx_resolver_dup(ngx_resolv
|
@@ -367,11 +367,18 @@ ngx_poll_process_events(ngx_cycle_t *cyc
|
||||||
static in_addr_t *ngx_resolver_rotate(ngx_resolver_t *r, in_addr_t *src,
|
*/
|
||||||
ngx_uint_t n);
|
|
||||||
static u_char *ngx_resolver_log_error(ngx_log_t *log, u_char *buf, size_t len);
|
|
||||||
+static void ngx_resolver_empty_handler(ngx_event_t *ev);
|
|
||||||
|
|
||||||
|
revents |= POLLIN|POLLOUT;
|
||||||
ngx_resolver_t *
|
+ if (c->read->active) {
|
||||||
@@ -2258,6 +2259,8 @@ ngx_udp_connect(ngx_udp_connection_t *uc
|
+ revents |= POLLIN;
|
||||||
rev->log = &uc->log;
|
+ }
|
||||||
wev->log = &uc->log;
|
|
||||||
|
|
||||||
+ wev->handler = ngx_resolver_empty_handler;
|
|
||||||
+
|
+
|
||||||
uc->connection = c;
|
+ if (c->write->active) {
|
||||||
|
+ revents |= POLLOUT;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
found = 0;
|
||||||
|
|
||||||
c->number = ngx_atomic_fetch_add(ngx_connection_counter, 1);
|
- if (revents & POLLIN) {
|
||||||
@@ -2311,3 +2314,9 @@ ngx_udp_connect(ngx_udp_connection_t *uc
|
+ if ((revents & POLLIN) && c->read->active) {
|
||||||
|
found = 1;
|
||||||
|
|
||||||
return NGX_OK;
|
ev = c->read;
|
||||||
|
@@ -388,7 +395,7 @@ ngx_poll_process_events(ngx_cycle_t *cyc
|
||||||
|
ngx_locked_post_event(ev, queue);
|
||||||
}
|
}
|
||||||
+
|
|
||||||
+
|
- if (revents & POLLOUT) {
|
||||||
+static void
|
+ if ((revents & POLLOUT) && c->write->active) {
|
||||||
+ngx_resolver_empty_handler(ngx_event_t *ev)
|
found = 1;
|
||||||
+{
|
ev = c->write;
|
||||||
+}
|
|
||||||
|
@ -1,29 +1,31 @@
|
|||||||
--- nginx-1.3.7/src/core/ngx_resolver.c 2012-11-12 10:47:07.000000000 -0800
|
--- nginx-1.3.7/src/event/modules/ngx_poll_module.c 2012-01-18 07:07:43.000000000 -0800
|
||||||
+++ nginx-1.3.7-patched/src/core/ngx_resolver.c 2013-01-22 14:52:42.716434183 -0800
|
+++ nginx-1.3.7-patched/src/event/modules/ngx_poll_module.c 2013-01-23 12:34:13.990781456 -0800
|
||||||
@@ -91,6 +91,7 @@ static void *ngx_resolver_dup(ngx_resolv
|
@@ -367,11 +367,18 @@ ngx_poll_process_events(ngx_cycle_t *cyc
|
||||||
static in_addr_t *ngx_resolver_rotate(ngx_resolver_t *r, in_addr_t *src,
|
*/
|
||||||
ngx_uint_t n);
|
|
||||||
static u_char *ngx_resolver_log_error(ngx_log_t *log, u_char *buf, size_t len);
|
|
||||||
+static void ngx_resolver_empty_handler(ngx_event_t *ev);
|
|
||||||
|
|
||||||
|
revents |= POLLIN|POLLOUT;
|
||||||
ngx_resolver_t *
|
+ if (c->read->active) {
|
||||||
@@ -2258,6 +2259,8 @@ ngx_udp_connect(ngx_udp_connection_t *uc
|
+ revents |= POLLIN;
|
||||||
rev->log = &uc->log;
|
+ }
|
||||||
wev->log = &uc->log;
|
|
||||||
|
|
||||||
+ wev->handler = ngx_resolver_empty_handler;
|
|
||||||
+
|
+
|
||||||
uc->connection = c;
|
+ if (c->write->active) {
|
||||||
|
+ revents |= POLLOUT;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
found = 0;
|
||||||
|
|
||||||
c->number = ngx_atomic_fetch_add(ngx_connection_counter, 1);
|
- if (revents & POLLIN) {
|
||||||
@@ -2311,3 +2314,9 @@ ngx_udp_connect(ngx_udp_connection_t *uc
|
+ if ((revents & POLLIN) && c->read->active) {
|
||||||
|
found = 1;
|
||||||
|
|
||||||
return NGX_OK;
|
ev = c->read;
|
||||||
|
@@ -388,7 +395,7 @@ ngx_poll_process_events(ngx_cycle_t *cyc
|
||||||
|
ngx_locked_post_event(ev, queue);
|
||||||
}
|
}
|
||||||
+
|
|
||||||
+
|
- if (revents & POLLOUT) {
|
||||||
+static void
|
+ if ((revents & POLLOUT) && c->write->active) {
|
||||||
+ngx_resolver_empty_handler(ngx_event_t *ev)
|
found = 1;
|
||||||
+{
|
ev = c->write;
|
||||||
+}
|
|
||||||
|
Loading…
Reference in New Issue