rdebug icon indicating copy to clipboard operation
rdebug copied to clipboard

Fix buildActions bug

Open Azurx opened this issue 6 years ago • 0 comments

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

Azurx avatar Dec 08 '19 09:12 Azurx