Closed xor-gate closed 8 years ago
Huh, you're right. I thought I had done this already but it turns out I was only handling this case differently in the reader, not the writer (and the reader flags mpack_reader_invalid
without a fill function since the buffer should contain a whole MessagePack object.)
https://github.com/ludocode/mpack/blob/develop/src/mpack/mpack-reader.c#L167-L175 https://github.com/ludocode/mpack/blob/develop/src/mpack/mpack-writer.c#L249-L253
As an aside, do you ever write messages into a buffer shorter than 9 bytes? I made a performance and code size change on develop which requires that the minimum buffer size is 9 bytes, even if you intend to write less data than that. Let me know if this is a problem; if so I'll put in a workaround.
Currently I do not write messages in buffers of 9 bytes or less. So this means mpack needs a minimal buffer size of 9 bytes, but less can be written ? I think this should be no problem, hence this should be well documented :-)
Thanks for fixing this!
I'm removing the minimum buffer size; it's actually quite broken. So don't use develop right now until I have it fixed!
It's fixed.
I think current behaviour is a bit weird when a static buffer is not big enough and more is tried to be written and the context is destroyed. The error flag is expected to be
mpack_error_too_big
but it is stated in the documentation (and emitted) currently asmpack_error_io
.