aboutsummaryrefslogtreecommitdiff
path: root/src/sp/protocol/pipeline0/pull.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-04-14 15:43:59 -0700
committerGarrett D'Amore <garrett@damore.org>2024-04-14 18:52:56 -0700
commit82b322a37bcf890275f91b56a9a0347be056be9d (patch)
tree42a5f763f963c178b854e9326ef89f0d21582424 /src/sp/protocol/pipeline0/pull.c
parent2b967f48a669f7199c40bc730f800e53d6d4fb72 (diff)
downloadnng-82b322a37bcf890275f91b56a9a0347be056be9d.tar.gz
nng-82b322a37bcf890275f91b56a9a0347be056be9d.tar.bz2
nng-82b322a37bcf890275f91b56a9a0347be056be9d.zip
Log protocol connections rejected by protocol.
Diffstat (limited to 'src/sp/protocol/pipeline0/pull.c')
-rw-r--r--src/sp/protocol/pipeline0/pull.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/sp/protocol/pipeline0/pull.c b/src/sp/protocol/pipeline0/pull.c
index 07d55405..40dd514c 100644
--- a/src/sp/protocol/pipeline0/pull.c
+++ b/src/sp/protocol/pipeline0/pull.c
@@ -1,5 +1,5 @@
//
-// Copyright 2021 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
@@ -39,9 +39,9 @@ struct pull0_sock {
// pull0_pipe is our per-pipe protocol private structure.
struct pull0_pipe {
- nni_pipe * p;
- pull0_sock * s;
- nni_msg * m;
+ nni_pipe *p;
+ pull0_sock *s;
+ nni_msg *m;
nni_aio aio;
bool closed;
nni_list_node node;
@@ -104,6 +104,9 @@ pull0_pipe_start(void *arg)
if (nni_pipe_peer(p->p) != NNI_PROTO_PUSH_V0) {
// Peer protocol mismatch.
+ nng_log_warn("NNG-PEER-MISMATCH",
+ "Peer protocol mismatch: %d != %d, rejected.",
+ nni_pipe_peer(p->p), NNI_PROTO_PUSH_V0);
return (NNG_EPROTO);
}
@@ -137,9 +140,9 @@ pull0_recv_cb(void *arg)
{
pull0_pipe *p = arg;
pull0_sock *s = p->s;
- nni_aio * ap = &p->aio;
- nni_aio * as;
- nni_msg * m;
+ nni_aio *ap = &p->aio;
+ nni_aio *as;
+ nni_msg *m;
if (nni_aio_result(ap) != 0) {
// Failed to get a message, probably the pipe is closed.
@@ -185,7 +188,7 @@ static void
pull0_sock_close(void *arg)
{
pull0_sock *s = arg;
- nni_aio * a;
+ nni_aio *a;
nni_mtx_lock(&s->m);
while ((a = nni_list_first(&s->rq)) != NULL) {
nni_aio_list_remove(a);