From 0c4528e50dc45de322a6ae86b1fff544d777e722 Mon Sep 17 00:00:00 2001 From: "Yichun Zhang (agentzh)" Date: Wed, 17 Sep 2014 13:18:42 -0700 Subject: [PATCH] bugfix: fixed compilation error with nginx 1.7.5+ because nginx 1.7.5+ changes the API in the events subsystem. thanks Charles R. Portwood II and Mathieu Le Marec for the report in #422. --- src/ngx_http_lua_socket_tcp.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ngx_http_lua_socket_tcp.c b/src/ngx_http_lua_socket_tcp.c index 52cc89d..3743548 100644 --- a/src/ngx_http_lua_socket_tcp.c +++ b/src/ngx_http_lua_socket_tcp.c @@ -3212,7 +3212,11 @@ ngx_http_lua_socket_tcp_finalize_read_part(ngx_http_request_t *r, ngx_del_event(c->read, NGX_READ_EVENT, NGX_CLOSE_EVENT); } +#if defined(nginx_version) && nginx_version >= 1007005 + if (c->read->posted) { +#else if (c->read->prev) { +#endif ngx_delete_posted_event(c->read); } @@ -3261,7 +3265,11 @@ ngx_http_lua_socket_tcp_finalize_write_part(ngx_http_request_t *r, ngx_del_event(c->write, NGX_WRITE_EVENT, NGX_CLOSE_EVENT); } +#if defined(nginx_version) && nginx_version >= 1007005 + if (c->write->posted) { +#else if (c->write->prev) { +#endif ngx_delete_posted_event(c->write); }