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
I just noticed that the generated code does something like:
while !r.is_eof() {
match r.next_tag(bytes) {
which means that if it is fed a buffer with multiple protobuf messages included it will parse each message, fill in the structures and then overwrite it with the next until eof is reached (hopefully exactly at a message boundary without excess bytes) and then return the last of the messages.
Wouldn't it make more sense to only check for EOF once at the beginning of each (sub-)message to return an error and then only parse the first message, allowing the BytesReader state to be reused by the application to parse more messages or gracefully ignore excess data?
The text was updated successfully, but these errors were encountered:
I just noticed that the generated code does something like:
which means that if it is fed a buffer with multiple protobuf messages included it will parse each message, fill in the structures and then overwrite it with the next until eof is reached (hopefully exactly at a message boundary without excess bytes) and then return the last of the messages.
Wouldn't it make more sense to only check for EOF once at the beginning of each (sub-)message to return an error and then only parse the first message, allowing the
BytesReader
state to be reused by the application to parse more messages or gracefully ignore excess data?The text was updated successfully, but these errors were encountered: