@@ -1087,6 +1087,7 @@ ngx_http_lua_socket_tcp_connect(lua_State *L)
10871087
10881088 if (lua_isfunction (L , -1 )) {
10891089 on_push_cb_ref = luaL_ref (L , LUA_REGISTRYINDEX );
1090+
10901091 } else {
10911092 if (!lua_isnil (L , -1 )) {
10921093 msg = lua_pushfstring (L , "bad \"on_push\" option type: %s" ,
@@ -4555,6 +4556,7 @@ ngx_http_lua_socket_tcp_finalize(ngx_http_request_t *r,
45554556 if (L != NULL ) {
45564557 luaL_unref (L , LUA_REGISTRYINDEX , u -> on_push_cb_ref );
45574558 }
4559+
45584560 u -> on_push_cb_ref = LUA_NOREF ;
45594561 }
45604562
@@ -5773,6 +5775,7 @@ ngx_http_lua_socket_tcp_setkeepalive(lua_State *L)
57735775 if (evict_L != NULL ) {
57745776 luaL_unref (evict_L , LUA_REGISTRYINDEX , item -> on_push_cb_ref );
57755777 }
5778+
57765779 item -> on_push_cb_ref = LUA_NOREF ;
57775780 }
57785781
@@ -6072,6 +6075,7 @@ ngx_http_lua_socket_keepalive_close_handler(ngx_event_t *ev)
60726075 lua_pop (L , 2 );
60736076 goto close ;
60746077 }
6078+
60756079 nsent += w ;
60766080 }
60776081 }
@@ -6100,6 +6104,7 @@ ngx_http_lua_socket_keepalive_close_handler(ngx_event_t *ev)
61006104 if (close_L != NULL ) {
61016105 luaL_unref (close_L , LUA_REGISTRYINDEX , item -> on_push_cb_ref );
61026106 }
6107+
61036108 item -> on_push_cb_ref = LUA_NOREF ;
61046109 }
61056110
@@ -6160,6 +6165,7 @@ ngx_http_lua_socket_shutdown_pool_helper(ngx_http_lua_socket_pool_t *spool)
61606165 if (close_L != NULL ) {
61616166 luaL_unref (close_L , LUA_REGISTRYINDEX , item -> on_push_cb_ref );
61626167 }
6168+
61636169 item -> on_push_cb_ref = LUA_NOREF ;
61646170 }
61656171
0 commit comments