aboutsummaryrefslogtreecommitdiff
path: root/src/core/options.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-08-14 23:25:34 -0700
committerGarrett D'Amore <garrett@damore.org>2017-08-14 23:25:34 -0700
commite7e2a6c14f0317eb77711951c6f1a650d4013dfe (patch)
tree7ed67e4dfbbebce4cc9d88417179c2d58fffb400 /src/core/options.c
parentb47a223bfb2c7114154504ec8d6cdac5abd0b884 (diff)
downloadnng-e7e2a6c14f0317eb77711951c6f1a650d4013dfe.tar.gz
nng-e7e2a6c14f0317eb77711951c6f1a650d4013dfe.tar.bz2
nng-e7e2a6c14f0317eb77711951c6f1a650d4013dfe.zip
Move socket structure to private socket implementation.
We enable a few flags, but now the details of the socket internals are completely private to the socket.
Diffstat (limited to 'src/core/options.c')
-rw-r--r--src/core/options.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/options.c b/src/core/options.c
index 403630a3..b243b262 100644
--- a/src/core/options.c
+++ b/src/core/options.c
@@ -155,20 +155,23 @@ nni_notifyfd_push(struct nng_event *ev, void *arg)
int
nni_getopt_fd(nni_sock *s, nni_notifyfd *fd, int mask, void *val, size_t *szp)
{
- int rv;
+ int rv;
+ uint32_t flags;
if ((*szp < sizeof(int))) {
return (NNG_EINVAL);
}
+ flags = nni_sock_flags(s);
+
switch (mask) {
case NNG_EV_CAN_SND:
- if ((s->s_flags & NNI_PROTO_FLAG_SND) == 0) {
+ if ((flags & NNI_PROTO_FLAG_SND) == 0) {
return (NNG_ENOTSUP);
}
break;
case NNG_EV_CAN_RCV:
- if ((s->s_flags & NNI_PROTO_FLAG_RCV) == 0) {
+ if ((flags & NNI_PROTO_FLAG_RCV) == 0) {
return (NNG_ENOTSUP);
}
break;