Masatake,
The patch is not correct since it doesn't continue in the case of
sq_item_get not retrieving an entry for the origniated for recovery
list.
Your indeed correct though the indentation is improper and confusing to
read. I thought I had fixed this some time ago but apparently not.
Regards
-stevge
On Tue, 2008-03-11 at 20:38 +0900, Masatake YAMATO wrote:
> Hi,
>
> During reading totemsrp.c I've found very strange indentation.
> I know well the "indentation" style depends on project.
> However, the code I found is really strange. code readers
> like me may be confused. It may be not good for the project.
> So could you inspect my patch?
>
> Masatake YAMATO
>
> diff -ruN
> /srv/sources/src-upstream/lcopy-SOURCES/openais-trunk/exec/totemsrp.c
> /tmp/openais-trunk/exec/totemsrp.c
> --- /srv/sources/src-upstream/lcopy-SOURCES/openais-trunk/exec/totemsrp.c
> 2007-11-29 04:46:33.000000000 +0900
> +++ /tmp/openais-trunk/exec/totemsrp.c 2008-03-11 20:13:49.000000000
> +0900
> @@ -1907,31 +1907,31 @@
>
> sprintf (seqno_string_hex, "%x ", low_ring_aru + i);
> res = sq_item_get (&instance->regular_sort_queue,
> - low_ring_aru + i, &ptr);
> + low_ring_aru + i, &ptr);
> if (res != 0) {
> strcat (not_originated, seqno_string_hex);
> - continue;
> - }
> - strcat (is_originated, seqno_string_hex);
> - sort_queue_item = ptr;
> - assert (sort_queue_item->iov_len > 0);
> - assert (sort_queue_item->iov_len <= MAXIOVS);
> - messages_originated++;
> - memset (&message_item, 0, sizeof (struct message_item));
> + continue;
> + }
> + strcat (is_originated, seqno_string_hex);
> + sort_queue_item = ptr;
> + assert (sort_queue_item->iov_len > 0);
> + assert (sort_queue_item->iov_len <= MAXIOVS);
> + messages_originated++;
> + memset (&message_item, 0, sizeof (struct message_item));
> // TODO LEAK
> - message_item.mcast = malloc (sizeof (struct mcast));
> - assert (message_item.mcast);
> - message_item.mcast->header.type = MESSAGE_TYPE_MCAST;
> - srp_addr_copy (&message_item.mcast->system_from, &instance->my_id);
> - message_item.mcast->header.encapsulated = MESSAGE_ENCAPSULATED;
> - message_item.mcast->header.nodeid = instance->my_id.addr[0].nodeid;
> - assert (message_item.mcast->header.nodeid);
> - message_item.mcast->header.endian_detector = ENDIAN_LOCAL;
> - memcpy (&message_item.mcast->ring_id, &instance->my_ring_id,
> - sizeof (struct memb_ring_id));
> - message_item.iov_len = sort_queue_item->iov_len;
> - memcpy (&message_item.iovec, &sort_queue_item->iovec,
> - sizeof (struct iovec) * sort_queue_item->iov_len);
> + message_item.mcast = malloc (sizeof (struct mcast));
> + assert (message_item.mcast);
> + message_item.mcast->header.type = MESSAGE_TYPE_MCAST;
> + srp_addr_copy (&message_item.mcast->system_from,
> &instance->my_id);
> + message_item.mcast->header.encapsulated = MESSAGE_ENCAPSULATED;
> + message_item.mcast->header.nodeid =
> instance->my_id.addr[0].nodeid;
> + assert (message_item.mcast->header.nodeid);
> + message_item.mcast->header.endian_detector = ENDIAN_LOCAL;
> + memcpy (&message_item.mcast->ring_id, &instance->my_ring_id,
> + sizeof (struct memb_ring_id));
> + message_item.iov_len = sort_queue_item->iov_len;
> + memcpy (&message_item.iovec, &sort_queue_item->iovec,
> + sizeof (struct iovec) * sort_queue_item->iov_len);
> queue_item_add (&instance->retrans_message_queue,
> &message_item);
> }
> log_printf (instance->totemsrp_log_level_notice,
> _______________________________________________
> Openais mailing list
> [email protected]
> https://lists.linux-foundation.org/mailman/listinfo/openais
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais