* Problem : if socket is invalid for any reason, as_socket_base_t() will return NULL and 'as_socket_base_t (items_[i].socket)->is_thread_safe ()' will crash
Solution: expand the code to test the returned value from as_socket_base_t() before calling is_thread_safe() and make zmq_poll() return -1 if as_socket_base_t() returned NULL.
NB: this occurred on the destruction of a SUB socket while running a zloop and without previously calling zloop_reader_set_tolerant and zloop_reader_end. When entering zmq_poll, the PUB socket was already destroyed but still registered in the poll items.
NB: making zmq_poll return -1 is OK as it is what happens anyway, and errno is properly set to ENOTSOCK by as_socket_base_t() when it returns NULL.
Co-authored-by: Stéphane Valès <stephane@vales.fr@users.noreply.github.com>
* Modifications to compile code for WINDOWS ARM and ARM64
[why]
In order to compile ZMQ related software on WINDOWS ARM
[how]
Replaced code in the file clock.cpp around the line 240.
Added intrinsics for ARM to replace '__rdtsc'
[todo]
Find proper tick counter query for ARM64 (see file:clock.cpp,line:~250)
* RELICENSEing
[why]
To make usage of changed code properly usable by libzmq project team
[how]
Added file /RELICENSE/kalantar.md with necessary information
This commit updates the Dockerfile to use multiple stages. In the first stage, compile-time dependencies are installed, and libzmq is compiled and tested. The second stage starts with a fresh, slim Docker image, and the compiled outputs of the first stage are copied over. Runtime dependencies, like libsodium and kerberos, are installed as well.
Using -Werror has been disabled for Darwin since very early on in the
codebase. However at this point, I can't see an obvious reason why it
should still be disabled compared to when building for the other
operating systems.
I've tested compiling on macOS using Apple Clang 11.0.3, LLVM Clang
10.0.0 and GCC 10.1.
* build_ios.sh now build for different archs
* change typo on build_ios.sh
Co-authored-by: Roberto Santacroce Martins <roberto.martins@transferoswiss.ch>
Master doesn't currently compile when crossing compiling using
autotools and mingw-w64. i.e:
```bash
x86_64-w64-mingw32-g++ (GCC) 9.3.0
./autogen.sh
./configure --host=x86_64-w64-mingw32
make src/libzmq.la
....
CXX src/libzmq_la-curve_server.lo
In file included from src/address.cpp:37:
src/ipc_address.hpp:40:10: fatal error: sys/socket.h: No such file or directory
40 | #include <sys/socket.h>
| ^~~~~~~~~~~~~~
compilation terminated.
```
I assume this hasn't been caught because appveyor is using CMake.
Mingw also does not have an afunix.h header. There is a thread upstream,
but there doesn't seem to have been any discussion:
https://sourceforge.net/p/mingw-w64/discussion/723797/thread/4c8ecdbe0d/.