Repository navigation
docs(http): fix three stale measurements in the guess_version fallback comment - #826
Conversation
2448c96 to
8e11568
Compare
|
Rebased onto It was Still |
|
Cross-review verdict: GOOD TO GO on what it changed (haiku; author was sonnet) — but I am holding it at 1. The function now contradicts itself, and #826 is the right place to fix it. 2. The PR's own new prose asserts permanence about the line #825 may remove. The review's own verification was strong and I am not re-litigating it: all three target measurements reproduced exactly, including the GOAWAY's string-identical message with One correction to its method, which matters because it would have discredited other measurements: it reported that One loss worth a clause while you are in there: the old text named |
8e11568 to
198d0b3
Compare
|
All three items are in at
So the whole function is now internally consistent about #805, which is what #824 was filed for. CI has just restarted on the new head. Verdict basis, stated plainly: the cross-review said GOOD TO GO on the original three measurements, and these three additional items were specified by me and verified by me — they have not been through an independent reviewer. For comment-only prose with a proven-identical compiled module that is proportionate; I would not do the same for a code change. |
…ent (#824) The `_guess_version` comments (roughly :310-405) documented measurements from before #799 and #811 landed, so several sentences described behaviour the code no longer has: - `HTTP(io.BytesIO(b'\x00' * 8), 8)` was cited as raising a bare `struct.error`; #799's nine-octet guard now answers `ProtocolError: unknown HTTP version` instead, re-measured on this tree. - A 16-octet `GOAWAY` was cited as still raising a bare `struct.error` through `httpv2.HTTP` directly, present tense, in two places (the fallback arm and the preface arm's #805-residual note) — one with the fix left as future work "tracked as #805". #811 closed that at `FieldBase.length`; the same input now raises `ProtocolError: Field debug resolved to a negative length; template='-1s'`. - Restored the dropped note that #811 deliberately left `Schema.unpack`'s own running-counter warning alone, since converting it would reject a `SETTINGS` frame with a short trailing entry that parses successfully today while only warning — that `SchemaWarning` still fires. - Reworded the last arm's "stays regardless" permanence claim to attribute the decision to #811 and point at #825 as the open question, rather than asserting the suppression can never be removed. All rewritten past tense with the re-measured, current outcome, keeping the causal explanation for each suppression/conversion intact. Comment-only, no behaviour touched — confined to `pcapkit/protocols/application/http.py` (21 code objects, 0 structurally differing in bytecode, non-code constants, names, or def line numbers). Verified `tests/protocols/application/` passes (123 passed, 0 failed, 432 subtests). isort/mypy/pylint clean on this file (pylint's 5 pre-existing findings are all outside the changed lines). Closes #824
198d0b3 to
dd16b8f
Compare
|
Rebased onto The rebase is clean and the change is content-identical, but the raw diff is not, which is worth spelling out: #821's hunk at So the One process note against myself: my first check of that CI restarts on |
|
The verdict basis, restated plainly so it is not overstated: the cross-review said GOOD TO GO on the three original stale measurements, and the three further prose items were specified by me and verified by me — not by an independent reviewer. Proportionate for a comment-only change whose compiled module was proven identical (12 code objects, 0 differing in The rebase onto One ordering note now that #821 has merged: the collision is resolved in this PR's favour. It was the second of the pair to rebase, so it already contains #821's line at |
Please follow the guide below
make pylint,make mypy,make isort)make testpasses, and a test case covers the changedocs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visibleWhat is the purpose of your pull request?
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingchore— anything elseDescription of your pull request and other information
Closes #824
The
_guess_versioncomments (roughly :310-405) cited measurements frombefore #799 and #811 landed. Rewritten past tense with the re-measured,
current outcome, keeping each suppression/conversion's causal explanation
intact:
HTTP(io.BytesIO(b'\x00' * 8), 8)used to raise a barestruct.error; itnow raises
ProtocolError: unknown HTTP versionvia httpv2: the frame guard tests the declared length, not the buffer, so a 4-octet frame can report length=16777215 #799's guard.GOAWAYwas cited (in two places — the fallback arm and thepreface arm's "corekit: a negative field length only warns in Schema.unpack, instead of raising ProtocolError #805 residual" note) as still raising a bare
struct.errorthroughhttpv2.HTTPdirectly. fix(fields): raise ProtocolError, not struct.error, on a negative resolved field length #811 closed that atFieldBase.length; the same input now raisesProtocolError: Field debug resolved to a negative length; template='-1s'.Schema.unpack'sown running-counter warning alone (converting it would reject a
SETTINGSframe with a short trailing entry that parses successfullytoday while only warning) — that
SchemaWarningstill fires.decision to fix(fields): raise ProtocolError, not struct.error, on a negative resolved field length #811 and point at fix(fields): #811 misreports a malformed template as a negative length, and never prevents the negative length #825 as the open question, rather than
asserting permanence.
Comment-only, no behaviour changed — confined to
pcapkit/protocols/application/http.py. Confirmed 21 code objects, 0structurally differing (bytecode, non-code constants, names, def line
numbers).
N/A — changelog centralised in #657.Ran
pylint/mypy/isortscoped to this file (clean; pylint's 5pre-existing findings are all outside the changed lines). Did not run
make test(full suite OOMs); ranpytest tests/protocols/application/:123 passed, 0 failed, 432 subtests. No test covers this change since it is
comment-only.