Fix the size of length prefix for messages in other files.

This commit is contained in:
Petteri Aimonen
2013-10-23 21:21:43 +03:00
parent 49bd3f35a0
commit 51f0e47295

View File

@@ -355,6 +355,11 @@ class Field:
# Instead of direct numeric value, reference the size that # Instead of direct numeric value, reference the size that
# has been #defined in the other file. # has been #defined in the other file.
encsize = EncodedSize(self.submsgname + 'size') encsize = EncodedSize(self.submsgname + 'size')
# We will have to make a conservative assumption on the length
# prefix size, though.
encsize += 5
elif self.enc_size is None: elif self.enc_size is None:
raise RuntimeError("Could not determine encoded size for %s.%s" raise RuntimeError("Could not determine encoded size for %s.%s"
% (self.struct_name, self.name)) % (self.struct_name, self.name))