AlexanderSkvortsov / protobuf-embedded-c

Automatically exported from code.google.com/p/protobuf-embedded-c
0 stars 0 forks source link

Support for bigger messages #40

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
We are using this library, but our messages need bigger strings (~256 chars 
instead of 32).

When we changes MAX_STRING_LEN to 256, whenever a message's total size exceeds 
256, the reading will stop right after the current field is parsed.

The problem seems to be that in the Msg_read_delimited_from(...), this line:

    offset = read_raw_varint32(&size, _buffer, offset);

which then executes this:

    offset = read_raw_byte((char *)&result, _buffer, offset);
    if (result >= 0) {
        *tag = result;
        return offset;
    }

returns at most one byte.

Original issue reported on code.google.com by nasus.ma...@gmail.com on 27 May 2013 at 12:03

GoogleCodeExporter commented 9 years ago
Sorry.  Forget that.  It actually works fine.  I had another issue in my code 
which made it look like it was a bug with this library, while it was in fact a 
bug on my part.

Original comment by nasus.ma...@gmail.com on 27 May 2013 at 6:57