Re: [protobuf] Correct behaviour when encountering an unexpected enum on the wire

2011-05-11 Thread Jason Hsueh
Ignore the data (sort of): The unknown value gets treated as an unknown field, leaving the enum field unset. In implementations that support propagation of unknown fields (non-lite C++, Java), the value is added to the UnknownFieldSet. Implications: - a sender may set a required enum field to a va

[protobuf] Correct behaviour when encountering an unexpected enum on the wire

2011-05-11 Thread Marc Gravell
I'm doing some code maintenance on my protobuf library, and I have encountered a test that is... confusing me. So before I go crazy (/ crazier)... what should an implementation do if during deserialization it gets an enum it doesn't recognise? - to explode in sparks? - to ignore the data? - to bru