From 132acf7ceb59aa9567a7d254686dd612a3a79dfb Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 18 Jan 2020 11:25:38 -0800 Subject: TTL reads could be fewer. Specifically, we don't need to read the atomic value each loop iteration. We can just get it when a message is first received, and then use that value. This should make receiving through proxies a little more efficient. --- src/protocol/survey0/xrespond.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/protocol/survey0/xrespond.c') diff --git a/src/protocol/survey0/xrespond.c b/src/protocol/survey0/xrespond.c index 65bd047e..73e541d3 100644 --- a/src/protocol/survey0/xrespond.c +++ b/src/protocol/survey0/xrespond.c @@ -273,13 +273,12 @@ xresp0_recv_cb(void *arg) int hops; int ttl; - ttl = nni_atomic_get(&s->ttl); - if (nni_aio_result(p->aio_recv) != 0) { nni_pipe_close(p->npipe); return; } + ttl = nni_atomic_get(&s->ttl); msg = nni_aio_get_msg(p->aio_recv); nni_aio_set_msg(p->aio_recv, NULL); nni_msg_set_pipe(msg, p->id); -- cgit v1.2.3-70-g09d2