Commit 678b3973 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Use an explicit constant for the source GC time.

parent e0f3b52d
...@@ -228,7 +228,7 @@ update_feasible(const unsigned char *a, ...@@ -228,7 +228,7 @@ update_feasible(const unsigned char *a,
if(src == NULL) if(src == NULL)
return 1; return 1;
if(src->time < now.tv_sec - 200) if(src->time < now.tv_sec - SOURCE_GC_TIME)
/* Never mind what is probably stale data */ /* Never mind what is probably stale data */
return 1; return 1;
......
...@@ -98,7 +98,7 @@ update_source(struct source *src, ...@@ -98,7 +98,7 @@ update_source(struct source *src,
if(metric >= INFINITY) if(metric >= INFINITY)
return; return;
if(src->time < now.tv_sec - 200 || if(src->time < now.tv_sec - SOURCE_GC_TIME ||
seqno_compare(src->seqno, seqno) < 0 || seqno_compare(src->seqno, seqno) < 0 ||
(src->seqno == seqno && src->metric > metric)) { (src->seqno == seqno && src->metric > metric)) {
src->seqno = seqno; src->seqno = seqno;
......
...@@ -20,6 +20,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ...@@ -20,6 +20,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
#define SOURCE_GC_TIME 200
struct source { struct source {
unsigned char address[16]; unsigned char address[16];
unsigned char prefix[16]; unsigned char prefix[16];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment