5 years agohandle connection closing, cleanup freeing PROTON-1488
Gordon Sim [Tue, 30 May 2017 20:12:57 +0000 (21:12 +0100)] 
handle connection closing, cleanup freeing

5 years agobuild remote sasl support as a separate library
Gordon Sim [Thu, 25 May 2017 13:44:22 +0000 (14:44 +0100)] 
build remote sasl support as a separate library

5 years agoallow sasl implementation to be selected per connection
Gordon Sim [Thu, 25 May 2017 11:18:10 +0000 (12:18 +0100)] 
allow sasl implementation to be selected per connection

5 years agofurther WIP
Gordon Sim [Wed, 17 May 2017 19:31:30 +0000 (20:31 +0100)] 
further WIP

5 years agoWIP: a sasl implementation that delegates to a remote authentication service, using...
Gordon Sim [Wed, 17 May 2017 15:19:47 +0000 (16:19 +0100)] 
WIP: a sasl implementation that delegates to a remote authentication service, using AMQP SASL frame relaying

5 years agoPROTON-1488: Added command line parameters for configure URL and address
ppatierno [Mon, 22 May 2017 15:26:16 +0000 (17:26 +0200)] 
PROTON-1488: Added command line parameters for configure URL and address

5 years agoNO-JIRA: Ensure _GNU_SOURCE & _POSIX_C_SOURCE are not redefined
Andrew Stitcher [Fri, 19 May 2017 13:54:00 +0000 (09:54 -0400)] 
NO-JIRA: Ensure _GNU_SOURCE & _POSIX_C_SOURCE are not redefined

5 years agoPROTON-1480: Fix hello_world_direct example not to call listener::stop more than...
Andrew Stitcher [Tue, 16 May 2017 19:45:19 +0000 (15:45 -0400)] 
PROTON-1480: Fix hello_world_direct example not to call listener::stop more than once

5 years agoPROTON-1460: epoll lower HOGMAX for better performance
Cliff Jansen [Tue, 16 May 2017 15:20:14 +0000 (08:20 -0700)] 
PROTON-1460: epoll lower HOGMAX for better performance

5 years agoPROTON-1460: epoll additional error checks
Cliff Jansen [Mon, 15 May 2017 01:21:44 +0000 (18:21 -0700)] 
PROTON-1460: epoll additional error checks

5 years agoNO-JIRA: [C++ binding] Fix check for C++11
Andrew Stitcher [Sun, 14 May 2017 04:58:33 +0000 (00:58 -0400)] 
NO-JIRA: [C++ binding] Fix check for C++11

5 years agoPROTON-1479: Fix scheduled_send examples to send and close in a safe context
Andrew Stitcher [Thu, 4 May 2017 03:42:56 +0000 (23:42 -0400)] 
PROTON-1479: Fix scheduled_send examples to send and close in a safe context

5 years agoPROTON-1476: Reinstate C++ scheduled_send tests and remove unused mt tests
Andrew Stitcher [Fri, 12 May 2017 15:59:01 +0000 (11:59 -0400)] 
PROTON-1476: Reinstate C++ scheduled_send tests and remove unused mt tests

5 years agoPROTON-1476: c and c++ example tests running on python 2.6
Alan Conway [Thu, 11 May 2017 14:50:09 +0000 (10:50 -0400)] 
PROTON-1476: c and c++ example tests running on python 2.6

Using common exampletest.py library

5 years agoPROTON-1476: fix strict-aliasing errors on gcc 4.4.7
Alan Conway [Thu, 11 May 2017 13:05:49 +0000 (09:05 -0400)] 
PROTON-1476: fix strict-aliasing errors on gcc 4.4.7

5 years agoPROTON-1474: Fix CMake config files and cmake files so that Proton C examples compile...
Andrew Stitcher [Fri, 5 May 2017 22:13:34 +0000 (18:13 -0400)] 
PROTON-1474: Fix CMake config files and cmake files so that Proton C examples compile separately
- This reverts commit ed9532e2ae08b04aa5690d43e9002431bd019c21.A
- This introduces Core and Proactor package components to the Proton CMake config script

5 years agoPROTON-1460: epoll - add -lpthread
Alan Conway [Wed, 10 May 2017 21:00:22 +0000 (17:00 -0400)] 
PROTON-1460: epoll - add -lpthread

This was being picked up by accident via the SASL library.
Added explicitly for the epoll proactor in case SASL is not present.

5 years agoPROTON-1466: proton-c mixing up links with names that are prefixes
Alan Conway [Wed, 10 May 2017 20:30:14 +0000 (16:30 -0400)] 
PROTON-1466: proton-c mixing up links with names that are prefixes

Creating links where one link name is a prefix of the other, e.g. "xx" and
"xxyy" sometimes caused the links to be confused.

5 years agoPROTON-1460: epoll - thread safe use of driver on connection disconnect
Cliff Jansen [Tue, 9 May 2017 20:06:41 +0000 (13:06 -0700)] 
PROTON-1460: epoll - thread safe use of driver on connection disconnect

5 years agoPROTON-1460: Added missing SOVERSION properties to proactor libraryc
Alan Conway [Tue, 9 May 2017 18:17:24 +0000 (14:17 -0400)] 
PROTON-1460: Added missing SOVERSION properties to proactor libraryc

5 years agoPROTON-1460: epoll - remove un-necessary event_cache fields
Alan Conway [Tue, 9 May 2017 15:34:58 +0000 (11:34 -0400)] 
PROTON-1460: epoll - remove un-necessary event_cache fields

The event_cache was required to work around bug PROTON-1407 in
collector_peek()/collector_next() but that is fixed since commit 7368c34

5 years agoPROTON-1460: epoll - don't issue wake events after transport closed
Alan Conway [Tue, 9 May 2017 00:20:57 +0000 (20:20 -0400)] 
PROTON-1460: epoll - don't issue wake events after transport closed

The application may have deleted resources associated with the connection
after PN_TRANSPORT_CLOSED, so we should not issue PN_CONNECTION_WAKE even
if there is a wake call concurrently with closing the connection.

5 years agoPROTON-1460: fix compile errors in epoll.c on travis, clang.
Alan Conway [Mon, 8 May 2017 19:19:18 +0000 (15:19 -0400)] 
PROTON-1460: fix compile errors in epoll.c on travis, clang.

5 years agoPROTON-1460: make epoll the default proactor on linux
Alan Conway [Mon, 8 May 2017 18:58:59 +0000 (14:58 -0400)] 
PROTON-1460: make epoll the default proactor on linux

The libuv proactor can still be selected with cmake -DPROACTOR=libuv,
and will be selected automatically on platforms without epoll.

5 years agoPROTON-1460: fix faulty proactor tests, false failures
Alan Conway [Mon, 8 May 2017 16:28:21 +0000 (12:28 -0400)] 
PROTON-1460: fix faulty proactor tests, false failures

Fix minor problem in libuv proactor showed up by new tests.

5 years agoPROTON-1460: epoll proactor fix hang in test-refuse
Alan Conway [Mon, 8 May 2017 15:08:49 +0000 (11:08 -0400)] 
PROTON-1460: epoll proactor fix hang in test-refuse

Removed separate bool read_closed/write_closed flags in pconnection_t and always
call pn_connection_driver_read/write_close() to check status.  The
pn_connection_driver_read/write_close() are (nowadays!)  simple bool checks so
no extra cost, and this avoids bugs where the pn_connection_t flags get out
of sync with the transport - which was the case of the problem in test_refuse.

5 years agoPROTON-1460: fix epoll proactor leak - missing freeaddrinfo()
Alan Conway [Mon, 8 May 2017 14:08:05 +0000 (10:08 -0400)] 
PROTON-1460: fix epoll proactor leak - missing freeaddrinfo()

5 years agoPROTON-1460: epoll multi-address listen and connect.
Alan Conway [Fri, 5 May 2017 21:40:30 +0000 (17:40 -0400)] 
PROTON-1460: epoll multi-address listen and connect.

epoll proactor:

pn_listener_t listens to every working address in the getaddrinfo list.
It holds one psocket_t per listening socket but has a single pcontext_t.
Returns one accept event at a time.

pn_proactor_connect tries each address in the getaddrinfo list until one works.
No further attempts are made after the first successful connection.

Modified ipv4/v6 flags and address parsing to follow the behavior documented for
pn_proactor_listen and pn_proactor_connect.

Modified proactor to deal directly with contexts not sockets, moved "closing"
flag from socket to context. Previously there was a 1-1 relationship, but now a
listener context has >1 socket.

5 years agoPROTON-1463: Fix incorrect address handling.
Alan Conway [Fri, 5 May 2017 18:19:40 +0000 (14:19 -0400)] 
PROTON-1463: Fix incorrect address handling.

Fix to previous commit
a61f50e * PROTON-1463: Golang AMQP URL incompatable with Qpid Cpp Broker.had

Use of string.TrimPrefix was incorrect.

5 years agoNO-JIRA: ProtonConfig.cmake indicates whether a proactor was built
Alan Conway [Thu, 4 May 2017 15:45:32 +0000 (11:45 -0400)] 
NO-JIRA: ProtonConfig.cmake indicates whether a proactor was built

5 years agoPROTON-1460: fix false failures in epoll proactor tests
Alan Conway [Wed, 3 May 2017 23:07:26 +0000 (19:07 -0400)] 
PROTON-1460: fix false failures in epoll proactor tests

5 years agoPROTON-1472: use submodule rather than clone in .travis.yml
Alan Conway [Wed, 3 May 2017 21:23:36 +0000 (17:23 -0400)] 
PROTON-1472: use submodule rather than clone in .travis.yml

Following travis recommendations.

5 years agoRevert "PROTON-1472: install to standard python site-packages under PREFIX"
Andrew Stitcher [Wed, 3 May 2017 20:32:15 +0000 (16:32 -0400)] 
Revert "PROTON-1472: install to standard python site-packages under PREFIX"

This reverts commit b984d5ac0a9d319cc27010ba89e5a583d287626e.

5 years agoPROTON-1472: install to standard python site-packages under PREFIX
Alan Conway [Wed, 3 May 2017 18:11:14 +0000 (14:11 -0400)] 
PROTON-1472: install to standard python site-packages under PREFIX

Make symlink from old, non-standard "proton/bindings/python" location.

5 years agoPROTON-1472: add libuv to .travis.yml
Alan Conway [Wed, 3 May 2017 03:29:31 +0000 (23:29 -0400)] 
PROTON-1472: add libuv to .travis.yml

- update .travis.yml to build libuv 2.1 from souce
- added valgrind suppression file for older libcrypto to C tests.

5 years agoPROTON-1460: epoll proactor test_release_free
Cliff Jansen [Wed, 3 May 2017 14:01:08 +0000 (07:01 -0700)] 
PROTON-1460: epoll proactor test_release_free

5 years agoPROTON-1472: Fix epoll compile errors on Fedora
Andrew Stitcher [Wed, 3 May 2017 06:40:17 +0000 (02:40 -0400)] 
PROTON-1472: Fix epoll compile errors on Fedora

5 years agoPROTON-1472: Fix compile errors on Ubuntu
Alan Conway [Wed, 3 May 2017 03:27:56 +0000 (23:27 -0400)] 
PROTON-1472: Fix compile errors on Ubuntu

5 years agoPROTON-1470: Add missing headers to source lists for tox tests
Alan Conway [Wed, 3 May 2017 00:27:09 +0000 (20:27 -0400)] 
PROTON-1470: Add missing headers to source lists for tox tests

Added proton-internal.h and netaddr.h to source lists for tox tests

5 years agoPROTON-1470: C test_tools added test macros for checking pn_condition
Alan Conway [Tue, 2 May 2017 15:18:48 +0000 (11:18 -0400)] 
PROTON-1470: C test_tools added test macros for checking pn_condition

5 years agoPROTON-1470: C proactor common address parser.
Alan Conway [Tue, 2 May 2017 14:04:08 +0000 (10:04 -0400)] 
PROTON-1470: C proactor common address parser.

Updated libuv and epoll to use it.

5 years agoPROTON-1460: implement pn_netaddr functions for epoll proactor
Alan Conway [Mon, 1 May 2017 20:45:00 +0000 (16:45 -0400)] 
PROTON-1460: implement pn_netaddr functions for epoll proactor

Also made netaddr.h const-correct and updated both libuv and epoll implementations.

5 years agoPROTON-1460: epoll proactor listener resorce cleanup
Cliff Jansen [Mon, 1 May 2017 16:13:37 +0000 (09:13 -0700)] 
PROTON-1460: epoll proactor listener resorce cleanup

5 years agoPROTON-1470: proactor api - updated epoll proactor.
Alan Conway [Fri, 28 Apr 2017 23:22:25 +0000 (19:22 -0400)] 
PROTON-1470: proactor api - updated epoll proactor.

5 years agoPROTON-1470: proactor api - composing and examining addresses
Alan Conway [Fri, 28 Apr 2017 21:37:05 +0000 (17:37 -0400)] 
PROTON-1470: proactor api - composing and examining addresses

Simpler solution than proposed in the JIRA.

No change to connect()/listen() signatures, they still take a string address.

Added pn_proactor_addr() to format an address string from a separate host and
port, so user does not need to know the format.

Format is simple "host:port", where the port is the substring after the *last*
":". IPv6 hosts are not decorated with "[]", the last ":" in the address is
always the host/port separator, never part of an IPv6 literal.

The C examples now take separate host, port arguments and use pn_proactor_addr()
to construct the proactor address. Existing bindings do not need to be changed,
but it would be good practice to have them use pn_proactor_addr() rather than
hard-coding the "host:port"format.

Also renamed pn_proactor_addr_t to pn_netaddr_t.

5 years agoPROTON-1471: Implement pn_proactor_now(void)
Andrew Stitcher [Thu, 27 Apr 2017 16:58:07 +0000 (12:58 -0400)] 
PROTON-1471: Implement pn_proactor_now(void)
- This returns a millisecond monotonic time since an arbitrary

5 years agoPROTON-1463: Golang AMQP URL incompatable with Qpid Cpp Broker.
Alan Conway [Tue, 25 Apr 2017 23:17:17 +0000 (19:17 -0400)] 
PROTON-1463: Golang AMQP URL incompatable with Qpid Cpp Broker.

According to https://tools.ietf.org/html/rfc3986 (and python urlparse) the Go
parser is correct to include the leading "/" in a URL path, the proton URL
parser in proton's other bindings is non-standard here.

We want to reduce confusion and move towards standard behavior so instead of
changing the URL class I updated the examples to remove the leading "/" like this:

    addr := strings.TrimPrefix("/", url.Path)

5 years agoPROTON-1469: c libuv - read/write error closes full transport
Alan Conway [Tue, 25 Apr 2017 20:35:10 +0000 (16:35 -0400)] 
PROTON-1469: c libuv - read/write error closes full transport

read/write errors now only close the read/write half of the transport to allow
outstanding work to complete on the other half.

5 years agoPROTON-1469: c libuv proactor on_write called after transport close
Alan Conway [Tue, 25 Apr 2017 20:28:11 +0000 (16:28 -0400)] 
PROTON-1469: c libuv proactor on_write called after transport close

on_write() checks that the transport is not write-closed before calling

5 years agoPROTON-1460: epoll proactor fixes for test_disconnect
Cliff Jansen [Tue, 25 Apr 2017 21:28:52 +0000 (14:28 -0700)] 
PROTON-1460: epoll proactor fixes for test_disconnect

5 years agoPROTON-1460: epoll proactor shutdown, wait for EOS on socket read to cleanup connection
Cliff Jansen [Mon, 24 Apr 2017 06:42:32 +0000 (23:42 -0700)] 
PROTON-1460: epoll proactor shutdown, wait for EOS on socket read to cleanup connection

5 years agoPROTON-1460: epoll test fixes: log_event, listener setup, EOS detection
Cliff Jansen [Sat, 22 Apr 2017 20:49:22 +0000 (13:49 -0700)] 
PROTON-1460: epoll test fixes: log_event, listener setup, EOS detection

5 years agoPROTON-1460: epoll proactor - dummy pn_proactor_release_connection
Alan Conway [Fri, 21 Apr 2017 18:48:56 +0000 (14:48 -0400)] 
PROTON-1460: epoll proactor - dummy pn_proactor_release_connection

Added dummy pn_proactor_release_connection() that calls abort().
Allows the tests to link and 'make install' to work without fiddling.
The tests do not pass.

5 years agoPROTON-1460: epoll proactor - fix minor compile glitches.
Alan Conway [Fri, 21 Apr 2017 16:18:30 +0000 (12:18 -0400)] 
PROTON-1460: epoll proactor - fix minor compile glitches.

- enable -std=c99 for clang compiler
- disable -std=c99 for epoll proactor, it uses post c99 pthread APIs
- fix minor clang warnings in epoll.c

5 years agoPROTON-1460: Improved proactor selection in cmake.
Alan Conway [Wed, 12 Apr 2017 22:38:32 +0000 (18:38 -0400)] 
PROTON-1460: Improved proactor selection in cmake.

Pick a proactor with `cmake -DPROACTOR=name` where name is 'epoll', 'libuv' or 'none'.
'none' disables the proactor even if a default is available.

PROACTOR="" (the default) picks the first proactor that has its build
requirements satisfied.

Presently 'epoll' is not included as a default. When it is ready, enable the
commented part of this line:


5 years agoNO-JIRA: Fix cmake warning from bogus doc dependency
Alan Conway [Wed, 12 Apr 2017 22:01:49 +0000 (18:01 -0400)] 
NO-JIRA: Fix cmake warning from bogus doc dependency

5 years agoPROTON-1445: Implement release_connection for proactor and driver
Alan Conway [Tue, 11 Apr 2017 16:21:25 +0000 (12:21 -0400)] 
PROTON-1445: Implement release_connection for proactor and driver

Allow user to take back ownership of a connection.

5 years agoPROTON-1460: add pn_proactor_disconnect()
Cliff Jansen [Sun, 9 Apr 2017 23:42:43 +0000 (16:42 -0700)] 
PROTON-1460: add pn_proactor_disconnect()

5 years agoPROTON-1460: epoll proactor, initial implementation, can run some C proactor examples
Cliff Jansen [Fri, 7 Apr 2017 21:20:21 +0000 (14:20 -0700)] 
PROTON-1460: epoll proactor, initial implementation, can run some C proactor examples

5 years agoNO-JIRA: revert temporary workaround for PROTON-1453
Kenneth Giusti [Fri, 31 Mar 2017 14:10:22 +0000 (10:10 -0400)] 
NO-JIRA: revert temporary workaround for PROTON-1453

5 years agoPROTON-1408 -- fixes for message ID wraparound bugs
mick [Wed, 29 Mar 2017 18:23:11 +0000 (14:23 -0400)] 
PROTON-1408 -- fixes for message ID wraparound bugs

This closes #100

5 years agoPROTON-1454: C proactor API doc overhaul, minor API improvements.
Alan Conway [Mon, 3 Apr 2017 21:59:23 +0000 (17:59 -0400)] 
PROTON-1454: C proactor API doc overhaul, minor API improvements.

Reviewed and improved all API doc in proactor.h and listener.h

API improvements:
- Reverted a85c89a "PROTON-1445: Change proactor ownership model" - it was a bad idea.
- pn_proactor_connect|listen return void, all errors reported by events
- rename pn_proactor_disown_connection -> pn_proactor_release_connection
- document the list of event types used by the proactor.
- const fixes for pn_proactor_addr functions
- verify all proactor library functions are in proactor.h or listener.h

5 years agoNO-JIRA: proactor test: verify expected behavior transport close
Alan Conway [Fri, 31 Mar 2017 15:08:49 +0000 (11:08 -0400)] 
NO-JIRA: proactor test: verify expected behavior transport close

5 years agoPROTON-1437: pn_proactor_addr_sockaddr returns known struct
Alan Conway [Thu, 30 Mar 2017 20:51:05 +0000 (16:51 -0400)] 
PROTON-1437: pn_proactor_addr_sockaddr returns known struct

To use the return value of `pn_proactor_addr_sockaddr()` in API calls like
`getnameinfo` you must know its size. Rather than complicate the API to return a
size, return a pointer to the standard `struct sockaddr_storage` which is large
enough to hold any supported address type.

5 years agoPROTON-1453: properly terminate output string buffer
Kenneth Giusti [Thu, 30 Mar 2017 17:28:57 +0000 (13:28 -0400)] 
PROTON-1453: properly terminate output string buffer

This closes #101

5 years agoPROTON-1437: clarify apidoc for pn_proactor_addr_str
Alan Conway [Thu, 30 Mar 2017 18:55:00 +0000 (14:55 -0400)] 
PROTON-1437: clarify apidoc for pn_proactor_addr_str

5 years agoNO-JIRA: Disable py33,py34 TOX environments in travis.yml
Alan Conway [Thu, 30 Mar 2017 13:55:29 +0000 (09:55 -0400)] 
NO-JIRA: Disable py33,py34 TOX environments in travis.yml

Make the tox.ini envlist settable from cmake option TOX_ENVLIST

Update .travis.yml to exclude py33,py34 from the envlist as both cause failures.

cmake prints a warning if TOX_ENVLIST is set to any non-default value to remind
us that this is a temporary measure.

When the problem is fixed, revert .travis.yml to re-enable the defaults.

5 years agoPROTON-1452: Add pn_proactor_disconnect
Alan Conway [Wed, 29 Mar 2017 21:58:00 +0000 (17:58 -0400)] 
PROTON-1452: Add pn_proactor_disconnect

 * Disconnect all connections and listeners currently active in the proactor.
 * PN_LISTENER_CLOSE, PN_TRANSPORT_CLOSED and other events are generated as usual.
 * If no new listeners or connections are created, then a PN_PROACTOR_INACTIVE event
 * will be generated when all connections and listeners are disconnected.
 * Note the proactor remains active, connections and listeners created after a call to
 * pn_proactor_disconnect() are not affected by it.
 * @param condition if not NULL the condition data is copied to the transports and listeners.
PNP_EXTERN void pn_proactor_disconnect(pn_proactor_t *proactor, pn_condition_t *condition);

5 years agoPROTON-1452: Test for closed transport without side effects
Alan Conway [Wed, 29 Mar 2017 20:42:31 +0000 (16:42 -0400)] 
PROTON-1452: Test for closed transport without side effects

"closed" tests based on pn_transport_pending/available have side effects: may
generate events or modify read/write buffer pointers, which makes using those
tests very sensitive to ordering.

New pn_transport_(head|tail)_closed have no side effects.

5 years agoPROTON-1437: c proactor address info
Alan Conway [Wed, 29 Mar 2017 14:54:35 +0000 (10:54 -0400)] 
PROTON-1437: c proactor address info

Provides actual address information for both ends of a proactor-managed
connection using pn_proactor_addr_* functions.

- pn_proactor_addr_* functions are clearly identified as part of proactor lib
- portable print local/remote address as string with no platform-specific headers
- POSIX/windows can test pn_proactor_addr_is_sockaddr() to use native sockaddr API

This can be extended safely to non-sockaddr platforms by making
pn_proactor_addr_is_sockaddr() return false and adding pn_proactor_addr_is_foo()
to indicate the underlying address type

5 years agoPROTON-1445: c proactor SSL support
Alan Conway [Mon, 27 Mar 2017 23:41:11 +0000 (19:41 -0400)] 
PROTON-1445: c proactor SSL support

Fix regression introduced by PROTON-1445 that caused the AMQP protocol header
to be sent too early, breaking SSL communication. Added proactor.c test
for SSL connections.

5 years agoPROTON-1445: tests/proactor.c - fix memory management
Alan Conway [Mon, 27 Mar 2017 22:05:40 +0000 (18:05 -0400)] 
PROTON-1445: tests/proactor.c - fix memory management

Fix the unit tests to respect the new memory management rules.

5 years agoPROTON-1445: Change proactor ownership model
Alan Conway [Thu, 23 Mar 2017 23:13:15 +0000 (19:13 -0400)] 
PROTON-1445: Change proactor ownership model

Changed ownership model for pn_connection_t and pn_listener_t managed by the
proactor: instead of proactor freeing automatically after the final event, the
user must free on or after the final event.

There are 2 basic use cases:

1. Free connection/listener immediately on the last event.

2. Keep connection/listener in memory until all application pointers are cleaned up.

Proactor ownership does 1. very well, but makes 2. very difficult without
exposing reference-counts.

User ownership supports both reasonably easily: 1. is implemented by calling
pn_connection_free() or pn_listener_free() in the event handler on the last

5 years agoWIP: Fix connection_driver refcount for collector
Alan Conway [Thu, 23 Mar 2017 21:31:55 +0000 (17:31 -0400)] 
WIP: Fix connection_driver refcount for collector

5 years agoPROTON-1443: c proactor - pn_proactor_set_timeout(0) to mean immediate
Alan Conway [Thu, 23 Mar 2017 01:41:19 +0000 (21:41 -0400)] 
PROTON-1443: c proactor - pn_proactor_set_timeout(0) to mean immediate

Also added pn_proactor_cancel_timeout()

5 years agoPROTON-1438: C libuv proactor, fix occasional timeout hangs
Alan Conway [Wed, 22 Mar 2017 15:30:30 +0000 (11:30 -0400)] 
PROTON-1438: C libuv proactor, fix occasional timeout hangs

5 years agoPROTON-1438: C proactor listening behavior
Alan Conway [Sun, 19 Mar 2017 18:57:13 +0000 (14:57 -0400)] 
PROTON-1438: C proactor listening behavior

Improved listening behavior for pn_proactor_listen to allow selective listening by protocol (ipv4/v6) or portable "listen to everything".

Host can be a host name, IPV4 or IPV6 literal, or the empty string/NULL (treated the same). The empty string listens on all local addresses. A host name listens on all addresses associated with the name. An IPV6 literal address (or wildcard '[::]') listens only for IPV6. An IPV4 literal address (or wildcard '') listens only for IPV4.

- pn_proactor_listen may listen on more than one socket for ipv6/v4 or for DNS names with multiple address records.

- the 'backlog' applies to *each* socket

- an error on any socket will close all the sockets of the listener,  PN_LISTERN_CLOSE event indicates all sockets are closed and provides the error that triggered the close.

5 years agoPROTON-1438: added pn_event_condition convenience function
Alan Conway [Wed, 15 Mar 2017 16:17:01 +0000 (12:17 -0400)] 
PROTON-1438: added pn_event_condition convenience function

A convenience function to make it easier to write generic error handling
functions for events.

 * If the event context object has a condition and the condition is set
 * return it, otherwise return NULL.
 * If the event context object has remote and local conditions,
 * try the remote condition first, then the local.
PN_EXTERN struct pn_condition_t *pn_event_condition(pn_event_t *event);

5 years agoPROTON-1440: libuv proactor - thread safe pn_connection_wake
Alan Conway [Thu, 16 Mar 2017 20:25:31 +0000 (16:25 -0400)] 
PROTON-1440: libuv proactor - thread safe pn_connection_wake

This fix does not change the API but makes pn_connection_wake thread safe.

To be thread safe we need to a lock, so the pconnection_t attachment stays
on the pn_connection_t until the pn_connection_t is destroyed.

pn_proactor_free also was modified to run the normal socket close sequence
rather than a short-cut that just closes TCP sockets - this allows the
wake locking logic to run as normal, even if the application calls wake
after the proactor is freed.

5 years agoNO-JIRA: c++ binding - removed circular #define
Alan Conway [Thu, 16 Mar 2017 14:15:49 +0000 (10:15 -0400)] 
NO-JIRA: c++ binding - removed circular #define

5 years agoPROTON-1434: add test blacklist to tox tests
Kenneth Giusti [Wed, 8 Mar 2017 16:44:23 +0000 (11:44 -0500)] 
PROTON-1434: add test blacklist to tox tests

This closes #98

5 years agoNO-JIRA: Remove spurious FIXME comment
Alan Conway [Wed, 15 Mar 2017 19:59:27 +0000 (15:59 -0400)] 
NO-JIRA: Remove spurious FIXME comment

5 years agoPROTON-1439: messenger tests fail sporadically with interrupt error
Alan Conway [Wed, 15 Mar 2017 19:57:32 +0000 (15:57 -0400)] 
PROTON-1439: messenger tests fail sporadically with interrupt error

Different messenger tests fail randomly with "Interrupt: [-8]: None"

Disabled the tests by default as the messenger is no longer being maintained,
They can be run with 'proton-tests "*.messenger.*"'

5 years agoPROTON-1438: C url parser allows unbracketed IPv6
Alan Conway [Wed, 15 Mar 2017 17:49:12 +0000 (13:49 -0400)] 
PROTON-1438: C url parser allows unbracketed IPv6

For example the following are considered equivalent:


5 years agoNO-JIRA: Get rid of monkeypatch in exampletest.py
Alan Conway [Thu, 9 Mar 2017 05:24:19 +0000 (00:24 -0500)] 
NO-JIRA: Get rid of monkeypatch in exampletest.py

5 years agoPROTON-1345: update setup.py.in with libuv and cmake source list
Kenneth Giusti [Tue, 7 Mar 2017 21:32:18 +0000 (16:32 -0500)] 
PROTON-1345: update setup.py.in with libuv and cmake source list

This closes #97

5 years agoNO-JIRA: Clean up stale PR. This closes #71.
Robert Gemmell [Mon, 13 Mar 2017 09:34:50 +0000 (09:34 +0000)] 
NO-JIRA: Clean up stale PR. This closes #71.

Proton-J moved to its own repo and is now mirrored at:

A newer modified version of these changes now exists at:

5 years agoPROTON-1417: fix TypeError when address is already in use
Jiří Daněk [Mon, 27 Feb 2017 11:01:08 +0000 (12:01 +0100)] 
PROTON-1417: fix TypeError when address is already in use

This closes #96

5 years agoPROTON-4103: libuv.c fix the write race for real
Alan Conway [Tue, 7 Mar 2017 01:33:32 +0000 (20:33 -0500)] 
PROTON-4103: libuv.c fix the write race for real

5 years agoPROTON-4103: libuv.c simplify detach/listen logic, fix a write race
Alan Conway [Mon, 6 Mar 2017 23:08:59 +0000 (18:08 -0500)] 
PROTON-4103: libuv.c simplify detach/listen logic, fix a write race

5 years agoPROTON-1403: apply warning compile flags to proactor sources.
Alan Conway [Mon, 6 Mar 2017 22:56:11 +0000 (17:56 -0500)] 
PROTON-1403: apply warning compile flags to proactor sources.

5 years agoPROTON-1403: minor example and documentation fixes
Alan Conway [Mon, 6 Mar 2017 22:55:38 +0000 (17:55 -0500)] 
PROTON-1403: minor example and documentation fixes

5 years agoPROTON-1422: fix clang compile error from previous commit
Alan Conway [Wed, 1 Mar 2017 18:56:22 +0000 (13:56 -0500)] 
PROTON-1422: fix clang compile error from previous commit

5 years agoPROTON-1423: Python reconnect on amqp:connection:forced
Cliff Jansen [Wed, 1 Mar 2017 16:27:10 +0000 (08:27 -0800)] 
PROTON-1423: Python reconnect on amqp:connection:forced

5 years agoPROTON-1422: c makefiles including -luv in too many places
Alan Conway [Wed, 1 Mar 2017 15:16:11 +0000 (10:16 -0500)] 
PROTON-1422: c makefiles including -luv in too many places

cmake was including un-necessary private dependencies (including -luv but also
sasl & ssl related stuff) on every example etc. linked with liqpid-proton. Added
PRIVATE tags to target_link_libraries to prevent that.

5 years agoPROTON-1422: c libuv proactor should not require extras library
Alan Conway [Wed, 1 Mar 2017 14:14:37 +0000 (09:14 -0500)] 
PROTON-1422: c libuv proactor should not require extras library

Move the internal pni_parse_url() to the core library and make it visible for
proactor implementations.  It is not part of the public user API and is not
advertised in any public header.

5 years agoRevert "PROTON-1420: Cpp example direct_send receives instead. Fix it to send."
Alan Conway [Wed, 1 Mar 2017 14:57:56 +0000 (09:57 -0500)] 
Revert "PROTON-1420: Cpp example direct_send receives instead. Fix it to send."

This reverts commit 13e40e9e6a158cdc3777f207387461483881e2c8.

The example was correct before this change, this change broke the self tests.

direct_send is a *server* not a client. It listens for an incoming connection
and sender and then sends. It does not *initiate* the connection or sender, it
send once the remote peer does.

5 years agoPROTON-1421: c proactor to take a connection URL string
Alan Conway [Tue, 28 Feb 2017 00:32:01 +0000 (19:32 -0500)] 
PROTON-1421: c proactor to take a connection URL string

Instead of host, port take a single string in "host:port" or URL format for
pn_proactor_connect and pn_proactor_listen

5 years agoNO-JIRA: Removed out-of-date FIXME comment
Alan Conway [Mon, 27 Feb 2017 22:09:21 +0000 (17:09 -0500)] 
NO-JIRA: Removed out-of-date FIXME comment

5 years agoPROTON-1418: pn_vlogf missing newline after log.
Alan Conway [Mon, 27 Feb 2017 21:22:20 +0000 (16:22 -0500)] 
PROTON-1418: pn_vlogf missing newline after log.