Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 653b77b1f -> 01e5e38c7


DISPATCH-763 - Modified the set_config_host() function to take into account the 
new defaults for host and addr fields


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/01e5e38c
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/01e5e38c
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/01e5e38c

Branch: refs/heads/master
Commit: 01e5e38c74bed649c99693518bbbcbd61b767319
Parents: 653b77b
Author: Ganesh Murthy <gmur...@redhat.com>
Authored: Fri May 5 09:48:20 2017 -0400
Committer: Ganesh Murthy <gmur...@redhat.com>
Committed: Fri May 5 09:48:20 2017 -0400

----------------------------------------------------------------------
 python/qpid_dispatch/management/qdrouter.json |  2 +-
 src/connection_manager.c                      | 17 +++++------------
 2 files changed, 6 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/01e5e38c/python/qpid_dispatch/management/qdrouter.json
----------------------------------------------------------------------
diff --git a/python/qpid_dispatch/management/qdrouter.json 
b/python/qpid_dispatch/management/qdrouter.json
index 3f66abb..6915bdb 100644
--- a/python/qpid_dispatch/management/qdrouter.json
+++ b/python/qpid_dispatch/management/qdrouter.json
@@ -686,7 +686,7 @@
                     "description":"(DEPRECATED)IP address: ipv4 or ipv6 
literal or a host name. This attribute has been deprecated. Use host instead",
                     "deprecated": true,
                     "type": "string",
-                    "default": "127.0.0.1",
+                    "default": "",
                     "create": true
                 },
                 "allowNoSasl": {

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/01e5e38c/src/connection_manager.c
----------------------------------------------------------------------
diff --git a/src/connection_manager.c b/src/connection_manager.c
index fefc961..513b16c 100644
--- a/src/connection_manager.c
+++ b/src/connection_manager.c
@@ -33,8 +33,6 @@
 #include <stdio.h>
 #include <inttypes.h>
 
-static char* HOST_ADDR_DEFAULT = "127.0.0.1";
-
 struct qd_config_ssl_profile_t {
     DEQ_LINKS(qd_config_ssl_profile_t);
     uint64_t     identity;
@@ -163,21 +161,17 @@ static void set_config_host(qd_server_config_t *config, 
qd_entity_t* entity)
     char *host = qd_entity_opt_string(entity, "host", 0);
     char *addr = qd_entity_opt_string(entity, "addr", 0);
 
-    if (strcmp(host, HOST_ADDR_DEFAULT) == 0 && strcmp(addr, 
HOST_ADDR_DEFAULT) == 0) {
+    if (host && addr && strcmp(host, "") == 0 && strcmp(addr, "") == 0) {
         config->host = host;
         free(addr);
     }
-    else if (strcmp(host, addr) == 0) {
+    else if (host && strcmp(host, "") != 0 ) {
         config->host = host;
         free(addr);
     }
-    else if (strcmp(host, HOST_ADDR_DEFAULT) == 0 && strcmp(addr, 
HOST_ADDR_DEFAULT) != 0) {
-         config->host = addr;
-         free(host);
-    }
-    else if (strcmp(host, HOST_ADDR_DEFAULT) != 0 && strcmp(addr, 
HOST_ADDR_DEFAULT) == 0) {
-         config->host = host;
-         free(addr);
+    else if (addr && strcmp(addr, "") != 0) {
+        config->host = addr;
+        free(host);
     }
     else {
         free(host);
@@ -191,7 +185,6 @@ static void set_config_host(qd_server_config_t *config, 
qd_entity_t* entity)
     snprintf(config->host_port, hplen, "%s:%s", config->host, config->port);
 }
 
-
 static void qd_config_ssl_profile_process_password(qd_config_ssl_profile_t* 
ssl_profile)
 {
     char *pw = ssl_profile->ssl_password;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to