diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-08-07 19:10:09 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-08-07 19:12:25 -0700 |
| commit | fe2c07b6a0dced827b7e086b39b1908d1861af39 (patch) | |
| tree | 7b9c92ba201dd2217636137a09353f1f503c591a /src | |
| parent | 2d4b95450141b3f3c581e510b53ee519e592f5d9 (diff) | |
| download | nng-fe2c07b6a0dced827b7e086b39b1908d1861af39.tar.gz nng-fe2c07b6a0dced827b7e086b39b1908d1861af39.tar.bz2 nng-fe2c07b6a0dced827b7e086b39b1908d1861af39.zip | |
Add some more compatibility tests; fix surveyor compat bug.
We noticed a bug in the surveyor handling of the options; this fixes
that. At the same time, we noticed a race condition in the setting
of the error for future calls, a short sleep seems to cure it. This
distinction (ESTATE vs ETIMEDOUT) is pretty annoying, and it would be
better to have a different way to handle it. More work here is
warranted.
Diffstat (limited to 'src')
| -rw-r--r-- | src/nng_compat.c | 3 | ||||
| -rw-r--r-- | src/nng_compat.h | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/nng_compat.c b/src/nng_compat.c index 9515dc31..160fd33d 100644 --- a/src/nng_compat.c +++ b/src/nng_compat.c @@ -622,7 +622,7 @@ nn_setsockopt(int s, int nnlevel, int nnopt, const void *valp, size_t sz) break; case NN_SURVEYOR: switch (nnopt) { - case NN_SURVEY_DEADLINE: + case NN_SURVEYOR_DEADLINE: opt = NNG_OPT_SURVEYTIME; mscvt = 1; break; @@ -630,6 +630,7 @@ nn_setsockopt(int s, int nnlevel, int nnopt, const void *valp, size_t sz) errno = ENOPROTOOPT; return (-1); } + break; default: errno = ENOPROTOOPT; return (-1); diff --git a/src/nng_compat.h b/src/nng_compat.h index cd189b2d..e83c20b8 100644 --- a/src/nng_compat.h +++ b/src/nng_compat.h @@ -1,5 +1,6 @@ // // Copyright 2017 Garrett D'Amore <garrett@damore.org> +// Copyright 2017 Capitar IT Group BV <info@capitar.com> // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -218,7 +219,7 @@ extern "C" { #define NN_SUB_SUBSCRIBE (NN_SUB * 16 + 1) #define NN_SUB_UNSUBSCRIBE (NN_SUB * 16 + 2) #define NN_REQ_RESEND_IVL (NN_REQ * 16 + 1) -#define NN_SURVEY_DEADLINE (NN_SURVEYOR * 16 + 1) +#define NN_SURVEYOR_DEADLINE (NN_SURVEYOR * 16 + 1) // Level options for tranports #define NN_INPROC (-1) |
