Skip to content

Commit 3101c7f

Browse files
committed
bugfix: compilation failed with nginx cores older than 1.9.0. this regression had appeared in the previous commit.
1 parent 189d266 commit 3101c7f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ The return value is an array-like Lua table for all the primary peers. Each tabl
153153
Timestamp for the last check (in seconds since the Epoch)
154154
* conns
155155

156-
Number of active connections to the peer.
156+
Number of active connections to the peer (this requires NGINX 1.9.0 or above).
157157

158158
[Back to TOC](#table-of-contents)
159159

src/ngx_http_lua_upstream_module.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,11 @@ ngx_http_lua_get_peer(lua_State *L, ngx_http_upstream_rr_peer_t *peer,
438438
lua_pushinteger(L, (lua_Integer) peer->effective_weight);
439439
lua_rawset(L, -3);
440440

441+
#if (nginx_version >= 1009000)
441442
lua_pushliteral(L, "conns");
442443
lua_pushinteger(L, (lua_Integer) peer->conns);
443444
lua_rawset(L, -3);
445+
#endif
444446

445447
lua_pushliteral(L, "fails");
446448
lua_pushinteger(L, (lua_Integer) peer->fails);

0 commit comments

Comments
 (0)