Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http_client: mark connection as non-reuseable on failure #2323

Merged
merged 1 commit into from
Jul 3, 2020

Conversation

fujimotos
Copy link
Member

flb_http_client supports internal buffer size limit. If server
tries to send more data than the maximum size limit, the client
will refuse to receive it.

This behaviour is problematic when combined with keep-alive mode;
Since flb_http_do() can leave some data in the socket, the next
HTTP request can be confused by the leftover.

For example, if the socket has the following data (unread):

"data":["from", "previous", "conn"]}

The next HTTP request will see the following response:

"data":["from", "previous", "conn"]}HTTP/1.1 200 OK
Content-Type: text/html
Accept-Ranges: bytes
Last-Modified: Sat, 30 May 2020 23:47:16 GMT
...

This bug is originally reported by @gitfool on #960 (comment).

Signed-off-by: Fujimoto Seiji fujimoto@ceptord.net

flb_http_client supports internal buffer size limit. If server
tries to send more data than the maximum size limit, the client
will refuse to receive it.

This behaviour is problematic when combined with keep-alive mode;
Since flb_http_do() can leave some data in the socket, the next
HTTP request can be confused by the leftover.

For example, if the socket has the following data (unread):

    "data":["from", "previous", "conn"]}

The next HTTP request will see the following response:

    "data":["from", "previous", "conn"]}HTTP/1.1 200 OK
    Content-Type: text/html
    Accept-Ranges: bytes
    Last-Modified: Sat, 30 May 2020 23:47:16 GMT
    ...

Signed-off-by: Fujimoto Seiji <fujimoto@ceptord.net>
@edsiper edsiper merged commit 7533d1f into fluent:master Jul 3, 2020
@edsiper
Copy link
Member

edsiper commented Jul 3, 2020

thanks

@fujimotos fujimotos deleted the sf/fix-leftover-bug branch July 6, 2020 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants