diff options
Diffstat (limited to 'upb/pb/encoder.c')
-rw-r--r-- | upb/pb/encoder.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/upb/pb/encoder.c b/upb/pb/encoder.c index b457867..839ede0 100644 --- a/upb/pb/encoder.c +++ b/upb/pb/encoder.c @@ -374,6 +374,12 @@ static void *encode_startdelimfield(void *c, const void *hd) { return ok ? c : UPB_BREAK; } +static bool encode_unknown(void *c, const void *hd, const char *buf, + size_t len) { + UPB_UNUSED(hd); + return encode_bytes(c, buf, len) && commit(c); +} + static bool encode_enddelimfield(void *c, const void *hd) { UPB_UNUSED(hd); return end_delim(c); @@ -436,6 +442,7 @@ static void newhandlers_callback(const void *closure, upb_handlers *h) { upb_handlers_setstartmsg(h, startmsg, NULL); upb_handlers_setendmsg(h, endmsg, NULL); + upb_handlers_setunknown(h, encode_unknown, NULL); m = upb_handlers_msgdef(h); for(upb_msg_field_begin(&i, m); |