aboutsummaryrefslogtreecommitdiff
path: root/src/nng_compat.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-08-07 19:10:09 -0700
committerGarrett D'Amore <garrett@damore.org>2017-08-07 19:12:25 -0700
commitfe2c07b6a0dced827b7e086b39b1908d1861af39 (patch)
tree7b9c92ba201dd2217636137a09353f1f503c591a /src/nng_compat.c
parent2d4b95450141b3f3c581e510b53ee519e592f5d9 (diff)
downloadnng-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/nng_compat.c')
-rw-r--r--src/nng_compat.c3
1 files changed, 2 insertions, 1 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);