diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-04-16 07:29:23 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-04-17 23:29:14 -0700 |
| commit | 1941fdae7eca1b92a957dfffa6a1ec7ef549dc60 (patch) | |
| tree | b0a0a0eb4e634fea60cf9cf1c9bde6a7824a9e66 /src/sp/transport/tcp | |
| parent | d230d9b7569f780043f12eac846d96c3ec555f3b (diff) | |
| download | nng-1941fdae7eca1b92a957dfffa6a1ec7ef549dc60.tar.gz nng-1941fdae7eca1b92a957dfffa6a1ec7ef549dc60.tar.bz2 nng-1941fdae7eca1b92a957dfffa6a1ec7ef549dc60.zip | |
Log messages when peer sends too large message.
Also while here, remove unused sockaddr members from some structs.
This should save a bit of memory for servers with a lot of conns.
Diffstat (limited to 'src/sp/transport/tcp')
| -rw-r--r-- | src/sp/transport/tcp/tcp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sp/transport/tcp/tcp.c b/src/sp/transport/tcp/tcp.c index a9075938..dfc3d20c 100644 --- a/src/sp/transport/tcp/tcp.c +++ b/src/sp/transport/tcp/tcp.c @@ -55,8 +55,7 @@ struct tcptran_ep { bool started; bool closed; nng_url *url; - const char *host; // for dialers - nng_sockaddr src; + const char *host; // for dialers int refcnt; // active pipes nni_aio *useraio; nni_aio *connaio; @@ -385,6 +384,9 @@ tcptran_pipe_recv_cb(void *arg) // Make sure the message payload is not too big. If it is // the caller will shut down the pipe. if ((len > p->rcvmax) && (p->rcvmax > 0)) { + nng_log_warn("NNG-RCVMAX", + "Rejected oversize message of %lu bytes on TCP", + (unsigned long) len); rv = NNG_EMSGSIZE; goto recv_error; } |
