protocol message was rejected because it was too big (Turn off?)

366 views
Skip to first unread message

Saptarshi Guha

unread,
Dec 12, 2009, 1:50:05 PM12/12/09
to Protocol Buffers
Hello,
I am using Protocol Buffers to serialize some data.
To begin with I do realize that I shouldn't be using PB for
serializing very large messages, but given that I am, I have to deal
with these messages.

E.g I have a message of 381MB, so naturally I get this error when parsing:

libprotobuf ERROR google/protobuf/io/coded_stream.cc:196] A protocol
message was rejected because it was too big (more than 67108864
bytes). To increase the limit (or to disable these warnings), see
CodedInputStream::SetTotalBytesLimit() in
google/protobuf/io/coded_stream.h.


I viewed the header file and see what I have to do next. I'll fix my
code soon, till then:

My program redirects standard error(and output) and re-encodes
functions that write to these streams. However writing to s.out and
s.err are through special functions. PB, does not use my functions.
Other libraries (and I only use PB) writing to s.err and s.out can
adversely affect my program.

Q. Is there a flag I can set to not display the warning? i.e silently
fail? I'm not using CodedInputstream, instead I use ParseFromArray (i
have read in the bytes with m own functions)

Regards
Saptarshi

Kenton Varda

unread,
Dec 12, 2009, 4:36:22 PM12/12/09
to sg...@purdue.edu, Protocol Buffers
All messages are written to stderr (not stdout), which is usually reserved for human-readable error messages.  However, you can redirect the messages using google::protobuf::SetLogHandler() as documented here:



--

You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.



Kenton Varda

unread,
Dec 12, 2009, 4:40:02 PM12/12/09
to sg...@purdue.edu, Protocol Buffers
Actually, this is a better link:


For some reason the auto-generated documentation is failing to hyperlink to the definition of LogHandler, but it is shown among the typedefs at the top of that page:

typedef void LogHandler(LogLevel level, const char *filename, int line, const string &message)

Saptarshi Guha

unread,
Dec 13, 2009, 12:52:04 AM12/13/09
to Kenton Varda, Protocol Buffers
Thanks much.
Regards
Saptarshi
Reply all
Reply to author
Forward
0 new messages