diff --git a/include/path.h b/include/path.h index 9cdcf8158..3a6e84052 100644 --- a/include/path.h +++ b/include/path.h @@ -26,19 +26,16 @@ struct path int (*hooks[MAX_HOOKS])(struct msg *m); /// Counter for received messages - int received; + unsigned int received; /// Counter for messages which arrived reordered - int delayed; + unsigned int delayed; /// Counter for messages which arrived multiple times - int duplicated; + unsigned int duplicated; /// Last known message number - int sequence; - - /// The current path state - enum path_state state; + unsigned int sequence; /// The path thread pthread_t tid; diff --git a/src/path.c b/src/path.c index 60ba4e072..ae857756a 100644 --- a/src/path.c +++ b/src/path.c @@ -17,7 +17,10 @@ extern struct config config; int path_create(struct path *p, struct node *in, struct node *out) { - memset(p, 0, sizeof(struct path)); + /* Reset counters */ + p->received = 0; + p->delayed = 0; + p->duplicated = 0; p->in = in; p->out = out; @@ -44,6 +47,7 @@ static void * path_run(void *arg) p->duplicated++; } + p->sequence = m.sequence; p->received++;