Closed koivunej closed 7 years ago
Yes I guess the API is not well documented. The bytesreader tries indeed to read a message which means he expects length then a message.
For your use case you're supposed to call message::from_reader directly.
We should probably both update the doc and change the function name
Also, it'd seem that I've broken the deserialization code as well while debugging, added an extra read_tag
.. :) I'll update the gist.
For your use case you're supposed to call message::from_reader directly.
Thanks, trying this next!
Yes, this solves the problem. Perhaps I'll edit this to be about updating the docs and send a PR later on.
This works with latest
rust-protobuf
, test case can be found in gist:https://gist.github.com/koivunej/68321c230287f95f88816c278d721d16
It'd seem that problem is in
reader::BytesReader::read_message
assumes length delimited contents. My use case is to read protobuf messages from inside an already framed stream. I can't seem to find any support for reading without the length prefix, so I guess that needs to be added?