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

Support 100-continue of server and remove expect header of request #2499

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

chenBright
Copy link
Contributor

@chenBright chenBright commented Jan 6, 2024

What problem does this PR solve?

Issue Number:

Problem Summary:

客户端使用libcurl请求brpc http服务端,偶现耗时超过1秒的现象。经排查,发现是libcurl当使用Post或者Put方法,请求体超过一定大小(一般是1024字节)时,libcurl 自动添加“Expect: 100-continue”请求头,先发送header,等到服务端确认能接收body,收到服务端的100 continue response或者超过1秒,才发送body部分数据给服务端。

详细见libcurl Expect 100-continuerfc7231

What is changed and the side effects?

Changed:

  1. 客户端组包的时候移除expect: 100-continue header。请求带上expect: 100-continue后,服务端可能会在收完header后先回100 continue response,等到收完body处理完再回200 ok response。brpc客户端不支持一个请求对应两个回包的场景。
  2. 服务端解包时之解析出header,未收到body,先回100 continue response,等到收完body处理完再回200 ok response。

Side effects:

  • Performance effects(性能影响):

  • Breaking backward compatibility(向后兼容性):


Check List:

  • Please make sure your changes are compilable(请确保你的更改可以通过编译).
  • When providing us with a new feature, it is best to add related tests(如果你向我们增加一个新的功能, 请添加相关测试).
  • Please follow Contributor Covenant Code of Conduct.(请遵循贡献者准则).

@wwbmmm
Copy link
Contributor

wwbmmm commented Jan 9, 2024

LGTM

@serverglen serverglen merged commit 7ceb8ed into apache:master Jan 10, 2024
18 checks passed
@chenBright chenBright deleted the 100_continue branch January 10, 2024 02:35
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.

3 participants