You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e1b5668
Browse filesBrowse the repository at this point in the historyBrowse files
Frame::encode laid out the 24-byte NVXC header by the order of its
extend_from_slice calls, and Frame::decode read the same fields back
at raw offsets: header[..4], [4], [5], [6..8], [8..16], [16..20] and
[20..24]. Only the module documentation gave the layout, and nothing
tied the decoder's offsets to the encoder's order or to
APP_HEADER_LEN.
Name the fields in a private field module, as the outer record header
does: MAGIC, VERSION, KIND, FLAGS, REQUEST_ID, STATUS and LENGTH, the
last ending at APP_HEADER_LEN. Compile-time assertions check that the
fields tile the header in order and that each range is as wide as its
field's type. The encoder writes each field at its range, and the
decoder reads each one from it.
The positions and widths are the ones that the code used, so every
frame encodes to the same bytes, and the decoder accepts and refuses
the same inputs with the same messages. The tests of
protocol::app::v2, whose wire helper builds the header independently,
pass unchanged: cargo test --locked --all-features --lib protocol::
gave 109 passed at ebaffcb and with the change, on Windows.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments