curpeer->confirm++;
}
else if (msg_head[1] == PEER_MSG_CTRL_RESYNCCONFIRM) {
+ struct shared_table *st;
/* If stopping state */
if (stopping) {
appctx->st0 = PEER_SESS_ST_END;
goto switchstate;
}
+ for (st = curpeer->tables; st; st = st->next) {
+ st->update = st->last_pushed = st->teaching_origin;
+ st->flags = 0;
+ }
/* reset teaching flags to 0 */
curpeer->flags &= PEER_TEACH_RESET;
}
- /* Confirm finished or partial messages */
- while (curpeer->confirm) {
- unsigned char msg[2];
-
- /* There is a confirm messages to send */
- msg[0] = PEER_MSG_CLASS_CONTROL;
- msg[1] = PEER_MSG_CTRL_RESYNCCONFIRM;
-
- /* message to buffer */
- repl = bi_putblk(si_ic(si), (char *)msg, sizeof(msg));
- if (repl <= 0) {
- /* no more write possible */
- if (repl == -1)
- goto full;
- appctx->st0 = PEER_SESS_ST_END;
- goto switchstate;
- }
- curpeer->confirm--;
- }
/* Need to request a resync */
/* push local updates */
if (!eb || eb->key > st->teaching_origin) {
st->flags |= SHTABLE_F_TEACH_STAGE2;
- st->last_pushed = st->teaching_origin;
break;
}
curpeer->flags |= PEER_F_TEACH_FINISHED;
}
+ /* Confirm finished or partial messages */
+ while (curpeer->confirm) {
+ unsigned char msg[2];
+
+ /* There is a confirm messages to send */
+ msg[0] = PEER_MSG_CLASS_CONTROL;
+ msg[1] = PEER_MSG_CTRL_RESYNCCONFIRM;
+
+ /* message to buffer */
+ repl = bi_putblk(si_ic(si), (char *)msg, sizeof(msg));
+ if (repl <= 0) {
+ /* no more write possible */
+ if (repl == -1)
+ goto full;
+ appctx->st0 = PEER_SESS_ST_END;
+ goto switchstate;
+ }
+ curpeer->confirm--;
+ }
+
/* noting more to do */
goto out;
}