On 2011-05-20T14:35:28, Jiaju Zhang <[email protected]> wrote:
Hi Jiaju,
thanks for the good work!
I can't comment on totem much, but some general code only:
> +#define ENDIAN_LOCAL 0xff22
I am not sure about this one. Would it not make more sense to always
convert to a known byte-order on sending the message (hence the name
"network byte order") and convert incoming messages depending on the
local byte order?
(man htonl)
> +struct message_header {
> + char type;
> + char encapsulated;
> + unsigned short endian_detector;
> + int ring_number;
> + int nodeid_activator;
> +} __attribute__((packed));
Since size matters on the wire, I think you should use types from
stdint.h (uint8_t, int32_t, etc).
I'm also not quite sure if this could result in alignment errors on
access on weird architectures such as ia64.
Regards,
Lars
--
Architect Storage/HA, OPS Engineering, Novell, Inc.
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB
21284 (AG Nürnberg)
"Experience is the name everyone gives to their mistakes." -- Oscar Wilde
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais