| Age | Commit message (Collapse) | Author |
|
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
Turns out the PipeWire server does not expect a value of type None here at all.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This now marshals into a value of type None when the slice is nil, and correctly unmarshals from type None.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This now calls unmarshalCheckTypeBounds to advance to the next message. Additionally, handling for None value is relocated to a function for reuse by other types.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
A nil spa_dict results in a None type value being sent over the wire.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This adds checking of FileCount while writing a message. Message encoding is relocated to an exported method to be used externally, probably for test stubbing.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
These are mostly small formatting changes, with the biggest change being to UnexpectedEOFError where its kind is now described as part of the error type.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This provides more useful messages for protocol errors.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This should make things easier to navigate, and possible to fully automatically generate the constants in the future.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
The io.ErrUnexpectedEOF error can be returned from multiple places. This change eases error handling.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This is useful during serialisation.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This is finally the thing we are after.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This change also adds test cases for messages before this one.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
These match the names found in documentation.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This is effectively a poor man's slice, it is entirely unnecessary here and can be handled internally.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This fixes serialisation of NULL spa_dict.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This eliminates all non-reflect allocations.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This is still not efficient by any means, but it should eliminate most non-reflect allocation (all allocation if PODMarshaler is not used).
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This is required to achieve zero allocation (other than reflect).
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This change uses the (somewhat) newly exposed MarshalAppend which improves readability.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This gets rid of magic numbers in marshal/unmarshal.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
Omitting the check is only useful for custom unmarshaler.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
NULL values have special case in the format. This check ensures correctness serialising nil pointers.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
The POD itself is serialised without requiring a special case, however its presence is only indicated by the difference in size recorded in the header and payload.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
Thankfully no special case here.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This is, in fact, just a glorified Int type.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This prevents incorrectly reading trailing data as part of the current POD.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This covers cases where wire size is not known ahead of time.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This performs the check within the bounds of the POD only. This was not caught since spa_dict was only used as the final struct field until now.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
Leftover values from previous invocations cause incorrect behaviour here.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This is a terrible type that defies the type system. It is implemented on the concrete type to avoid special cases.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This reduces special cases. This change also exposes unmarshalled message size on the wire.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This is still NUL terminated strings, and an extra NUL character on an 8-byte string does cause an extra 7 bytes of padding.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This is useful during development.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This implements enough types to correctly marshal and unmarshal Core::Hello.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This change also centralises encoding testing.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|