Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Reset c->pipeline on the keepalive path - #1600

#1600
Draft
VadimZhestikov wants to merge 1 commit into
nginx:masternginx/nginx:masterfrom
VadimZhestikov:fix/keepalive-reset-pipelineVadimZhestikov/nginx:fix/keepalive-reset-pipelineCopy head branch name to clipboard
Draft

Reset c->pipeline on the keepalive path#1600
VadimZhestikov wants to merge 1 commit into
nginx:masternginx/nginx:masterfrom
VadimZhestikov:fix/keepalive-reset-pipelineVadimZhestikov/nginx:fix/keepalive-reset-pipelineCopy head branch name to clipboard

Conversation

@VadimZhestikov

Copy link
Copy Markdown
Contributor

Problem

c->pipeline is set to 1 in ngx_http_set_keepalive() when a
pipelined request is present in the connection buffer, and it is read in
ngx_http_finalize_connection() as one of the conditions that forces a
lingering close.

The flag is never cleared when a new request starts on a kept-alive
connection (ngx_http_keepalive_handler() resets c->sent and
c->destroyed, but not c->pipeline). As a result the flag can persist
across the keepalive boundary and trigger an unnecessary lingering close
for a later request that was not actually pipelined.

Fix

Reset c->pipeline = 0 in ngx_http_keepalive_handler() alongside the
existing c->sent/c->destroyed resets, restoring the flag's intended
present-tense meaning.

Impact is limited to a needless lingering close (no memory-safety or
security effect); this is a correctness cleanup.

Testing

Builds cleanly (--with-http_ssl_module --with-stream --with-stream_ssl_module --with-debug); no new warnings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

c->pipeline is set when a pipelined request is read from the
connection buffer, and it is used later to force lingering close
in ngx_http_finalize_connection().  It was never cleared when a
new request begins on a kept-alive connection, so the flag could
persist and cause an unnecessary lingering close for a subsequent
request that was not pipelined.

Reset c->pipeline in ngx_http_keepalive_handler() alongside the
existing c->sent and c->destroyed resets, restoring its intended
present-tense meaning.

Reported by fdgnneig.
@VadimZhestikov
VadimZhestikov force-pushed the fix/keepalive-reset-pipeline branch from 3b1a40a to 11f3ae3 Compare July 22, 2026 23:15
@VadimZhestikov VadimZhestikov self-assigned this Jul 22, 2026
@VadimZhestikov
VadimZhestikov marked this pull request as draft July 22, 2026 23:26
@VadimZhestikov
VadimZhestikov requested a review from pluknet July 22, 2026 23:26
@sindhushiv sindhushiv moved this from New to In Progress in NGINX OSS Unified Workspace Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.