@@ -433,65 +433,18 @@ connection must be closed
433
433
[error]
434
434
[warn ]
435
435
436
- === TEST 8 Generic interface, Connection: Keep-alive. pool_only_after_response is on . Test the connection is reused.
436
+ === TEST 8 Generic interface, Connection: Keep-alive. Don't read body and check connection isn't reused
437
437
-- - http_config eval: $::HttpConfig
438
438
-- - config
439
439
location = /a {
440
440
content_by_lua '
441
441
local http = require "resty.http"
442
442
local httpc = http.new()
443
- httpc:connect({
444
- scheme = "http",
445
- host = "127.0.0.1",
446
- port = ngx.var.server_port,
447
- pool_only_after_response = true
448
- })
449
-
450
- local res, err = httpc:request{
451
- path = "/b"
452
- }
453
-
454
- local body = res:read_body()
455
-
456
- ngx.say(res.headers["Connection"])
457
- ngx.say(httpc:set_keepalive())
458
-
459
443
httpc:connect({
460
444
scheme = "http",
461
445
host = "127.0.0.1",
462
446
port = ngx.var.server_port
463
447
})
464
- ngx.say(httpc:get_reused_times())
465
- ' ;
466
- }
467
- location = /b {
468
- content_by_lua '
469
- ngx.say("OK")
470
- ' ;
471
- }
472
- -- - request
473
- GET / a
474
- -- - response_body
475
- keep-alive
476
- 1
477
- 1
478
- -- - no_error_log
479
- [error]
480
- [warn ]
481
-
482
- === TEST 9 Generic interface, Connection: Keep-alive. pool_only_after_response is on. Don't read body and check connection isn't reused
483
- -- - http_config eval: $::HttpConfig
484
- -- - config
485
- location = /a {
486
- content_by_lua '
487
- local http = require "resty.http"
488
- local httpc = http.new()
489
- httpc:connect({
490
- scheme = "http",
491
- host = "127.0.0.1",
492
- port = ngx.var.server_port,
493
- pool_only_after_response = true
494
- })
495
448
496
449
local res, err = httpc:request{
497
450
path = "/b"
@@ -524,7 +477,7 @@ response not fully read
524
477
[error]
525
478
[warn ]
526
479
527
- === TEST 10 Pooling connection immediately after connecting should work
480
+ === TEST 9 Pooling connection immediately after connecting should work
528
481
-- - http_config eval: $::HttpConfig
529
482
-- - config
530
483
location = /a {
@@ -534,8 +487,7 @@ response not fully read
534
487
httpc:connect({
535
488
scheme = "http",
536
489
host = "127.0.0.1",
537
- port = ngx.var.server_port,
538
- pool_only_after_response = true
490
+ port = ngx.var.server_port
539
491
})
540
492
ngx.say(httpc:set_keepalive())
541
493
' ;
@@ -548,7 +500,7 @@ GET /a
548
500
[error]
549
501
[warn ]
550
502
551
- === TEST 11 Reusing client still checks pooling is ready
503
+ === TEST 10 Reused client still checks pooling is ready
552
504
-- - http_config eval: $::HttpConfig
553
505
-- - config
554
506
location = /a {
@@ -558,8 +510,7 @@ GET /a
558
510
httpc:connect({
559
511
scheme = "http",
560
512
host = "127.0.0.1",
561
- port = ngx.var.server_port,
562
- pool_only_after_response = true
513
+ port = ngx.var.server_port
563
514
})
564
515
565
516
local res, err = httpc:request{
@@ -574,8 +525,7 @@ GET /a
574
525
httpc:connect({
575
526
scheme = "http",
576
527
host = "127.0.0.1",
577
- port = ngx.var.server_port,
578
- pool_only_after_response = true
528
+ port = ngx.var.server_port
579
529
})
580
530
ngx.say(httpc:get_reused_times())
581
531
res, err = httpc:request{
@@ -602,7 +552,7 @@ response not fully read
602
552
[error]
603
553
[warn ]
604
554
605
- === TEST 12 pool_only_after_response is on . Test the connection is reused on non-body requests.
555
+ === TEST 11 Test the connection is reused on non-body requests
606
556
-- - http_config eval: $::HttpConfig
607
557
-- - config
608
558
location = /a {
@@ -612,8 +562,7 @@ response not fully read
612
562
httpc:connect({
613
563
scheme = "http",
614
564
host = "127.0.0.1",
615
- port = ngx.var.server_port,
616
- pool_only_after_response = true
565
+ port = ngx.var.server_port
617
566
})
618
567
619
568
local res, err = httpc:request{
0 commit comments