Browse Source

ckdb - extend the limit on seq found messages

master
kanoi 8 years ago
parent
commit
373f9b01df
  1. 11
      src/ckdb.c
  2. 2
      src/ckdb.h

11
src/ckdb.c

@ -2916,13 +2916,16 @@ static bool setup_data()
#define DATASETTRANS(_seqdata, _u) \ #define DATASETTRANS(_seqdata, _u) \
ENTRYSETTRANS(&((_seqdata)->entry[(_u) & ((_seqdata)->size - 1)])) ENTRYSETTRANS(&((_seqdata)->entry[(_u) & ((_seqdata)->size - 1)]))
// Check for transient missing every 2s // Check for transient missing every X seconds
#define TRANCHECKLIMIT 2.0 #define TRANCHECKLIMIT 2.0
static tv_t last_trancheck; static tv_t last_trancheck;
// Don't let these messages be slowed down by a trans_process() // Don't let these messages be slowed down by a trans_process()
#define TRANCHKSEQOK(_seq) ((_seq) != SEQ_SHARES && (_seq) != SEQ_AUTH && \ #define TRANCHKSEQOK(_seq) ((_seq) != SEQ_SHARES && (_seq) != SEQ_AUTH && \
(_seq) != SEQ_ADDRAUTH && (_seq) != SEQ_BLOCK) (_seq) != SEQ_ADDRAUTH && (_seq) != SEQ_BLOCK)
// How many seconds to allow the build up of trans range messages
#define TRANSAGELIMIT 10.0
/* time (now) is used, not cd, since cd is only relevant to reloading /* time (now) is used, not cd, since cd is only relevant to reloading
* and we don't run trans_process() during reloading * and we don't run trans_process() during reloading
* We also only know now, not cd, for a missing item * We also only know now, not cd, for a missing item
@ -3743,10 +3746,10 @@ setitemdata:
found[seq].forced_msg = true; found[seq].forced_msg = true;
} }
} }
// Check if there are any ranges >= 2s old (or forced) // Check if there are any ranges >= the limit (or forced)
for (i = 0; i < SEQ_MAX; i++) { for (i = 0; i < SEQ_MAX; i++) {
if (found[i].forced_msg || (found[i].last.tv_sec != 0 && if (found[i].forced_msg || (found[i].last.tv_sec != 0 &&
tvdiff(&found_now, &(found[i].last)) >= 2.0)) { tvdiff(&found_now, &(found[i].last)) >= TRANSAGELIMIT)) {
memcpy(&(found_msgs[i]), &(found[i]), memcpy(&(found_msgs[i]), &(found[i]),
sizeof(SEQFOUND)); sizeof(SEQFOUND));
// will be displayed, so erase it // will be displayed, so erase it
@ -3780,7 +3783,7 @@ setitemdata:
setnow(&found_now); setnow(&found_now);
for (i = 0; i < SEQ_MAX; i++) { for (i = 0; i < SEQ_MAX; i++) {
if (found[i].last.tv_sec != 0 && if (found[i].last.tv_sec != 0 &&
tvdiff(&found_now, &(found[i].last)) >= 2.0) { tvdiff(&found_now, &(found[i].last)) >= TRANSAGELIMIT) {
memcpy(&(found_msgs[i]), memcpy(&(found_msgs[i]),
&(found[i]), &(found[i]),
sizeof(SEQFOUND)); sizeof(SEQFOUND));

2
src/ckdb.h

@ -58,7 +58,7 @@
#define DB_VLOCK "1" #define DB_VLOCK "1"
#define DB_VERSION "1.0.7" #define DB_VERSION "1.0.7"
#define CKDB_VERSION DB_VERSION"-2.712" #define CKDB_VERSION DB_VERSION"-2.713"
#define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL " - from %s %s() line %d"
#define WHERE_FFL_HERE __FILE__, __func__, __LINE__ #define WHERE_FFL_HERE __FILE__, __func__, __LINE__

Loading…
Cancel
Save