Skip to content

bitreq: Fix connection persistence, pool refresh#661

Open
tnull wants to merge 5 commits into
rust-bitcoin:masterfrom
tnull:2026-07-bitreq-persistence-pool
Open

bitreq: Fix connection persistence, pool refresh#661
tnull wants to merge 5 commits into
rust-bitcoin:masterfrom
tnull:2026-07-bitreq-persistence-pool

Conversation

@tnull

@tnull tnull commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Based on #660.
Closes #659.

Honor HTTP persistence rules

Reuse HTTP/1.1 connections unless either endpoint requests
closure, and require explicit keep-alive only for HTTP/1.0. This
allows compliant servers to omit redundant keep-alive headers while
still preventing reuse after a close option.
Refresh async pool entries on reuse 

A cache hit must make its connection the most recently used entry.
Without that refresh, inserting another origin can evict an actively
reused connection and retain an older idle one.

tnull added 3 commits July 11, 2026 15:21
Exercise the HTTP/1.1 wire grammar so request generation and
response parsing gaps are visible before behavior is changed.

Co-Authored-By: HAL 9000
Cover response length and chunk decoding rules so incomplete or
ambiguous messages cannot pass unnoticed.

Co-Authored-By: HAL 9000
Cover persistence, closure, and pipelining rules so connection
reuse can be corrected against explicit expectations.

Refs: rust-bitcoin#659

Co-Authored-By: HAL 9000
tnull added 2 commits July 13, 2026 10:33
Reuse HTTP/1.1 connections unless either endpoint requests
closure, and require explicit keep-alive only for HTTP/1.0. This
allows compliant servers to omit redundant keep-alive headers while
still preventing reuse after a close option.

Fixes rust-bitcoin#659

Co-Authored-By: HAL 9000
A cache hit must make its connection the most recently used entry.
Without that refresh, inserting another origin can evict an actively
reused connection and retain an older idle one.

Co-Authored-By: HAL 9000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bitreq::Client only reuses an HTTP/1.1 connection when the response explicitly contains Connection: keep-alive

1 participant