aboutsummaryrefslogtreecommitdiff
path: root/src/core/message.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2020-01-20 23:31:55 -0800
committerGarrett D'Amore <garrett@damore.org>2020-01-20 23:35:08 -0800
commit38c005e7c07b5ccaab3345dc8c66cbc27b95692a (patch)
tree7d35c74df9f0f320942e6c8c601e963a4cc11741 /src/core/message.c
parent058ad941dc55ad6288f6b07f4cdf237fd13f1a93 (diff)
downloadnng-38c005e7c07b5ccaab3345dc8c66cbc27b95692a.tar.gz
nng-38c005e7c07b5ccaab3345dc8c66cbc27b95692a.tar.bz2
nng-38c005e7c07b5ccaab3345dc8c66cbc27b95692a.zip
fixes #1169 survey and xsurvey could use message cloning
fixes #1160 Consider limiting maximum hop count to 15 fixes #1098 Maximum maxTTL should be compile time defined This doesn't expose the max-MaxTTL in the CMakeList.txt -- there is really no reason anyone should be changing it. This does not yet inline the message header into the nni_msg_t, but it is my intention to do so soon, and eliminate most of the conditional cases for failure on inserting into the header.
Diffstat (limited to 'src/core/message.c')
-rw-r--r--src/core/message.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/message.c b/src/core/message.c
index 888585ad..00b23a55 100644
--- a/src/core/message.c
+++ b/src/core/message.c
@@ -470,9 +470,9 @@ nni_msg_alloc(nni_msg **mp, size_t sz)
return (NNG_ENOMEM);
}
- // 64-bytes of header, including room for 32 bytes
- // of headroom and 32 bytes of trailer.
- if ((rv = nni_chunk_grow(&m->m_header, 32, 32)) != 0) {
+ // Header size is strictly limited. We need max hops plus one for
+ // the request or survey ID. TODO: Inline the header (no chunk).
+ if ((rv = nni_chunk_grow(&m->m_header, NNI_MAX_HEADER_SIZE, 0)) != 0) {
NNI_FREE_STRUCT(m);
return (rv);
}