Commit Graph

336 Commits

Author SHA1 Message Date
Jason Rhinelander fe8a1f4306
Disable IPv6 by default
libzmq's IPv6 support is buggy when also using DNS hostname: in
particular, if you try to connect to a DNS name that has an IPv6
address, then zmq will *only* try an IPv6 connection, even if the local
client has no IPv6 connectivity, and even if the remote is only
listening on its IPv4 address.

This is much too unreliable to enable by default.
2021-12-02 19:01:21 -04:00
Jason Rhinelander 3b634329ac Fix libc++
libc++ hates the forward declaration, so just include the <future>
header.
2021-11-30 14:29:24 -04:00
Jason Rhinelander f88691b7e9 Bump version 2021-11-30 14:22:21 -04:00
Jason Rhinelander 9c022b29de
Merge pull request #69 from jagerman/null-logger
Allow null logger
2021-11-30 14:21:39 -04:00
Jason Rhinelander 4d68868482
Merge pull request #68 from jagerman/start-throws-at-caller
Propagate proxy thread startup exceptions
2021-11-30 14:21:31 -04:00
Jason Rhinelander 430951bf3c
Merge pull request #66 from jagerman/address-hashing
Add std::hash implementation for oxenmq::address
2021-11-30 14:21:24 -04:00
Jason Rhinelander 03749c87f0
Merge pull request #67 from jagerman/ipv6
Enable ipv6 support on sockets
2021-11-30 14:20:43 -04:00
Jason Rhinelander 85d35fa505 Propagate proxy thread startup exceptions
Currently if the proxy thread fails to start (typically because a bind
fails) the exception happens in the proxy thread which is uncatchable by
the caller (and aborts the program).

This makes it nicer by transporting startup exceptions back to the
start() call.
2021-11-30 14:16:17 -04:00
Jason Rhinelander e180187746 Allow null logger
Currently if you pass a nullptr for Logger you get a random
std::bad_function_call called from some random thread the first time a
log message goes out.

This fixes it allow a nullptr that logs nothing.
2021-11-30 14:14:55 -04:00
Jason Rhinelander e382373f2e
Merge pull request #70 from jagerman/internal-rebrand
Rebrand variables LMQ -> OMQ
2021-11-30 14:14:30 -04:00
Jason Rhinelander 375cfab4ce Rebrand variables LMQ -> OMQ
Various things still were using the lmq (or LMQ) names; change them all
to omq/OMQ.
2021-11-30 14:10:47 -04:00
Jason Rhinelander f04bd72a4c Enable ipv6 support on sockets
Without this you cannot bind or connect to IPv6 addresses because,
oddly, libzmq defaults ipv6 to disabled.
2021-11-30 13:50:24 -04:00
Jason Rhinelander 31f64821f8 Add std::hash implementation for oxenmq::address
So that you can store addresses in unordered_sets _maps.
2021-11-28 10:26:35 -04:00
Jason Rhinelander a53e1f1786 CI tweaks
- extract submodule commands (so that macOS gets the `--depth=1`)
- put deps into a list instead of a string
- remove extraneous submodule update from build steps
- move focal to after sid
2021-10-25 13:09:42 -03:00
Jason Rhinelander 39b6d89037 Updates for pyoxenmq 1.0.0
Makes some send/connection options more robust to "do nothing" runtime
value, which the Python wrapper needs.

Also found a bunch of doc typos and fixes.

Bump version to 1.2.8 so that new pyoxenmq can build-depend on it.
2021-10-21 22:56:13 -03:00
Jason Rhinelander f0bb2c3d3f Update ci to use our pre-built images
Also tweak some of the builds a bit, and reformat.
2021-10-18 00:37:17 -03:00
Jason Rhinelander 09f3de2232 Fix versioning in clang/llvm pipeline functions 2021-10-14 20:08:49 -03:00
Jason Rhinelander 519a107542
Merge pull request #53 from jagerman/allow-disabling-werror
Allow disabling -Werror via a cmake option
2021-10-14 11:43:10 -03:00
Jason Rhinelander 23c2d537a3 Maybe fix macos tests? 2021-10-14 11:10:28 -03:00
Jason Rhinelander 6a386b7d4a Crank clang to 13
Also reformat and move things around a bit.
2021-10-14 11:00:25 -03:00
Jason Rhinelander 5e9b8c0948 Update catch2 to latest 2.x upstream
Should fix build issues with newer libc.
2021-10-13 20:35:37 -03:00
Jason Rhinelander 560d38d069 Allow disabling -Werror via a cmake option 2021-10-13 19:03:18 -03:00
Jason Rhinelander 504d0d10ea
Merge pull request #52 from jagerman/convert-iterators
Make (and use) iterator approach for encoding/decoding
2021-10-13 18:17:28 -03:00
Jason Rhinelander 7695e770a7 drone: quiet/optimize image setup 2021-10-05 12:27:53 -03:00
Jason Rhinelander 0d0ed8efa9 Fix r narrowing initialization warning when uint_fast16_t is small 2021-10-05 12:21:38 -03:00
Jason Rhinelander 02a542b9c6 Simplify iterator initialization & avoid warnings 2021-10-05 12:12:16 -03:00
Jason Rhinelander 9a8adb5bfd Add methods for unpadded base64 construction
The iterator has them; this adds wrapper methods to access them when not
using the iterator directly.
2021-10-01 18:53:05 -03:00
Jason Rhinelander ee1d69f333 Add b32z/b64 invalid garbage tests
Tests the new restricted added for b32z/b64 trailing crap.
2021-10-01 18:52:30 -03:00
Jason Rhinelander 24dd7a3854 Make (and use) iterator approach for encoding/decoding
This allows for on-the-fly encoding/decoding, and also allows for
on-the-fly transcoding between types without needing intermediate string
allocations (see added test cases for examples).
2021-10-01 18:23:29 -03:00
Jason Rhinelander cd56ad8e08 Expose size calculations; stricter b32z/b64 validity checking
- Add {to,from}_{base64,base32z,hex}_size functions to calculate the
  resulting output size from a given input size.

- Use it internally

- Make b32z and b64 validity checking slightly stricter: currently we
  "accept" some b32z and b64 strings that contain an extra character
  that leave us with 5-7 trailing bits (base32z) or 6 trailing bits
  (base64).  We simply ignore the extra one if decoding, but we
  shouldn't accept it in the "is valid" calls.
2021-10-01 17:54:03 -03:00
Jason Rhinelander 6100802f82
Merge pull request #48 from majestrate/boob-operator-overload-2021-09-24
add operator() overload for defered message that sends reply
2021-09-28 01:32:58 -03:00
Jason Rhinelander 7cb7c2fd6d
Merge pull request #46 from jagerman/bt_dict_producer
Bt dict producer
2021-09-28 01:32:48 -03:00
Jeff Becker 5a41e84378
add operator() overload for defered message that sends reply 2021-09-24 16:01:31 -04:00
Jason Rhinelander 377932607c Add const 2021-09-07 16:26:45 -03:00
Jason Rhinelander cdd21a9e81 Another workaround for crapple 2021-09-07 02:00:09 -03:00
Jason Rhinelander 977bced84e Apple workaround 2021-09-07 01:16:38 -03:00
Jason Rhinelander 9e3469d968 Add allocation-free bt-list and bt-dict producer
This should allow for b-encoding with better performance and less memory
fragmentation.

Documentation and test suite show how it's used.
2021-09-07 01:12:47 -03:00
Jason Rhinelander f12a48a195 Remove ancient dead code
I don't remember why this was here.
2021-09-06 21:48:56 -03:00
Jason Rhinelander e1b1a84c4b
Merge pull request #45 from jagerman/return-final-out-it
Make {to,from}_{hex/b64/b32} return output iterator
2021-08-20 16:27:25 -03:00
Jason Rhinelander 2ac4379fa6 Make {to,from}_{hex/b64/b32} return output iterator
Changes the 3-iterator versions of to_hex, from_b32z, etc. to return the
final output iterator, which allows for much easier in-place "from"
conversion without needing a new string by doing something like:

    std::string data = /* some hex */;
    auto end = oxenmq::from_hex(data.begin(), data.end(), data.begin();
    data.erase(end, data.end());

Returning from the "to" converters is a bit less useful but doing it
anyway for consistency (and because it could still have some use, e.g.
if output is into some fixed buffer it lets you determine how much was
written).
2021-08-20 16:08:33 -03:00
Jason Rhinelander ae884d2f13 Fix backwards logic on overlapping ranges comment 2021-08-20 15:45:03 -03:00
Jason Rhinelander 45f358ab5f Remove debugging 2021-08-13 20:05:21 -03:00
Jason Rhinelander c6ae1faefa Downgrade "worker waiting for" log message to trace 2021-08-06 15:21:07 -03:00
Jason Rhinelander 719d33f1cc
Merge pull request #43 from jagerman/inproc
Add support for inproc: connections
2021-08-04 21:21:44 -03:00
Jason Rhinelander f553085558 Add support for inproc: requests
inproc support is special in zmq: in particular it completely bypasses
the auth layer, which causes problems in OxenMQ because we assume that a
message will always have auth information (set during initial connection
handshake).

This adds an "always-on" inproc listener and adds a new `connect_inproc`
method for a caller to establish a connection to it.

It also throws exceptions if you try to `listen_plain` or `listen_curve`
on an inproc address, because that won't work for the reasons detailed
above.
2021-08-04 20:15:16 -03:00
Jason Rhinelander bae71ec6a8 Another apple time fix attempt 2021-08-04 20:15:00 -03:00
Jason Rhinelander 29cd543af9
Merge pull request #44 from jagerman/apple-test-tweaks
Tweak test timers to deal with Apple's shitty thread scheduling
2021-08-04 20:02:59 -03:00
Jason Rhinelander 917c7d64c5 Apple test suite hacks
Because macOS is really slow.
2021-08-04 19:54:17 -03:00
Jason Rhinelander 4a24ac9baa Update bundled zeromq download version 2021-08-04 19:40:54 -03:00
Jason Rhinelander e1d21d3faf Tweak test timers to deal with Apple's shitty thread scheduling 2021-08-04 17:48:53 -03:00