diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-08-11 15:42:34 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-08-11 15:42:34 -0700 |
| commit | d325e73b53c44e87ea4a2f2f91c9e84f61f7e889 (patch) | |
| tree | 3202b07ce2a3cb21781c848e6b75bdfdccc6edab /src | |
| parent | 4d68401997ba4a13d4fc12f24b49dabd9ed170ea (diff) | |
| download | nng-d325e73b53c44e87ea4a2f2f91c9e84f61f7e889.tar.gz nng-d325e73b53c44e87ea4a2f2f91c9e84f61f7e889.tar.bz2 nng-d325e73b53c44e87ea4a2f2f91c9e84f61f7e889.zip | |
Fix TTL handling for pair1 protocol; more tests.
Diffstat (limited to 'src')
| -rw-r--r-- | src/protocol/pair/pair_v1.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/protocol/pair/pair_v1.c b/src/protocol/pair/pair_v1.c index 6951088e..b76eecbb 100644 --- a/src/protocol/pair/pair_v1.c +++ b/src/protocol/pair/pair_v1.c @@ -224,7 +224,7 @@ pair1_pipe_recv_cb(void *arg) // If we bounced too many times, discard the message, but // keep getting more. - if (hdr >= (unsigned) s->ttl) { + if (hdr > (unsigned) s->ttl) { nni_msg_free(msg); nni_pipe_recv(npipe, &p->aio_recv); return; @@ -403,7 +403,7 @@ pair1_sock_setopt(void *arg, int opt, const void *buf, size_t sz) } break; case NNG_OPT_MAXTTL: - rv = nni_setopt_int(&s->ttl, buf, sz, 0, 255); + rv = nni_setopt_int(&s->ttl, buf, sz, 1, 255); break; default: rv = NNG_ENOTSUP; |
