aboutsummaryrefslogtreecommitdiff
path: root/tests/tcp.c
Commit message (Collapse)AuthorAge
* tests: tcp test converted to NUTSGarrett D'Amore2024-11-30
| | | | | TCPv6 not done yet since that needs special work to be conditionalized. Also tcpsupp remains to be converted.
* Remove untyped nng_pipe_get, support for untyped sockaddr set.Garrett D'Amore2024-11-03
| | | | This is a step on the path to removing unsafe untyped option accesses.
* Fixes for some security complaints.Garrett D'Amore2022-12-31
| | | | | | | None of these changes are actual security bugs, but GitHub's scanner reports false positives at Critical severity for them. (There are a number of complaints from that scanner, many of which we do not necessarily agree with.)
* don't use deprecated functions in tests (#1560)Edward Rudd2021-12-29
|
* fixes #1401 valgrind reports leaks in all testsGarrett D'Amore2021-01-03
| | | | | | | This arranges for nng_fini to be called via atexit in the test version of the library. It also cleans up some of the actual tests to reduce extraneous (and in some cases incorrect) calls to nng_fini.
* Work for test refactoring.Garrett D'Amore2020-11-18
| | | | | | | | | | | | | | | | | | | | | | There are a few major areas in this change. * CMake options are now located in a common cmake/NNGOptions.cmake file. This should make it easier for folks to figure out what the options are, and how they are used. * Tests are now scoped with their directory name, which should avoid possible name collisions with test names. * A number of tests have been either moved or incorporated into the newer testutil/acutest framework. We are moving away from my old c-convey framework to something easier to debug. * We use CMake directories a bit more extensively leading to a much cleaner CMake structure. It's not complete, but a big step in the right direction, and a preview of future work. * Tests are now run with verbose flags, so we get more test results in the CI/CD logs.
* fixes #1279 Add support for ws4:// and ws6:// style websocket urlsGarrett D'Amore2020-08-08
| | | | fixes #1277 FreeBSD errors due to bad v4 vs. v6 assumptions
* fixes #825 TCP public API should use generic setopt/getoptGarrett D'Amore2018-12-31
| | | | | | | | | | | | This changes much of the internal API for TCP option handling, and includes hooks for some of this in various consumers. Note that the consumers still need to have additional work done to complete them, which will be part of providing public "raw" TLS and WebSocket APIs. We would also like to finish addressing the call sites of nni_tcp_listener_start() that assume the sockaddr is modified -- it would be superior to use the NNG_OPT_LOCADDR option. Thaat will be addressed in a follow up PR.
* move all public headers to include/nng/ folderGregor Burger2018-11-22
| | | | | | | | | | This change makes embedding nng + nggpp (or other projects depending on nng) in cmake easier. The header files are moved to a separate include directory. This also makes installation of the headers easier, and allows clearer identification of private vs public heade files. Some additional cleanups were performed by @gedamore, but the main credit for this change belongs with @gregorburger.
* fixes #678 local binding for TLS+TCP socketsGarrett D'Amore2018-08-28
|
* fixes #608 Add TCP support to specify local network interfaceGarrett D'Amore2018-08-27
| | | | | This also fixes a leaked TCP connection on a failure path, which we noticed while working this change.
* fixes #469 SO_REUSEADDR should be enabledGarrett D'Amore2018-05-21
| | | | | | | | | | | | | | | | | | | fixes #468 TCP nodelay and keepalive should start usable fixes #467 NN_RCVMAXSZ option does not work (compat) fixes #465 Support NN_OPT_TCPNODELAY (compat) This is a rather larger change set than I'd like, but when adding support for legacy TCP keepalive, I found a number if issues using the legacy TCP test (which we are introducing with this commit.) This fixes the concerns that are relevant and addressible. We have elected not to try to support to local address binding at this time, and the IPv6 test case in the old code was wrong, so changes relevant to that are commented out. I've also updated the nng_compat manual page to reflect additional caveats that folks should be aware of, including the previously undocumented caveat around the NN_SNDBUF and NN_RCVBUF options.
* fixes #381 Want comparators for various typesGarrett D'Amore2018-05-01
|
* fixes #375 integer types are error proneGarrett D'Amore2018-04-26
| | | | | | | | | | | | | | This change converts the various integer types like nng_socket in the public API to opaque structures that are passed by value. Basically we just wrap the integer ID. This "hack" give us strong type checks by the compiler (yay!), at the expense of not being able to directly use these as numbers (so comparisions for example don't work, and neither does initialization to zero using the normal method. Comparison of disassembly output shows that at least with the optimizer enabled there is no difference in the compiler output between using a structure or an integral value.
* fixes #105 Want NNG_OPT_TCP_NODELAY optionGarrett D'Amore2018-04-26
| | | | fixes #106 TCP keepalive tuning
* fixes #301 String option handling for getoptGarrett D'Amore2018-03-20
|
* fixes #289 nng_sockaddr could just be a unionGarrett D'Amore2018-03-14
| | | | fixes #290 sockaddr improvements
* fixes #262 NNG_OPT_URL should be resolvedGarrett D'Amore2018-03-04
| | | | | | | | This causes TCP, TLS, and ZT endpoints to resolve any wildcards, and even IP addresses, when reporting the listen URL. The dialer URL is reported unresolved. Test cases for this are added as well, and nngcat actually reports this if --verbose is supplied.
* fixes #234 Investigate enabling more verbose compiler warningsGarrett D'Amore2018-02-14
| | | | | | | We enabled verbose compiler warnings, and found a lot of issues. Some of these were even real bugs. As a bonus, we actually save some initialization steps in the compat layer, and avoid passing some variables we don't need.
* Convert existing websocket and http code to use new URL framework.Garrett D'Amore2018-01-05
| | | | | | This also fixes a use-after-free bug in the HTTP framework, where the handler could be deleted why callbacks were still using it. (We now reference count the handlers.)
* fixes #143 Protocols and transports should be "configurable"Garrett D'Amore2017-11-02
| | | | | | | | | | | | | | | | | | | | This makes all the protocols and transports optional. All of them except ZeroTier are enabled by default, but you can now disable them (remove from the build) with cmake options. The test suite is modified so that tests still run as much as they can, but skip over things caused by missing functionality from the library (due to configuration). Further, the constant definitions and prototypes for functions that are specific to transports or protocols are moved into appropriate headers, which should be included directly by applications wishing to use these. We have also added and improved documentation -- all of the transports are documented, and several more man pages for protocols have been added. (Req/Rep and Surveyor are still missing.)
* fixes #127 Bad format TCP address causes null pointer exceptionGarrett D'Amore2017-10-23
| | | | I've added some tests to validate this too.
* Improve UDP test coverage, fix numerous issues found.Garrett D'Amore2017-10-05
| | | | | | | | | | | | | | | | We introduced richer, deeper tests for UDP functionality. These tests uncovered a number of issues which this commit fixes. The Windows IOCP code needs to support multiple aios on a single nni_win_event. A redesign of the IOCP handling addresses that. The POSIX UDP code also needed fixes; foremost among them is the fact that the UDP file descriptor is not placed into non-blocking mode, leading to potential hangs. A number of race conditions and bugs along the implementation of the above items were uncovered and fixed. To the best of our knowledge the current code is bug-free.
* fixes #5 Address propertiesGarrett D'Amore2017-10-03
| | | | | | | | | Added TCP socket address properties on pipes. This adds the plumbing for the various platform specifics, and includes both v4 and v6 handling. We've included a TCPv6 test as well.
* fixes #63 NNG_FLAG_SYNCH should be the defaultGarrett D'Amore2017-08-14
| | | | | Also enables creating endpoints that are idle (first part of endpoint options API) and shutting down endpoints.
* fixes #48 tcp sometimes fails to get a portGarrett D'Amore2017-08-09
|
* fixes #44 open protocol by "name" (symbol) instead numberGarrett D'Amore2017-08-09
| | | | | | | | | | | | | | fixes #38 Make protocols "pluggable", or at least optional This is a breaking change, as we've done away with the central registered list of protocols, and instead demand the user call nng_xxx_open() where xxx is a protocol name. (We did keep a table around in the compat framework though.) There is a nice way for protocols to plug in via an nni_proto_open(), where they can use a generic constructor that they use to build a protocol specific constructor (passing their ops vector in.)
* Move TCP negotiation out of sync accept/connect.Garrett D'Amore2017-07-05
|
* Adds NNG_OPT_SENDFD and NNG_OPT_RECVFD socket options (untested).Garrett D'Amore2017-01-21
|
* Initial swag at notification pipes (not used yet).Garrett D'Amore2017-01-21
|
* Fix leaks in bus, socket leaks, tighten up close-side refcnting.Garrett D'Amore2017-01-21
| | | | | | | | | | | | | | This does a few things. First it closes some preexisting leaks. Second it tightens the overall close logic so that we automatically discard idhash resources (while keeping numeric values for next id etc. around) when the last socket is closed. This then eliminates the need for applications to ever explicitly terminate resources. It turns out platform-specific resources established at nni_init() time might still be leaked, but it's also the case that we now no longer dynamically allocate anything at platform initialization time. (This presumes that the platform doesn't do so under the hood when creating critical sections or mutexes for example.)
* fixes #18 Sockets should be uint32_t's (handles) not pointers.Garrett D'Amore2017-01-20
|
* Fix TCP hostname wildcards on Windows. Sort of.Garrett D'Amore2017-01-18
| | | | | | | | | I seem to be having a very difficult time getting dual-stack sockets to function properly on Windows. I've sort of abandoned it for now. I need to think about how to solve this -- it's not clear to me right now whether dual stack sockets are the right answer or not. People do expect these to work, but a tcp6:// url might be more elegant.
* Address segfault in TCP, and fix wild card handling.Garrett D'Amore2017-01-18
|
* Fixes for valgrind issues.Garrett D'Amore2017-01-18
|
* Change a bunch of copyrights to 2017 for work done since the 1st.Garrett D'Amore2017-01-05
|
* Starting a common transport testing framework.Garrett D'Amore2017-01-04