diff --git a/ChangeLog b/ChangeLog index dd47bd0d..4d99734c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ Changes in 1.4.5-stable: o Rename INPUT and OUTPUT to EVRPC_INPUT and EVRPC_OUTPUT. Retain INPUT/OUTPUT aliases on on-win32 platforms for backwards compatibility. o Do not use SO_REUSEADDR when connecting o Fix Windows build + o Fix a bug in event_rpcgen when generated fixed-sized entries Changes in 1.4.4-stable: o Correct the documentation on buffer printf functions. diff --git a/event_rpcgen.py b/event_rpcgen.py index 5c6ec8d3..0c1b29ec 100755 --- a/event_rpcgen.py +++ b/event_rpcgen.py @@ -446,7 +446,7 @@ class EntryBytes(Entry): Entry.__init__(self, type, name, tag) self._length = length - self._ctype = 'uint32_t' + self._ctype = 'uint8_t' def GetDeclaration(self, funcname): code = [ 'int %s(struct %s *, %s **);' % ( @@ -518,7 +518,6 @@ class EntryBytes(Entry): def CodeNew(self, name): code = ['memset(%s->%s_data, 0, sizeof(%s->%s_data));' % ( name, self._name, name, self._name)] - code.extend(Entry.CodeNew(self, name)) return code def Verify(self): diff --git a/test/regress.c b/test/regress.c index 4afcbb43..42820459 100644 --- a/test/regress.c +++ b/test/regress.c @@ -1363,6 +1363,8 @@ rpc_test(void) exit(1); } EVTAG_ASSIGN(run, how, "very fast but with some data in it"); + EVTAG_ASSIGN(run, fixed_bytes, + (unsigned char*)"012345678901234567890123"); } if (msg_complete(msg) == -1) { diff --git a/test/regress.rpc b/test/regress.rpc index 3c538f75..65ca95de 100644 --- a/test/regress.rpc +++ b/test/regress.rpc @@ -15,4 +15,6 @@ struct kill { struct run { string how = 1; + optional bytes some_bytes = 2; + bytes fixed_bytes[24] = 3; }