Commit Graph

15 Commits

Author SHA1 Message Date
sigiesec
2e4fc4faf0 Problem: zmq_poller_*_fd functions do not check for invalid fd
Solution: add checks, added test cases
2017-08-22 19:28:07 +02:00
sigiesec
f9af5503b4 Problem: missing test cases for zmq_poller_* functions called with invalid arguments
Solution: added test cases
2017-08-22 19:28:07 +02:00
Luca Boccassi
17637536b8 Problem: use-after-free in test_poller
Solution: remove server socket from poller before closing it
Fixes #2581
2017-05-18 13:10:19 +01:00
Luca Boccassi
5934919f3e Problem: tests bind to hardcoded TCP ports
Solution: use ZMQ_LAST_ENDPOINT in most places. This alllows running
tests in paralle, and on over-booked shared machines where many of
the ports would be already in use.
Keep 3 tests with an hardcoded port, as there are some code paths that
require it (eg: connect before bind), but list those ports in
tests/testutil.hpp as macros so that they do not overlap and still
allow parallel runs.

These changes were inspired by a patch uploaded to Ubuntu by the
package maintainer, Steve Langasek <steve.langasek@ubuntu.com>.
Thank you Steve!
2017-05-01 22:57:05 +01:00
hitstergtd
477cc1cb12 Problem: zmq_poller_destroy parameter checking
Solution:
- Add checks for **poller_p_ to ensure that we do not segfault when either it
  or the value within it are NULL
- Add tests for the above and increase error state coverage
2016-05-12 18:09:59 +01:00
Doron Somech
a747f72450 problem:closed poller still associated with socket 2016-05-05 13:50:33 +03:00
Luca Boccassi
f0a34e0ff5 Problem: test_poller/use_fd_ipc/tcp use draft API
Solution: only use ZMQ_SERVER/CLIENT if the defines are available.
2016-05-02 21:46:47 +01:00
Patrik Wenger
621c965fae Problem: tricky return value from zmq::socket_poller_t::wait when poller is empty
Solution: return -1 (no event) instead of 0 (event)

For some reason, this just returns 0 if there are no sockets registered
on the poller. Usually this would mean there has been an event. So the
caller would have to check the return value AND the event, or write code
that takes the number of registered sockets into consideration.

By returning -1 and setting errno = ETIMEDOUT like in the usual timeout
cases, it's more consistent and convenient.

Test case included.
2016-04-12 20:11:50 +02:00
Constantin Rack
7da3ee138e Problem: deprecated zmq_utils.h is still included
Solution: remove all remaining references to `zmq_utils.h`
2016-02-01 11:34:36 +01:00
Constantin Rack
a539b0c6e8 Problem: copyright year is still 2015
Solution: update to 2016
2016-01-28 15:07:31 +01:00
Pieter Hintjens
7893a6ac26 Problem: zmq poller API is not CLASS conformant
Solution: change zmq_poller_close(p) to zmq_poller_destroy(&p)
2015-12-21 11:01:16 +01:00
somdoron
da2bc60abe Removing zmq_pollfd as it is replaced by zmq_poller 2015-10-22 11:52:24 +03:00
somdoron
24fc0d4e89 drop the socket postfix from poller methods 2015-10-21 14:04:33 +03:00
somdoron
476ba22e0a ZMQ_Poller support more event types 2015-10-21 10:14:36 +03:00
somdoron
6501b8089f port zpoller to libzmq as zmq_poller 2015-10-18 21:07:23 +03:00