GitHub user jdanekrh opened a pull request:
https://github.com/apache/qpid-dispatch/pull/82
DISPATCH-184 - Resolve port name to int when applying configuration
Error in router is caused by a call to getaddrinfo() that uses the 'amqp'
string for port In function qdpn_listener_t *qdpn_listener(qdpn_driver_t
*driver, ...). Same call to getaddrinfo() also appears in qdpn_connector().
There ia a Python class Url.Port() that converts a string port to int and
can handle missing /etc/services. Class used to be in dispatch in proton_future
package, it was recently removed and now it is only in Proton.
As a solution, I had the following ideas:
1. Add a Port type to python/qpid_dispatch_internal/management/schema.py,
do the conversion to int as part of validation.
2. Convert port to int in python/qpid_dispatch_internal/management/agent.py
in ListenerEntity and ConnectorEntity, either in validate, create, or init
method.
3. Catch the error code in qdpn_listener and qdpn_connector and do a if
strcmp(port, "amqp") ... there, Or call into Url.Port() in Python to avoid code
duplication.
I decided to do a PR with the 2nd one.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jdanekrh/qpid-dispatch DISPATCH-184
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/qpid-dispatch/pull/82.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #82
----
commit 1915320451d2dfc7ec410887585a09de41685a5c
Author: Jiri Danek <[email protected]>
Date: 2016-06-14T20:46:38Z
DISPATCH-184 - Resolve port name to int when applying configuration
Port can be specified either as a string, e.g. 'amqp', or a number. Some
systems do not have 'amqp' in /etc/services. On such systems, port has
to be resolved by dispatch itself.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]