Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Specialize extension payload encoding in Unparsed
Extension payload, after the RFC4251-encoded name string, is an opaque blob, not an RFC4251 array of bytes, so it MUST NOT have a u32 length header. This had been handled in the `<Extension as Encode>::encode` implementation, but that led to a bug in which there was a mismatch between the number of bytes written and the length calculated. This commit consolidates all the special-case handling of the opaque blob into `impl Encode for Unparsed`. Any messages (i.e. Extension) that contain `Unparsed` fields can now just call `encoded_len()` and `encode()` like for any other field type. Signed-off-by: Ross Williams <[email protected]>
- Loading branch information