Skip to content

Conversation

@icing
Copy link
Contributor

@icing icing commented Nov 3, 2025

Add protocol handler flag PROTOPT_CONN_REUSE to indicate that the protocol allows reusing connections for other tranfers. Add that to all handlers that support it.

Create connections with conn->bits.close = FALSE and remove all the connkeep() calls in protocol handlers setup/connect implementations. PROTOPT_CONN_REUSE assures that the default behaviour applies at the end of a transfer without need to juggle the close bit.

conn->bits.close now serves as an additional indication that a connection cannot be reused. Only protocol handles that allow reuse need to set it to override the default behaviour.

Remove all connclose() and connkeep() calls from connection filters. Filters should not modify connection flags. They are supposed to run in eyeballing situations where a filter is just one of many determining the outcome.

Fix http response header handling to only honour Connection: close for HTTP/1.x versions.

@icing icing requested review from bagder November 3, 2025 12:56
Copy link
Member

@bagder bagder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me like!

Add protocol handler flag `PROTOPT_CONN_REUSE` to indicate that the
protocol allows reusing connections for other tranfers. Add that
to all handlers that support it.

Create connections with `conn->bits.close = FALSE` and remove all
the `connkeep()` calls in protocol handlers setup/connect implementations.
`PROTOPT_CONN_REUSE` assures that the default behaviour applies
at the end of a transfer without need to juggle the close bit.

`conn->bits.close` now serves as an additional indication that a
connection cannot be reused. Only protocol handles that allow
reuse need to set it to override the default behaviour.

Remove all `connclose()` and `connkeep()` calls from connection
filters. Filters should not modify connection flags. They are
supposed to run in eyeballing situations where a filter is just
one of many determining the outcome.

Fix http response header handling to only honour `Connection: close`
for HTTP/1.x versions.
@icing icing force-pushed the conncontrol-revisit branch from 4a27f97 to 0ce42ed Compare November 25, 2025 15:27
@icing icing requested a review from bagder November 26, 2025 11:02
@bagder bagder closed this in feea968 Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants