for corosync.
Index: exec/totempg.c
===================================================================
--- exec/totempg.c (revision 2090)
+++ exec/totempg.c (working copy)
@@ -164,11 +164,17 @@
struct totem_config *totempg_totem_config;
+enum throw_away_mode {
+ THROW_AWAY_INACTIVE,
+ THROW_AWAY_ACTIVE
+};
+
struct assembly {
unsigned int nodeid;
unsigned char data[MESSAGE_SIZE_MAX];
int index;
unsigned char last_frag_num;
+ enum throw_away_mode throw_away;
struct list_head list;
};
@@ -177,13 +183,6 @@
static int callback_token_received_fn (enum totem_callback_token_type type,
const void *data);
-enum throw_away_mode_t {
- THROW_AWAY_INACTIVE,
- THROW_AWAY_ACTIVE
-};
-
-static enum throw_away_mode_t throw_away_mode = THROW_AWAY_INACTIVE;
-
DECLARE_LIST_INIT(assembly_list_inuse);
DECLARE_LIST_INIT(assembly_list_free);
@@ -274,6 +273,9 @@
list_del (&assembly->list);
list_add (&assembly->list, &assembly_list_inuse);
assembly->nodeid = nodeid;
+ assembly->index = 0;
+ assembly->last_frag_num = 0;
+ assembly->throw_away_mode = THROW_AWAY_INACTIVE;
return (assembly);
}
@@ -287,6 +289,9 @@
*/
assert (assembly);
assembly->nodeid = nodeid;
+ assembly->index = 0;
+ assembly->last_frag_num = 0;
+ assembly->throw_away_mode = THROW_AWAY_INACTIVE;
list_init (&assembly->list);
list_add (&assembly->list, &assembly_list_inuse);
@@ -597,10 +602,10 @@
*/
start = 0;
- if (throw_away_mode == THROW_AWAY_ACTIVE) {
+ if (assembly->throw_away_mode == THROW_AWAY_ACTIVE) {
/* Throw away the first msg block */
if (mcast->fragmented == 0 || mcast->fragmented == 1) {
- throw_away_mode = THROW_AWAY_INACTIVE;
+ assembly->throw_away_mode = THROW_AWAY_INACTIVE;
assembly->index += msg_lens[0];
iov_delv.iov_base = &assembly->data[assembly->index];
@@ -608,7 +613,7 @@
start = 1;
}
} else
- if (throw_away_mode == THROW_AWAY_INACTIVE) {
+ if (assembly->throw_away_mode == THROW_AWAY_INACTIVE) {
if (continuation == assembly->last_frag_num) {
assembly->last_frag_num = mcast->fragmented;
for (i = start; i < msg_count; i++) {
@@ -621,7 +626,7 @@
}
}
} else {
- throw_away_mode = THROW_AWAY_ACTIVE;
+ assembly->throw_away_mode = THROW_AWAY_ACTIVE;
}
}
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais