Solution: this test failed because "_disconnected" is not initialized
in constructor, and the behavior of reconnect will not be as designed
when "_disconnected" is randomly assigned to true.
So we specify it as false in initialize list to solve this problem.
Solution: don't use rt if not `RT_LIBRARY`
This currently causes the check to fail on macOS:
```bash
/Library/Developer/CommandLineTools/usr/bin/c++ -std=c++11 -Wno-tautological-constant-compare -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_8466b.dir/CheckSymbolExists.cxx.o -o cmTC_8466b -lrt
ld: library 'rt' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
even though `clock_gettime` is available.
Move the `clock_gettime` check up with the other librt related checks,
and don't set `CMAKE_REQUIRED_LIBRARIES` if not `RT_LIBRARY`.
solution: only use `-errwarn` on SunPro systems
For example, using Clang on Alpine, this just results in build spam, and
the option is incorrectly passed through to ld, which trys to use use it
(`-e`) as an entrypoint, i.e:
```bash
[ 28%] Building CXX object CMakeFiles/local_lat.dir/perf/local_lat.cpp.o
clang++: warning: -e rrwarn=%all: 'linker' input unused [-Wunused-command-line-argument]
[ 29%] Linking CXX executable bin/local_lat
/usr/bin/ld: warning: cannot find entry symbol rrwarn=%all; defaulting to 0000000000000cf0
[ 29%] Built target local_lat
```
Solution: Install `libtool`. This seems to be the issue, given the CI
output of a recent run, i.e:
```bash
configure.ac:1023: the top level
configure.ac:80: error: possibly undefined macro: AC_LIBTOOL_WIN32_DLL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:81: error: possibly undefined macro: AC_PROG_LIBTOOL
configure:7350: error: possibly undefined macro: AC_DISABLE_STATIC
configure:7354: error: possibly undefined macro: AC_ENABLE_STATIC
autoreconf: error: /opt/homebrew/Cellar/autoconf/2.72/bin/autoconf failed with exit status: 1
autogen.sh: error: autoreconf exited with status 1
+ exit 1
```
https://github.com/zeromq/libzmq/actions/runs/9841129190/job/27167025854?pr=4699#step:12:200
This fixes several instances where _MSC_VER was used to determine whether to use afunix.h or not. For example, MinGW requires the use of afunix.h but does not define _MSC_VER. The correct behavior is checking ZMQ_HAVE_WINDOWS.
Signed-off-by: Stephan Lachnit <stephanlachnit@debian.org>
The builtin SHA1 (ZMQ_USE_BUILTIN_SHA1) is only used in the websocket
engine (ws_engine.cpp), so if websockets are disabled, i.e
-DENABLE_DRAFTS=OFF, don't add sha1.c to the sources list.
On macOS, mkdtemp is in unistd.h. Fix the CMake check so that is works.
This was discovered when comparing the output of the Autotools an CMake
build systems.
ENABLE_CURVE is currently redundant with WITH_LIBSODIUM, as the only existing provider
now builds where requested configuration is not found fail rather than proceeding without requested features
There is no such thing as `+=` unless you happen to be using the Bash
programming language, i.e. your script shebang is /bin/bash.
However, configure scripts are run via /bin/sh instead, which may or may
not be be bash, usually depending on whether the system in question
preferred to have one less package installed (in which case it is bash)
vs. have a faster /bin/sh installed (in which case it is probably the
dash shell).
Solution: Convert utf-8 socket paths to utf-16 file names when using
filesystem calls to delete files and directories as Windows doesn't
have any filesystem calls that take utf-8 path.
rmdir_utf8() and unlink_utf8() static functions were created which
substitute rmdir() and unlink() when building on Windows.
On its own, -std=c11 hides POSIX and other extensions from C headers
such as <stdlib.h> when building against glibc. This causes the
posix_memalign probe to fail incorrectly with compilers that do not
accept implicit function declarations. _DEFAULT_SOURCE is ignored by
most non-GNU/Linux systems or not relevant in this context, so there
is no separate check for adding it.
* Feature: integrate libzmq with ReadTheDocs
* add readthedocs configuration file to convert Asciidoc files into HTML and HTMLZIP formats using Asciidoctor.js tool (the only Asciidoctor variant available on readthedocs so far)
* migrate from the old, unmaintained "asciidoc-py" tool to the new "asciidoctor" generator
* migrate from asciidoc-py syntax to the modern Asciidoc syntax (especially page titles and section titles)
* remove the need of "xmlto" utility to create the manpage output; use asciidoctor for that
* add HTML output support to the doc/Makefile by using asciidoctor
* change API documentation files extension from .txt to .adoc to make it more explicit that they are Asciidoc-encoded (as a bonus several IDE plugins will autodetect the .adoc format as Asciidoc)
* remove asciidoc.conf: asciidoctor does not support that; this also required replacing the macro linkzmq into all documentation pages
* add a new Github action CI do deploy to Github Pages the static HTMLs produced by Asciidoctors
* removed references to the "xmlto" and "a2x" tools from the build and packaging systems: Asciidoctor can convert the documentation directly to e.g. pdf (via extended converters) and anyway there was no code/target for using "xmlto" and "a2x" tools anyway
Under some circumstances (which probably no longer apply in master) gcc inlined get_monitor_event into test_null_creds and then emitted a "maybe uninitialized" warning on the use of error. This would only be a problem if the tested code was misbehaving but I guess that's the point of a test!
Problem: reimplemented zmq_proxy_steerable control socket type is not
backwards compatible - replies are always sent.
In the past, zmq_proxy_steerable never sent a reply for
commands that weren't STATISTICS, so only really worked with PAIR and didn't
work at all with REP. Now it only supports REP and PAIR semantics changed. This
breaks compatibility with PAIR in a subtle and slightly annoying way if
HWMs are hit without reading the replies.
Solution: Add a check to send the empty reply only for
REP control sockets. This restores backwards compatibility, and supports
REP, PAIR, and SUB (for non-reply commands).
I had no knowledge of the pre-MPL-2.0 implementation. This fix is based
on docs and prior API usage. I contribute this under MPL-2.0.
Problem: the new reimplementation of zmq_proxy_steerable had PAUSE/RESUME
that didn't follow expected behaviour. Possibly mixed up. Test didn't properly
cover the issue.
Solution: improve test coverage, fix the proxy command parsing.
I had no knowledge of the pre-MPL-2.0 implementation. This fix is based
on documented semantics and prior API usage. I contribute this
under MPL-2.0.
It is contriubted under the MPL-2.0.
I had no knowledge of the previous implementation of zmq_proxy_steerable().
This version was developed based on expectations set in the old man page with one exception. This version uses a REP/REQ for the proxy control protocol sockets. The old man page example used PUB/SUB which is nonsensical given the STATISTICS command requires two way communication.
For the GNU Grep package version >= 3.8, the `egrep` command emits:
```
egrep: warning: egrep is obsolescent; using grep -E
```
which makes the `./autogen.sh` script very noisy.