From c42f32722447cc52810b25decee634210f09d70e Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 27 Oct 2021 22:34:41 -0700 Subject: fixes #1346 windows ipc winsec fails frequently in CI/CD --- src/sp/protocol/pair0/pair.c | 70 ++++++++++++++++++++-------------------- src/sp/protocol/pair1/pair.c | 28 ++++++++-------- src/sp/protocol/pipeline0/push.c | 16 ++++----- 3 files changed, 57 insertions(+), 57 deletions(-) (limited to 'src/sp') diff --git a/src/sp/protocol/pair0/pair.c b/src/sp/protocol/pair0/pair.c index c2407d81..c6470b7b 100644 --- a/src/sp/protocol/pair0/pair.c +++ b/src/sp/protocol/pair0/pair.c @@ -32,7 +32,7 @@ static void pair0_pipe_send(pair0_pipe *, nni_msg *); // pair0_sock is our per-socket protocol private structure. struct pair0_sock { - pair0_pipe * p; + pair0_pipe *p; nni_mtx mtx; nni_lmq wmq; nni_list waq; @@ -44,12 +44,12 @@ struct pair0_sock { bool wr_ready; // pipe ready for write }; -// An pair0_pipe is our per-pipe protocol private structure. We keep +// A pair0_pipe is our per-pipe protocol private structure. We keep // one of these even though in theory we'd only have a single underlying // pipe. The separate data structure is more like other protocols that do // manage multiple pipes. struct pair0_pipe { - nni_pipe * pipe; + nni_pipe *pipe; pair0_sock *pair; nni_aio aio_send; nni_aio aio_recv; @@ -190,8 +190,8 @@ pair0_pipe_recv_cb(void *arg) { pair0_pipe *p = arg; pair0_sock *s = p->pair; - nni_msg * msg; - nni_aio * a; + nni_msg *msg; + nni_aio *a; if (nni_aio_result(&p->aio_recv) != 0) { nni_pipe_close(p->pipe); @@ -231,8 +231,8 @@ static void pair0_send_sched(pair0_sock *s) { pair0_pipe *p; - nni_msg * m; - nni_aio * a = NULL; + nni_msg *m; + nni_aio *a = NULL; size_t l = 0; nni_mtx_lock(&s->mtx); @@ -303,8 +303,8 @@ static void pair0_sock_close(void *arg) { pair0_sock *s = arg; - nni_aio * a; - nni_msg * m; + nni_aio *a; + nni_msg *m; nni_mtx_lock(&s->mtx); while (((a = nni_list_first(&s->raq)) != NULL) || ((a = nni_list_first(&s->waq)) != NULL)) { @@ -334,7 +334,7 @@ static void pair0_sock_send(void *arg, nni_aio *aio) { pair0_sock *s = arg; - nni_msg * m; + nni_msg *m; size_t len; int rv; @@ -384,7 +384,7 @@ pair0_sock_recv(void *arg, nni_aio *aio) { pair0_sock *s = arg; pair0_pipe *p; - nni_msg * m; + nni_msg *m; int rv; if (nni_aio_begin(aio) != 0) { @@ -463,7 +463,7 @@ pair0_get_send_buf_len(void *arg, void *buf, size_t *szp, nni_opt_type t) int val; nni_mtx_lock(&s->mtx); - val = nni_lmq_cap(&s->wmq); + val = (int) nni_lmq_cap(&s->wmq); nni_mtx_unlock(&s->mtx); return (nni_copyout_int(val, buf, szp, t)); @@ -498,7 +498,7 @@ pair0_get_recv_buf_len(void *arg, void *buf, size_t *szp, nni_opt_type t) int val; nni_mtx_lock(&s->mtx); - val = nni_lmq_cap(&s->rmq); + val = (int) nni_lmq_cap(&s->rmq); nni_mtx_unlock(&s->mtx); return (nni_copyout_int(val, buf, szp, t)); @@ -531,28 +531,28 @@ pair0_sock_get_send_fd(void *arg, void *buf, size_t *szp, nni_opt_type t) } static nni_option pair0_sock_options[] = { - { - .o_name = NNG_OPT_RECVFD, - .o_get = pair0_sock_get_recv_fd, - }, - { - .o_name = NNG_OPT_SENDFD, - .o_get = pair0_sock_get_send_fd, - }, - { - .o_name = NNG_OPT_SENDBUF, - .o_get = pair0_get_send_buf_len, - .o_set = pair0_set_send_buf_len, - }, - { - .o_name = NNG_OPT_RECVBUF, - .o_get = pair0_get_recv_buf_len, - .o_set = pair0_set_recv_buf_len, - }, - // terminate list - { - .o_name = NULL, - }, + { + .o_name = NNG_OPT_RECVFD, + .o_get = pair0_sock_get_recv_fd, + }, + { + .o_name = NNG_OPT_SENDFD, + .o_get = pair0_sock_get_send_fd, + }, + { + .o_name = NNG_OPT_SENDBUF, + .o_get = pair0_get_send_buf_len, + .o_set = pair0_set_send_buf_len, + }, + { + .o_name = NNG_OPT_RECVBUF, + .o_get = pair0_get_recv_buf_len, + .o_set = pair0_set_recv_buf_len, + }, + // terminate list + { + .o_name = NULL, + }, }; static nni_proto_pipe_ops pair0_pipe_ops = { diff --git a/src/sp/protocol/pair1/pair.c b/src/sp/protocol/pair1/pair.c index 4a909888..e6be4628 100644 --- a/src/sp/protocol/pair1/pair.c +++ b/src/sp/protocol/pair1/pair.c @@ -32,9 +32,9 @@ static void pair1_pipe_send(pair1_pipe *, nni_msg *); // pair1_sock is our per-socket protocol private structure. struct pair1_sock { - nni_sock * sock; + nni_sock *sock; bool raw; - pair1_pipe * p; + pair1_pipe *p; nni_atomic_int ttl; nni_mtx mtx; nni_lmq wmq; @@ -63,7 +63,7 @@ struct pair1_sock { // pair1_pipe is our per-pipe protocol private structure. struct pair1_pipe { - nni_pipe * pipe; + nni_pipe *pipe; pair1_sock *pair; nni_aio aio_send; nni_aio aio_recv; @@ -302,11 +302,11 @@ pair1_pipe_recv_cb(void *arg) { pair1_pipe *p = arg; pair1_sock *s = p->pair; - nni_msg * msg; + nni_msg *msg; uint32_t hdr; - nni_pipe * pipe = p->pipe; + nni_pipe *pipe = p->pipe; size_t len; - nni_aio * a; + nni_aio *a; if (nni_aio_result(&p->aio_recv) != 0) { nni_pipe_close(p->pipe); @@ -372,8 +372,8 @@ static void pair1_send_sched(pair1_sock *s) { pair1_pipe *p; - nni_msg * m; - nni_aio * a = NULL; + nni_msg *m; + nni_aio *a = NULL; size_t l = 0; nni_mtx_lock(&s->mtx); @@ -444,8 +444,8 @@ static void pair1_sock_close(void *arg) { pair1_sock *s = arg; - nni_aio * a; - nni_msg * m; + nni_aio *a; + nni_msg *m; nni_mtx_lock(&s->mtx); while (((a = nni_list_first(&s->raq)) != NULL) || ((a = nni_list_first(&s->waq)) != NULL)) { @@ -521,7 +521,7 @@ static void pair1_sock_send(void *arg, nni_aio *aio) { pair1_sock *s = arg; - nni_msg * m; + nni_msg *m; size_t len; int rv; @@ -599,7 +599,7 @@ pair1_sock_recv(void *arg, nni_aio *aio) { pair1_sock *s = arg; pair1_pipe *p; - nni_msg * m; + nni_msg *m; int rv; if (nni_aio_begin(aio) != 0) { @@ -678,7 +678,7 @@ pair1_get_send_buf_len(void *arg, void *buf, size_t *szp, nni_opt_type t) int val; nni_mtx_lock(&s->mtx); - val = nni_lmq_cap(&s->wmq); + val = (int) nni_lmq_cap(&s->wmq); nni_mtx_unlock(&s->mtx); return (nni_copyout_int(val, buf, szp, t)); @@ -713,7 +713,7 @@ pair1_get_recv_buf_len(void *arg, void *buf, size_t *szp, nni_opt_type t) int val; nni_mtx_lock(&s->mtx); - val = nni_lmq_cap(&s->rmq); + val = (int) nni_lmq_cap(&s->rmq); nni_mtx_unlock(&s->mtx); return (nni_copyout_int(val, buf, szp, t)); diff --git a/src/sp/protocol/pipeline0/push.c b/src/sp/protocol/pipeline0/push.c index ad43d967..028104cd 100644 --- a/src/sp/protocol/pipeline0/push.c +++ b/src/sp/protocol/pipeline0/push.c @@ -1,5 +1,5 @@ // -// Copyright 2020 Staysail Systems, Inc. +// Copyright 2021 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // // This software is supplied under the terms of the MIT License, a @@ -43,8 +43,8 @@ struct push0_sock { // push0_pipe is our per-pipe protocol private structure. struct push0_pipe { - nni_pipe * pipe; - push0_sock * push; + nni_pipe *pipe; + push0_sock *push; nni_list_node node; nni_aio aio_recv; @@ -85,7 +85,7 @@ static void push0_sock_close(void *arg) { push0_sock *s = arg; - nni_aio * a; + nni_aio *a; nni_mtx_lock(&s->m); while ((a = nni_list_first(&s->aq)) != NULL) { nni_aio_list_remove(a); @@ -182,8 +182,8 @@ static void push0_pipe_ready(push0_pipe *p) { push0_sock *s = p->push; - nni_msg * m; - nni_aio * a = NULL; + nni_msg *m; + nni_aio *a = NULL; size_t l; bool blocked; @@ -266,7 +266,7 @@ push0_sock_send(void *arg, nni_aio *aio) { push0_sock *s = arg; push0_pipe *p; - nni_msg * m; + nni_msg *m; size_t l; int rv; @@ -356,7 +356,7 @@ push0_get_send_buf_len(void *arg, void *buf, size_t *szp, nni_opt_type t) int val; nni_mtx_lock(&s->m); - val = nni_lmq_cap(&s->wq); + val = (int) nni_lmq_cap(&s->wq); nni_mtx_unlock(&s->m); return (nni_copyout_int(val, buf, szp, t)); -- cgit v1.2.3-70-g09d2