You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by jdanekrh <gi...@git.apache.org> on 2016/06/14 21:55:14 UTC

[GitHub] qpid-dispatch pull request #82: DISPATCH-184 - Resolve port name to int when...

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 <jd...@redhat.com>
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] qpid-dispatch pull request #82: DISPATCH-184 - Resolve port name to int when...

Posted by jdanekrh <gi...@git.apache.org>.
Github user jdanekrh closed the pull request at:

    https://github.com/apache/qpid-dispatch/pull/82


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] qpid-dispatch issue #82: DISPATCH-184 - Resolve port name to int when applyi...

Posted by jdanekrh <gi...@git.apache.org>.
Github user jdanekrh commented on the issue:

    https://github.com/apache/qpid-dispatch/pull/82
  
    @ganeshmurthy What do you think about my
    
    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.
    
    dilemma? Is one of these preferable? I went with 2, but other may make more sense. Or surely even other options could be suggested.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org