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

Fix buildActions bug #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix buildActions bug #25

wants to merge 1 commit into from

Conversation

Azurx
Copy link
Contributor

@Azurx Azurx commented Dec 8, 2019

Intro

As described in the comments, buildActions() in php/midi/src/Midi/Koala/ParseRecorded.php is using for fix http calloutbound when one connection come with multi actions. But can not adapt to condition like:

  • action1
    • request: GET /path/abc?...
    • response: (empty response)
  • action2
    • request: (empty request)
    • response: abc (response part1)
  • action3
    • request: (empty request)
    • response: def (response part2)
      ...

abc, def are both part of whole HTTP response in only one session, it is split to multiple parts because syscall recv() need to receive twice at least to hold the entire response.

When will it appear

  1. A large reponse(over 64kb) in Upstream Calls
  2. A chunked response in Upstream Calls with Transfer-Encoding:chunked in header

Result

Can not replay correctly. In the report, response part1 in action2 was matched with 100% similarity, but reponse in action3 was tagged with "Unknown" Protocol.

Fix

original: Reqeust = action1.request, Response = action2.response;
now: Request = action1.request, Response = action2.response + action3.response + ... + actionN.response

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.

None yet

1 participant