Skip to content

Commit fa8714e

Browse files
unused vars
1 parent 1ae9e6d commit fa8714e

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

patch/1.27.1.1/ngx_lua-enable_keepalive.patch

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git src/ngx_http_lua_balancer.c src/ngx_http_lua_balancer.c
2-
index ae0f1380..a00286c2 100644
2+
index ae0f1380..f5163e5d 100644
33
--- src/ngx_http_lua_balancer.c
44
+++ src/ngx_http_lua_balancer.c
55
@@ -31,10 +31,39 @@ typedef struct {
@@ -259,18 +259,24 @@ index ae0f1380..a00286c2 100644
259259
}
260260

261261
return NGX_OK;
262-
@@ -582,8 +664,9 @@ ngx_http_lua_balancer_free_peer(ngx_peer_connection_t *pc, void *data,
262+
@@ -577,14 +659,12 @@ static void
263+
ngx_http_lua_balancer_free_peer(ngx_peer_connection_t *pc, void *data,
264+
ngx_uint_t state)
265+
{
266+
- ngx_uint_t hash;
267+
- ngx_str_t *host;
263268
ngx_queue_t *q;
264269
ngx_connection_t *c;
265270
ngx_http_upstream_t *u;
266271
- ngx_http_lua_balancer_ka_item_t *item;
267272
+ ngx_http_lua_balancer_keepalive_item_t *item;
268273
ngx_http_lua_balancer_peer_data_t *bp = data;
274+
- ngx_http_lua_srv_conf_t *lscf = bp->conf;
269275
+ ngx_http_lua_balancer_keepalive_pool_t *cpool;
270-
ngx_http_lua_srv_conf_t *lscf = bp->conf;
271276

272277
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
273-
@@ -592,14 +675,16 @@ ngx_http_lua_balancer_free_peer(ngx_peer_connection_t *pc, void *data,
278+
"lua balancer: free peer, tries: %ui", pc->tries);
279+
@@ -592,14 +672,16 @@ ngx_http_lua_balancer_free_peer(ngx_peer_connection_t *pc, void *data,
274280
u = bp->request->upstream;
275281
c = pc->connection;
276282

@@ -289,7 +295,7 @@ index ae0f1380..a00286c2 100644
289295
if (state & NGX_PEER_FAILED
290296
|| c == NULL
291297
|| c->read->eof
292-
@@ -633,42 +718,41 @@ ngx_http_lua_balancer_free_peer(ngx_peer_connection_t *pc, void *data,
298+
@@ -633,42 +715,41 @@ ngx_http_lua_balancer_free_peer(ngx_peer_connection_t *pc, void *data,
293299
goto invalid;
294300
}
295301

@@ -351,7 +357,7 @@ index ae0f1380..a00286c2 100644
351357

352358
if (c->write->timer_set) {
353359
ngx_del_timer(c->write);
354-
@@ -684,42 +768,6 @@ ngx_http_lua_balancer_free_peer(ngx_peer_connection_t *pc, void *data,
360+
@@ -684,42 +765,6 @@ ngx_http_lua_balancer_free_peer(ngx_peer_connection_t *pc, void *data,
355361
c->write->log = ngx_cycle->log;
356362
c->pool->log = ngx_cycle->log;
357363

@@ -394,7 +400,7 @@ index ae0f1380..a00286c2 100644
394400
if (c->read->ready) {
395401
ngx_http_lua_balancer_close_handler(c->read);
396402
}
397-
@@ -728,9 +776,16 @@ ngx_http_lua_balancer_free_peer(ngx_peer_connection_t *pc, void *data,
403+
@@ -728,9 +773,16 @@ ngx_http_lua_balancer_free_peer(ngx_peer_connection_t *pc, void *data,
398404

399405
invalid:
400406

@@ -414,7 +420,7 @@ index ae0f1380..a00286c2 100644
414420
}
415421

416422
return;
417-
@@ -740,6 +795,123 @@ invalid:
423+
@@ -740,6 +792,123 @@ invalid:
418424
}
419425

420426

@@ -538,7 +544,7 @@ index ae0f1380..a00286c2 100644
538544
static void
539545
ngx_http_lua_balancer_notify_peer(ngx_peer_connection_t *pc, void *data,
540546
ngx_uint_t type)
541-
@@ -755,6 +927,10 @@ ngx_http_lua_balancer_notify_peer(ngx_peer_connection_t *pc, void *data,
547+
@@ -755,6 +924,10 @@ ngx_http_lua_balancer_notify_peer(ngx_peer_connection_t *pc, void *data,
542548
static void
543549
ngx_http_lua_balancer_close(ngx_connection_t *c)
544550
{
@@ -549,7 +555,7 @@ index ae0f1380..a00286c2 100644
549555
#if (NGX_HTTP_SSL)
550556
if (c->ssl) {
551557
c->ssl->no_wait_shutdown = 1;
552-
@@ -762,9 +938,6 @@ ngx_http_lua_balancer_close(ngx_connection_t *c)
558+
@@ -762,9 +935,6 @@ ngx_http_lua_balancer_close(ngx_connection_t *c)
553559

554560
if (ngx_ssl_shutdown(c) == NGX_AGAIN) {
555561
c->ssl->handler = ngx_http_lua_balancer_close;
@@ -559,7 +565,7 @@ index ae0f1380..a00286c2 100644
559565
return;
560566
}
561567
}
562-
@@ -773,8 +946,12 @@ ngx_http_lua_balancer_close(ngx_connection_t *c)
568+
@@ -773,8 +943,12 @@ ngx_http_lua_balancer_close(ngx_connection_t *c)
563569
ngx_destroy_pool(c->pool);
564570
ngx_close_connection(c);
565571

@@ -574,7 +580,7 @@ index ae0f1380..a00286c2 100644
574580
}
575581

576582

577-
@@ -789,7 +966,7 @@ ngx_http_lua_balancer_dummy_handler(ngx_event_t *ev)
583+
@@ -789,7 +963,7 @@ ngx_http_lua_balancer_dummy_handler(ngx_event_t *ev)
578584
static void
579585
ngx_http_lua_balancer_close_handler(ngx_event_t *ev)
580586
{
@@ -583,7 +589,7 @@ index ae0f1380..a00286c2 100644
583589

584590
int n;
585591
char buf[1];
586-
@@ -820,8 +997,10 @@ close:
592+
@@ -820,8 +994,10 @@ close:
587593
ngx_http_lua_balancer_close(c);
588594

589595
ngx_queue_remove(&item->queue);
@@ -596,7 +602,7 @@ index ae0f1380..a00286c2 100644
596602
}
597603

598604

599-
@@ -832,7 +1011,7 @@ ngx_http_lua_balancer_set_session(ngx_peer_connection_t *pc, void *data)
605+
@@ -832,7 +1008,7 @@ ngx_http_lua_balancer_set_session(ngx_peer_connection_t *pc, void *data)
600606
{
601607
ngx_http_lua_balancer_peer_data_t *bp = data;
602608

@@ -605,7 +611,7 @@ index ae0f1380..a00286c2 100644
605611
/* TODO */
606612
return NGX_OK;
607613
}
608-
@@ -846,7 +1025,7 @@ ngx_http_lua_balancer_save_session(ngx_peer_connection_t *pc, void *data)
614+
@@ -846,7 +1022,7 @@ ngx_http_lua_balancer_save_session(ngx_peer_connection_t *pc, void *data)
609615
{
610616
ngx_http_lua_balancer_peer_data_t *bp = data;
611617

@@ -614,7 +620,7 @@ index ae0f1380..a00286c2 100644
614620
/* TODO */
615621
return;
616622
}
617-
@@ -859,9 +1038,8 @@ ngx_http_lua_balancer_save_session(ngx_peer_connection_t *pc, void *data)
623+
@@ -859,9 +1035,8 @@ ngx_http_lua_balancer_save_session(ngx_peer_connection_t *pc, void *data)
618624

619625
int
620626
ngx_http_lua_ffi_balancer_set_current_peer(ngx_http_request_t *r,
@@ -626,7 +632,7 @@ index ae0f1380..a00286c2 100644
626632
{
627633
ngx_url_t url;
628634
ngx_http_lua_ctx_t *ctx;
629-
@@ -927,25 +1105,8 @@ ngx_http_lua_ffi_balancer_set_current_peer(ngx_http_request_t *r,
635+
@@ -927,25 +1102,8 @@ ngx_http_lua_ffi_balancer_set_current_peer(ngx_http_request_t *r,
630636
return NGX_ERROR;
631637
}
632638

@@ -654,7 +660,7 @@ index ae0f1380..a00286c2 100644
654660

655661
return NGX_OK;
656662
}
657-
@@ -1050,11 +1211,15 @@ ngx_http_lua_ffi_balancer_enable_keepalive(ngx_http_request_t *r,
663+
@@ -1050,11 +1208,15 @@ ngx_http_lua_ffi_balancer_enable_keepalive(ngx_http_request_t *r,
658664

659665
bp = (ngx_http_lua_balancer_peer_data_t *) u->peer.data;
660666

0 commit comments

Comments
 (0)