summaryrefslogtreecommitdiff
blob: 3cce343186f3c536698826233979a3461b8f168d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 0c4528e50dc45de322a6ae86b1fff544d777e722 Mon Sep 17 00:00:00 2001
From: "Yichun Zhang (agentzh)" <agentzh@gmail.com>
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);
         }