@@ -433,65 +433,18 @@ connection must be closed
433433[error]
434434[warn ]
435435
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
437437-- - http_config eval: $::HttpConfig
438438-- - config
439439 location = /a {
440440 content_by_lua '
441441 local http = require "resty.http"
442442 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-
459443 httpc:connect({
460444 scheme = "http",
461445 host = "127.0.0.1",
462446 port = ngx.var.server_port
463447 })
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- })
495448
496449 local res, err = httpc:request{
497450 path = "/b"
@@ -524,7 +477,7 @@ response not fully read
524477[error]
525478[warn ]
526479
527- === TEST 10 Pooling connection immediately after connecting should work
480+ === TEST 9 Pooling connection immediately after connecting should work
528481-- - http_config eval: $::HttpConfig
529482-- - config
530483 location = /a {
@@ -534,8 +487,7 @@ response not fully read
534487 httpc:connect({
535488 scheme = "http",
536489 host = "127.0.0.1",
537- port = ngx.var.server_port,
538- pool_only_after_response = true
490+ port = ngx.var.server_port
539491 })
540492 ngx.say(httpc:set_keepalive())
541493 ' ;
@@ -548,7 +500,7 @@ GET /a
548500[error]
549501[warn ]
550502
551- === TEST 11 Reusing client still checks pooling is ready
503+ === TEST 10 Reused client still checks pooling is ready
552504-- - http_config eval: $::HttpConfig
553505-- - config
554506 location = /a {
@@ -558,8 +510,7 @@ GET /a
558510 httpc:connect({
559511 scheme = "http",
560512 host = "127.0.0.1",
561- port = ngx.var.server_port,
562- pool_only_after_response = true
513+ port = ngx.var.server_port
563514 })
564515
565516 local res, err = httpc:request{
@@ -574,8 +525,7 @@ GET /a
574525 httpc:connect({
575526 scheme = "http",
576527 host = "127.0.0.1",
577- port = ngx.var.server_port,
578- pool_only_after_response = true
528+ port = ngx.var.server_port
579529 })
580530 ngx.say(httpc:get_reused_times())
581531 res, err = httpc:request{
@@ -602,7 +552,7 @@ response not fully read
602552[error]
603553[warn ]
604554
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
606556-- - http_config eval: $::HttpConfig
607557-- - config
608558 location = /a {
@@ -612,8 +562,7 @@ response not fully read
612562 httpc:connect({
613563 scheme = "http",
614564 host = "127.0.0.1",
615- port = ngx.var.server_port,
616- pool_only_after_response = true
565+ port = ngx.var.server_port
617566 })
618567
619568 local res, err = httpc:request{
0 commit comments