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_server: always set the content-length on HTTP/1.x (fix #9010) #9036

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

edsiper
Copy link
Member

@edsiper edsiper commented Jul 3, 2024

When a client uses HTTP/1.1 protocol version, we are only setting the content-length at special cases, however if the caller like in_splunk, in_http or other sets a response body, the header is not set, so the client "have to assume" the response of the request is either none or just hangs and wait for some bytes.

This patch forces to format a content-length header when the request comes from a HTTP/1.1 session

This fixes the issue #9010.


Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

)

When a client uses HTTP/1.1 protocol version, we are only setting the content-length
at special cases, however if the caller like in_splunk, in_http or other sets a
response body, the header is not set, so the client "have to assume" the response
of the request is either none or just hangs and wait for some bytes.

This patch forces to format a content-length header when the request comes from
a HTTP/1.1 session

This fix issue #9010.

Signed-off-by: Eduardo Silva <eduardo@calyptia.com>
@lecaros
Copy link
Contributor

lecaros commented Jul 3, 2024

This works as intended. Are we discarding #9019 in favor of this one?

@edsiper
Copy link
Member Author

edsiper commented Jul 3, 2024

@lecaros right now #9019 just disables keepalives if the user-agent is curl, its a workaround to receive the data buffer on the client but the root cause is different, so this PR fixes the missing content-length header which was the primary problem reported on #9010.

I am troubleshooting a pending issue where Keepalive is not working if the following conditions are met:

  • http2 option is enabled (default) in the server side or input plugin
  • client issues 3 keepalive HTTP/1.1 requests

only the first request succeed and the others cannot arrive since the server drops the connection. It works fine if http2 is turned off. This is because the code path logic are different based on the default HTTP version used in the server side.

work in process.

@edsiper
Copy link
Member Author

edsiper commented Jul 3, 2024

CI failed because of CentOS 7 and Appveyor trying to upload an artifact

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