From 49076237cc0b82e7007535e789f3fadc19a18c45 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 3 Nov 2024 10:12:28 -0800 Subject: Remove NNI_TYPE_OPAQUE altogether. This also fixes a couple of minor bugs -- changing the socket name could be incorrect as the termination was not applied properly, and the ZeroTier code got a change -- note that it is only possible in this revised version to pass a single moon ID for ZT orbit. The ZT code is a bit stale, and untested anyway. --- src/core/sock_test.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/core/sock_test.c') diff --git a/src/core/sock_test.c b/src/core/sock_test.c index 28a1201a..1fe94e4c 100644 --- a/src/core/sock_test.c +++ b/src/core/sock_test.c @@ -1,5 +1,5 @@ // -// Copyright 2020 Staysail Systems, Inc. +// Copyright 2024 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // // This software is supplied under the terms of the MIT License, a @@ -123,6 +123,13 @@ test_socket_name(void) // strings must not be too long NUTS_FAIL( nng_socket_set_string(s1, NNG_OPT_SOCKNAME, buf), NNG_EINVAL); + memset(buf, 'A', 64); + buf[64] = 0; + NUTS_FAIL( + nng_socket_set_string(s1, NNG_OPT_SOCKNAME, buf), NNG_EINVAL); + buf[63] = 0; + NUTS_PASS(nng_socket_set_string(s1, NNG_OPT_SOCKNAME, buf)); + NUTS_PASS(nng_socket_set_string(s1, NNG_OPT_SOCKNAME, "hello")); NUTS_PASS(nng_socket_get_string(s1, NNG_OPT_SOCKNAME, &str)); NUTS_ASSERT(str != NULL); -- cgit v1.2.3-70-g09d2