Skip to content

Commit 6477a7b

Browse files
author
Johnny Wang
authored
bugfix: fixed compilation errors when building without SSL.
lua-nginx-module/src/ngx_http_lua_balancer.c: In function ‘ngx_http_lua_balancer_get_peer’: lua-nginx-module/src/ngx_http_lua_balancer.c:389:41: error: variable ‘u’ set but not used [-Werror=unused-but-set-variable] 389 | ngx_http_upstream_t *u; |
1 parent 6738c3a commit 6477a7b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/ngx_http_lua_balancer.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,9 @@ ngx_http_lua_balancer_get_peer(ngx_peer_connection_t *pc, void *data)
386386
ngx_int_t rc;
387387
ngx_connection_t *c;
388388
ngx_http_request_t *r;
389+
#if (NGX_HTTP_SSL)
389390
ngx_http_upstream_t *u;
391+
#endif
390392
ngx_http_lua_ctx_t *ctx;
391393
ngx_http_lua_srv_conf_t *lscf;
392394
ngx_http_lua_balancer_peer_data_t *bp = data;
@@ -395,7 +397,9 @@ ngx_http_lua_balancer_get_peer(ngx_peer_connection_t *pc, void *data)
395397
"lua balancer: get peer, tries: %ui", pc->tries);
396398

397399
r = bp->request;
400+
#if (NGX_HTTP_SSL)
398401
u = r->upstream;
402+
#endif
399403
lscf = bp->conf;
400404

401405
ngx_http_lua_assert(lscf->balancer.handler && r);

0 commit comments

Comments
 (0)