Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Mishandled request when 'Transfer-Encoding: chunked' is used on connection reuse. #2374

@timbyr

Description

@timbyr

Issue Type:

  • Bug report
  • Feature request

What happened:

When specifying Transfer-Encoding: chunked when an endpoint is dead and when trying to reuse a connection the second request never gets a response.
For example using curl to connect to a non existent endpoint twice.

curl --header "Transfer-Encoding: chunked" -x 127.0.0.1:4140 10.0.0.170:8000 10.0.0.170:8000

I get

Unable to establish connection to 10.0.0.170:8000.
service name: /svc/10.0.0.170:8000
client name: /$/inet/10.0.0.170/8000
addresses: [10.0.0.170:8000]
selected address: 10.0.0.170:8000

as a response and curl hangs while waiting on a response to the second request.

But when I don't specify transfer encoding it works as expected

curl -x 127.0.0.1:4140 10.0.0.170:8000 10.0.0.170:8000
Unable to establish connection to 10.0.0.170:8000.
service name: /svc/10.0.0.170:8000
client name: /$/inet/10.0.0.170/8000
addresses: [10.0.0.170:8000]
selected address: 10.0.0.170:8000
Unable to establish connection to 10.0.0.170:8000.
service name: /svc/10.0.0.170:8000
client name: /$/inet/10.0.0.170/8000
addresses: [10.0.0.170:8000]
selected address: 10.0.0.170:8000

There is nothing shown in any of the logs. I've confirmed this behaviour with 1.6.4 and 1.7.1. But it works correctly in 1.4.5 and 1.5.2.

Config is below

admin:
  port: 9990
  ip: 0.0.0.0
usage:
  enabled: false
routers:
- protocol: http
  label: incoming
  dtab: |
    /ip-hostport      => /$/inet;
    /ip               => /$/io.buoyant.hostportPfx/ip-hostport;
    /svc              => /ip;
  servers:
  - port: 4140
    ip: 0.0.0.0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions