mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-27 02:24:18 +00:00
Accurately timestamp start of request
When building a request from a stream, try to get an accurate
start timestamp from the Reader. This was already in the code
and also used when building response objects, but was ommited
in commit ddf458b330
Without his logic and when the client is reusing a connection
to send requests, the timestamp_start of subsequent requests
is early and equal to when the connection started read blocking
This commit is contained in:
parent
86526eed8d
commit
202ede3c54
@ -344,6 +344,11 @@ class HTTPRequest(HTTPMessage):
|
|||||||
body_size_limit = body_size_limit,
|
body_size_limit = body_size_limit,
|
||||||
wfile = wfile
|
wfile = wfile
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if hasattr(rfile, "first_byte_timestamp"):
|
||||||
|
# more accurate timestamp_start
|
||||||
|
timestamp_start = rfile.first_byte_timestamp
|
||||||
|
|
||||||
timestamp_end = utils.timestamp()
|
timestamp_end = utils.timestamp()
|
||||||
return HTTPRequest(
|
return HTTPRequest(
|
||||||
req.form_in,
|
req.form_in,
|
||||||
|
Loading…
Reference in New Issue
Block a user