summaryrefslogtreecommitdiff
path: root/src/core/message.c
Commit message (Collapse)AuthorAge
* fixes #1808 nng_msg_insert: munmap_chunk(): invalid pointerGarrett D'Amore2024-04-24
| | | | | | | With specific message sizes, we the shuffle of data for msg insert can calculate the wrong value, leading to heap corruption. This includes a stress test for msg insert to hopefully exercise every reasonable edge case.
* fixes #1541 bug in nni_chunk_insertGarrett D'Amore2021-12-02
|
* Fix for UB (NULL pointer plus zero length). (#1459)Garrett D'Amore2021-07-06
|
* Add & document msg_capacity, msg_reserve (#1458)Evan Balster2021-07-06
| | | | | | | * Add & document msg_capacity, msg_reserve * reserve/capacity code style * Documentation references to reserve/capacity
* fixes #808 Very slow PAIR performance compared to nanomsgGarrett D'Amore2021-01-18
| | | | | | This is only the pair v1 protocol. Pair v0 and polyamorous mode still have work to do. We probably won't "fix" the performance for poly mode since that's deprecated anyway.
* fix #1252jeikabu2020-06-16
| | | | - nng_msg_clear should only clear the message body and not the head. Add test to verify
* fixes #1171 message header could be inlined in the message structureGarrett D'Amore2020-02-26
| | | | | This uses a maximum 64-byte header and should avoid allocations and cache misses, leading to a small performance boost overall.
* Fix possible use after freeEvgeny Ermakov2020-02-05
|
* fixes #1169 survey and xsurvey could use message cloningGarrett D'Amore2020-01-20
| | | | | | | | | | | 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.
* fixes #1156 Message cloning could help reduce copies a lotGarrett D'Amore2020-01-20
| | | | | | | | | | | | This introduces reference counting on messages to reduce the data copies. This should have a marked improvement when moving large messages through the system, or when publishing to many subscribers. For some transports, when using large messages, the copy time can be the dominant factor. Note that when a message is actually shared, inproc will still perform an extra copy in order to ensure that it can modify the headers. This will unfortunately always be the case with REQ, as the REQ protocol keeps a copy of the original message so it can retry.
* fixes #1145 nng_msg options should be removedGarrett D'Amore2020-01-19
|
* XREQ and others race on TTL.Garrett D'Amore2020-01-11
| | | | | | | | | | The TTL in these cases should have been atomic. To facilitate things we actually introduce an atomic int for convenience. We also introduce a convenience nni_msg_must_append_u32() and nni_msg_header_must_append_u32(), so that we can eliminate some failure tests that cannot ever happen. Combined with a new test for xreq, we have 100% coverage for xreq and more coverage for the other REQ/REP protocols.
* fixes #1004 Warning found by clang --analyzeGarrett D'Amore2019-11-11
| | | | | It's possible for an empty chunk to have a NULL data pointer. Even when copying zero bytes, this makes clang somewhat unhappy.
* nng_msg_dup correctly duplicates pipe (mentioned in #862)Jake Woltersdorf2019-03-12
|
* remove redundant zero memory operationsQXSoftware2018-10-12
|
* fix function "int nni_msg_alloc(nni_msg **mp, size_t sz)" allocates the ↵QXSoftware2018-10-02
| | | | underlying buffer twice under some circumstance, say, sz = 1024 or 2048
* fixes #691 Desire 16 and 64 bit message manipulatorsGarrett D'Amore2018-08-31
| | | | | | We use macros to generate message bodies for each of the various variants, reducing source code size (but not compiled size). The documentation is updated to indicate each of these variants.
* fixes #605 NNI_ALLOC_STRUCT/NNI_ALLOC_STRUCTS should zero memoryGarrett D'Amore2018-07-24
|
* fixes #396 illumos doesn't build (missing NNG_PLATFORM_POSIX ON)Garrett D'Amore2018-05-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | fixes #397 Need to cast zoneid fixes #395 sun is predefined on illumos/Solaris fixes #394 alloca needs to #include <alloca.h> fixes #399 Cannot use SVR4.2 specific msghdr fixes #402 getpeerucred needs a NULL initialized ucred fixes #403 syntax error in posix_tcp - attempt to return void fixes #407 illumos getegid wrong fixes #406 nni_idhash_count is dead code fixes #404 idhash typedef redeclared fixes #405 warning: newline not last character in file This is basically a slew of related bug fixes required to make this work on illumos. Note that the fixes are not "complete", because more work is required to support port events given that epoll is busted on illumos. We also fixed a bunch of things that aren't actually "bugs" per se, but really just warnings. Silencing them makes things better for everyone. Apparently not all compilers are equally happy with redundant (but otherwise identical) typedefs; we use structs in some places instead of shorter type names to silence these complaints. Note that IPC permissions (the mode bits on the socket vnode) are not validated on SunOS systems. This change includes documentation to reflect that.
* fix a number of cppcheck complaints (not all)Garrett D'Amore2018-04-24
|
* fixes #2 Websocket transportGarrett D'Amore2017-12-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a rather large changeset -- it fundamentally adds websocket transport, but as part of this changeset we added a generic framework for both HTTP and websocket. We also made some supporting changes to the core, such as changing the way timeouts work for AIOs and adding additional state keeping for AIOs, and adding a common framework for deferred finalization (to avoid certain kinds of circular deadlocks during resource cleanup). We also invented a new initialization framework so that we can avoid wiring in knowledge about them into the master initialization framework. The HTTP framework is not yet complete, but it is good enough for simple static serving and building additional services on top of -- including websocket. We expect both websocket and HTTP support to evolve considerably, and so these are not part of the public API yet. Property support for the websocket transport (in particular address properties) is still missing, as is support for TLS. The websocket transport here is a bit more robust than the original nanomsg implementation, as it supports multiple sockets listening at the same port sharing the same HTTP server instance, discriminating between them based on URI (and possibly the virtual host). Websocket is enabled by default at present, and work to conditionalize HTTP and websocket further (to minimize bloat) is still pending.
* Don't compile in message dumping by default.Garrett D'Amore2017-08-12
|
* Unify the msg API.Garrett D'Amore2017-08-10
| | | | | | | | | | | | | This makes the operations that work on headers start with nni_msg_header or nng_msg_header. It also renames _trunc to _chop (same strlen as _trim), and renames prepend to insert. We add a shorthand for clearing message content, and make better use of the endian safe 32-bit accessors too. This also fixes a bug in inserting large headers into messages. A test suite for message handling is included.
* Add new PAIR_V1 protocol.Garrett D'Amore2017-08-10
| | | | | | | | | | The PAIR_V1 protocol supports both raw and cooked modes, and has loop prevention included. It also has a polyamorous mode, wherein it allows multiple connections to be established. In polyamorous mode (set by an option), the sender requests a paritcular pipe by setting it on the message. We default to PAIR_V1 now.
* Give up on uncrustify; switch to clang-format.Garrett D'Amore2017-07-10
|
* Start of event framework.Garrett D'Amore2017-01-16
| | | | | | | | | | This compiles correctly, but doesn't actually deliver events yet. As part of this, I've made most of the initializables in nng safe to tear-down if uninitialized (or set to zero e.g. via calloc). This makes it loads easier to write the teardown on error code, since I can deinit everything, without worrying about which things have been initialized and which have not.
* Various complaints found in AppVeyor build.Garrett D'Amore2017-01-16
|
* Message API was awkward.Garrett D'Amore2017-01-06
| | | | | | | The use of a single function to get both size and length actually turned out to be awkward to use; better to have separate functions to get each. While here, disable some of the initialization/fork checks, because it turns out they aren't needed.
* Fixes to enable REQ/REP to operate.Garrett D'Amore2017-01-02
| | | | | | | This uncovered a few problems - inproc was not moving the headers to the body on transmit, and the message chunk allocator had a serious bug leading to memory corruption. I've also added a message dumper, which turns out to be incredibly useful during debugging.
* Use new NNI_ALLOC_STRUCT macro. nni_msg_dup copies options too.Garrett D'Amore2017-01-02
|
* Add new nni_msg_dup() API. (Needed for REQ protocol.)Garrett D'Amore2016-12-28
|
* Message allocation fixed. Comparison was backwards.Garrett D'Amore2016-12-27
|
* Change in handling of extended info for messages.Garrett D'Amore2016-12-24
| | | | | | | | Instead of supplying a pipe, and expecting that the info there would be included we use nng_msg_getopt(). This will be enabled by the app asking for extended information by setting an option, we don't copy the data for every app (most won't care). This means we don't have to worry about reference counting the pipe for the life of associated messages.
* Uncrustify fixes.Garrett D'Amore2016-12-23
|
* C99 comment style.Garrett D'Amore2016-12-22
|
* Work on endpoints. More C99 & type cleanups.Garrett D'Amore2016-12-22
|
* Uncrustify configuration, and shorter copyright banners, plus reformatGarrett D'Amore2016-12-21
| | | | code with uncrustify. (Minor adjustments.) No more arguments!
* Better separate public vs. private names.Garrett D'Amore2016-12-14
|
* New inproc transport.Garrett D'Amore2016-12-12
| | | | Lots of supporting changes.
* More message API.Garrett D'Amore2016-12-11
|
* Message allocation, deallocation, reallocation.Garrett D'Amore2016-12-10
|
* Initial commit. This is not going to be useful to you for anything.Garrett D'Amore2016-12-10