[protobuf] Re: Fix for Protobuf issue 136: memoized serialized size of packed fields was invalid (issue157169)

2009-11-25 Thread jasonh
Done. But it occurs to me that this isn't all that much nicer a solution than just calling getSerializedSize() in writeTo(CodedOutputStream output), except that it only happens for messages with packed fields, rather than all messages. Should this compute only the serialized size of the packed

[protobuf] Re: Fix for Protobuf issue 136: memoized serialized size of packed fields was invalid (issue157169)

2009-11-25 Thread jasonh
Done. I kept the change to initialize the memoized size of packed fields to -1, just for consistency with the message's size. On 2009/11/25 20:51:52, kenton wrote: You're right, we might as well always call it. On Wed, Nov 25, 2009 at 9:08 AM, mailto:jas...@google.com wrote: Done. But it

Re: optional bytes vs repeated bytes

2009-08-24 Thread jasonh
On Aug 24, 7:51 am, Saptarshi saptarshi.g...@gmail.com wrote: Hello, Suppose I would like to store a type that could be a sequence of raw bytes, so     message ...{             optional bytes sdata1=1; //A             repeated bytes sdata2=2;  //B            optional BYT sdata3=3; //C

Re: Detecting message type prior parsing a ByteBuffer containing the message

2009-07-22 Thread jasonh
On Jul 21, 11:00 pm, Benedikt Hallinger b.hallin...@skyforcesystems.de wrote: Hello, thank you very much for the ideas. Since i will have a unknowable ammount of Message types, extensions would be the way to go. Your were right with the assumption that i use Java. The construct and send

Re: java string literal too long when initializing java.lang.String descriptorData

2009-07-22 Thread jasonh
This looks to be a real problem. Kenton's on vacation but should be back soon (tomorrow I think) so he can take a look at the patch then. On Jul 22, 8:36 am, anonymous eric.pe...@hp.com wrote: Hello, I was not able to compile a Java file generated by protoc 2.10 from a rather big .proto

Re: Detecting message type prior parsing a ByteBuffer containing the message

2009-07-21 Thread jasonh
How about using extensions to solve this? You could define a generic message: message Packet { extensions n to m; } // Payload messages message TestMessage { extend Packet { optional TestMessage test = 10; } required string msg = 2; } message TestMessage2 { extend Packet {

Re: Detecting message type prior parsing a ByteBuffer containing the message

2009-07-21 Thread jasonh
By the way you may want to look at the section on Union Types in the docs: http://code.google.com/apis/protocolbuffers/docs/techniques.html#union On Jul 21, 9:51 am, jasonh jas...@google.com wrote: How about using extensions to solve this? You could define a generic message: message Packet

Re: Writing a router tha can route messages

2009-07-15 Thread jasonh
On Jul 15, 5:33 am, Kaj Bjurman kaj.bjur...@gmail.com wrote: Hi, I have just read the tutorials and the some threads in these forums, but there's one thing that I can't find an answer for. I'm currently using a router that is responsible to route different messages to different servers.

Re: Implement ShutdownProtobufLibrary().

2009-05-06 Thread jasonh
: On 2009/05/06 01:03:14, jasonh wrote: Indent() for prettier generated code? Done. http://codereview.appspot.com/53053/diff/1/6 File google/protobuf/compiler/cpp/cpp_message.cc (right): http://codereview.appspot.com/53053/diff/1/6#newcode608 Line 608: delete $classname$::default_instance_;\n

Re: Implement ShutdownProtobufLibrary().

2009-05-05 Thread jasonh
Sorry about the delay. Mostly looks good, just a few nits http://codereview.appspot.com/53053/diff/1/5 File google/protobuf/compiler/cpp/cpp_file.cc (right): http://codereview.appspot.com/53053/diff/1/5#newcode401 Line 401: Indent() for prettier generated code?