qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject svn commit: r1547100 - /qpid/proton/trunk/proton-c/src/messenger/subscription.c
Date Mon, 02 Dec 2013 16:46:00 GMT
Author: rhs
Date: Mon Dec  2 16:45:59 2013
New Revision: 1547100

URL: http://svn.apache.org/r1547100
Log:
PROTON-439: remove spurious slash for absolute addresses

Modified:
    qpid/proton/trunk/proton-c/src/messenger/subscription.c

Modified: qpid/proton/trunk/proton-c/src/messenger/subscription.c
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/messenger/subscription.c?rev=1547100&r1=1547099&r2=1547100&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/messenger/subscription.c (original)
+++ qpid/proton/trunk/proton-c/src/messenger/subscription.c Mon Dec  2 16:45:59 2013
@@ -99,8 +99,12 @@ int pni_subscription_set_address(pn_subs
 
   if (!address) return 0;
 
-  pn_string_set(sub->address, "");
-  if (strncmp(address, "amqp:", 5) != 0) {
+  bool absolute = strncmp(address, "amqp:", 5) == 0;
+
+  if (absolute) {
+    return pn_string_set(sub->address, address);
+  } else {
+    pn_string_set(sub->address, "");
     bool scheme = pn_string_get(sub->scheme);
     if (scheme) {
       int e = pn_string_addf(sub->address, "%s:", pn_string_get(sub->scheme));
@@ -114,8 +118,8 @@ int pni_subscription_set_address(pn_subs
       int e = pn_string_addf(sub->address, ":%s", pn_string_get(sub->port));
       if (e) return e;
     }
+    return pn_string_addf(sub->address, "/%s", address);
   }
-  return pn_string_addf(sub->address, "/%s", address);
 }
 
 const char *pn_subscription_address(pn_subscription_t *sub)



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


Mime
View raw message