From fe2c07b6a0dced827b7e086b39b1908d1861af39 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 7 Aug 2017 19:10:09 -0700 Subject: 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. --- src/nng_compat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nng_compat.c') 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); -- cgit v1.2.3-70-g09d2