8000 Improve Full Packet parsing for HTTP by c6h12o6 · Pull Request #1029 · buger/goreplay · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Improve Full Packet parsing for HTTP #1029

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

Merged
merged 7 commits into from
Jan 7, 2022

Conversation

c6h12o6
Copy link
Contributor
@c6h12o6 c6h12o6 commented Dec 1, 2021

This PR does two primary things:

  • ensures that HasFullPayload returns false if the packet doesnt start with a valid request or response header. This was necessary because a chunked response would return true from HasFullPayload if it got contiguous packets including the last packet (with the trailer) before it got the first packet (with the header).
  • When the request payload is chunked across multiple packets, only correct for 100-Continue responses once. In requests with > 2 packets, the Ack number is incremented for each packet in the message, sometimes resulting in packets not being correlated with each other. This ensures that the message is corrected once and only once.

proto/proto.go Outdated
@@ -463,6 +464,30 @@ type HTTPState struct {
Continue100 bool
}

var ValidHttpStart = [][]byte{
Copy link
Collaborator

Choose a reason for hiding this comment

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

exported var ValidHttpStart should have comment or be unexported
var ValidHttpStart should be ValidHTTPStart

proto/proto.go Outdated
@@ -463,6 +464,30 @@ type HTTPState struct {
Continue100 bool
}

var ValidHttpStart = [][]byte{
Copy link
Collaborator

Choose a reason for hiding this comment

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

exported var ValidHttpStart should have comment or be unexported
var ValidHttpStart should be ValidHTTPStart

@CLAassistant
Copy link
CLAassistant commented Dec 1, 2021

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


JB Feldman seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@sonarqubecloud
Copy link
sonarqubecloud bot commented Dec 1, 2021

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
33.3% 33.3% Duplication

@c6h12o6
Copy link
Contributor Author
c6h12o6 commented Dec 6, 2021

It still says that I havent signed the license, but I have

@buger
Copy link
Owner
buger commented Jan 7, 2022

Thank you, looks good!

9616

@buger buger merged commit 86546f3 into buger:master Jan 7, 2022
buger pushed a commit that referenced this pull request Jan 7, 2022
This PR does two primary things:
- ensures that HasFullPayload returns false if the packet doesnt start with a valid request or response header. This was necessary because a chunked response would return true from HasFullPayload if it got contiguous packets including the last packet (with the trailer) before it got the first packet (with the header).
- When the request payload is chunked across multiple packets, only correct for 100-Continue responses once. In requests with > 2 packets, the Ack number is incremented for each packet in the message, sometimes resulting in packets not being correlated with each other. This ensures that the message is corrected once and only once.
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.

4 participants
0