Commit Graph

21 Commits

Author SHA1 Message Date
mjvankampen
2dd24d6d80
Problem: norm fails to compile under windows (#4123)
* Makes norm useable (but maybe slow) on windows
2021-01-18 08:42:14 +00:00
Luca Boccassi
a4dbdb614e Problem: some platforms do not have strnlen
Solution: move compat redefinition to compat.hpp header so that
it can be used from msg.cpp
2020-08-21 14:39:08 +01:00
Gudmundur Adalsteinsson
7b1fef28f9
Problem: boilerplate when init msg from data copy (#3860)
* Problem: boilerplate when init msg from data copy

Solution: Add zmq_msg_init_buffer to construct
a message by copying memory from buffer.
2020-04-09 23:59:43 +01:00
Luca Boccassi
ac552ba448 Problem: accept4 not available on all platforms
Solution: check for availability in CMake and autoconf before using it
2017-11-18 11:33:53 +00:00
Ilya Kulakov
656cdb959a Problem: Race condition in IPC sockets
Solution: Don't unlink file on close

File may not belong to the socket at that point.
2017-10-05 14:57:10 -07:00
sigiesec
301f3c70c2 Problem: code duplication between curve_client_t and curve_server_t decode and encode
Solution: extracted common base class curve_mechanism_base_t
2017-08-18 11:34:22 +02:00
sigiesec
406af1ef67 Problem: ZAP tests are now generic but placed in test_security_curve.cpp
Solution: Move ZAP tests to own file test_security_zap.cpp, move common code to testutil_security.hpp
2017-08-17 11:45:18 +02:00
sigiesec
6e8a0b31be Problem: ZAP client code is duplicated in all mechanisms
Solution: created a zap_client_t class, extracted first function send_zap_request from curve_server_t
2017-08-16 18:04:30 +02:00
Brian Russell
b963542e8f Add socket option BINDTODEVICE
Linux now supports Virtual Routing and Forwarding (VRF) as per:

https://www.kernel.org/doc/Documentation/networking/vrf.txt

In order for an application to bind or connect to a socket with an
address in a VRF, they need to first bind the socket to the VRF device:

    setsockopt(sd, SOL_SOCKET, SO_BINDTODEVICE, dev, strlen(dev)+1);

Note "dev" is the VRF device, eg. VRF "blue", rather than an interface
enslaved to the VRF.

Add a new socket option, ZMQ_BINDTODEVICE, to bind a socket to a device.
In general, if a socket is bound to a device, eg. an interface, only
packets received from that particular device are processed by the socket.

If device is a VRF device, then subsequent binds/connects to that socket
use addresses in the VRF routing table.
2017-07-31 15:31:47 +01:00
Luca Boccassi
15fd419f22 Problem: test_large_msg requires 2GB of free RAM
Solution: remove temporarily until proper message limits have been
implemented, then a more granular test case can be added without
such high requirements which are problematic in embedded environment,
build systems, VMs and CI systems
2016-03-16 21:47:58 +00:00
Pieter Hintjens
27fe489843 Problem: VC++ gives warnings on inet_addr
Solution: in project.gyp, define _WINSOCK_DEPRECATED_NO_WARNINGS
2016-02-18 11:46:43 +01:00
Pieter Hintjens
3443da216f Problem: node-gyp defaults to -fno-rtti, which breaks libzmq
Solution: override in project.gyp, for Linux and OS/X.
2016-02-17 12:06:45 +01:00
Pieter Hintjens
c78e4f33a3 Problem: if src/platform.hpp still exists, gyp uses this
Gyp needs its own platform.hpp; there is no way to delete this
file automatically.

Solution: copy gyp's platform.hpp into src, so that things build
properly no matter what the starting state. If you build with gyp
and then try to build using autotools' makefile, you'll get an
error from the platform.hpp.
2016-02-17 12:06:45 +01:00
Pieter Hintjens
9bebd4dce9 Problem: local build should do its own .gitignore
Solution: add .gitignore in builds/gyp
2016-02-17 12:06:45 +01:00
Pieter Hintjens
8559770cf3 Problem: in builds/gyp, socket limit is 4K on Windows
Solution: raise to 16K
2016-02-17 12:06:45 +01:00
Pieter Hintjens
bbcc79d188 Problem: tests don't build on Windows
There were numerous small issues with test cases:

- some lacked the right source file header
- some were not portable at all
- some were using internal libzmq APIs (headers)

Solution: fixed and cleaned up.
2016-02-12 15:48:37 +01:00
Pieter Hintjens
d148c3ea5d Problem: no clue how to run gyp on Windows
Solution: offer a build.bat to help the user.
2016-02-12 15:48:37 +01:00
Pieter Hintjens
8230c0d396 Problem: gyp does not build tests
Solution: it's a lot of work to define the tests in project.gyp
so I did this using gsl to generate the JSON, from a small XML
list of the test cases.

To keep this, and the hundreds of .mk files, away from the root
directory, I've moved the gyp files into builds/gyp, where you
would run them.

It all seems to work now. Next up, OS/X and Windows :)
2016-02-12 11:31:38 +01:00
Pieter Hintjens
a682f94a32 Problem: tcp_address.cpp won't compile on OS/X w/o ZMQ_HAVE_IFADDRS
This is rather insane since the code knows well enough what systems
support if_nametoindex. I blame this on over-use of autotools early
in libzmq's days.

Anyhow, this breaks gyp builds on OS/X.

Solution: add ZMQ_HAVE_IFADDRS to build/gyp/platform.hpp for OS/X.
2016-02-12 10:49:19 +01:00
Pieter Hintjens
6bef3fe9ad Problem: can't build libzmq.a using gyp
Solution: add necessary macros into builds/gyp/platform.hpp

Work for Linux now, other platforms to test.
2016-02-12 09:58:44 +01:00
Pieter Hintjens
fde81d7e07 Problem: can't build using gyp
I'm adding gyp support so that we can easily pull in libzmq
and other C/C++ projects into gyp packages, especially via
node-gyp.

Solution: add gyp definition

This works only for Windows, OS/X, and Linux. We set a single
macro in project.gyp according to the system, and the rest is
done in builds/gyp/platform.hpp. The values in that file are
not dynamic. Your mileage will vary.
2016-02-11 22:41:01 +01:00