You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2016/04/12 20:32:01 UTC

qpid-proton git commit: PROTON-1133: Fix for building proton-c as C++ - Also fixes broken Windows build

Repository: qpid-proton
Updated Branches:
  refs/heads/master 619c5c7ff -> 03b0f1063


PROTON-1133: Fix for building proton-c as C++
- Also fixes broken Windows build


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/03b0f106
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/03b0f106
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/03b0f106

Branch: refs/heads/master
Commit: 03b0f106313be9b3ebf944649349b66bc9ced963
Parents: 619c5c7
Author: Andrew Stitcher <as...@apache.org>
Authored: Tue Apr 12 14:31:07 2016 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Tue Apr 12 14:31:07 2016 -0400

----------------------------------------------------------------------
 proton-c/src/reactor/connection.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/03b0f106/proton-c/src/reactor/connection.c
----------------------------------------------------------------------
diff --git a/proton-c/src/reactor/connection.c b/proton-c/src/reactor/connection.c
index 5cc7099..336d1f1 100644
--- a/proton-c/src/reactor/connection.c
+++ b/proton-c/src/reactor/connection.c
@@ -142,13 +142,14 @@ void pni_handle_bound(pn_reactor_t *reactor, pn_event_t *event) {
       const char *hostname = pn_connection_get_hostname(conn);
       if (hostname) {
           str = pn_string(hostname);
-          host = pn_string_buffer(str);
+          char *h = pn_string_buffer(str);
           // see if a port has been included in the hostname.  This is not
           // allowed by the spec, but the old reactor interface allowed it.
-          char *colon = strrchr(host, ':');
+          char *colon = strrchr(h, ':');
           if (colon) {
+              *colon = '\0';
+              host = h;
               port = colon + 1;
-              colon[0] = '\0';
           }
       }
   }
@@ -169,7 +170,7 @@ void pni_handle_bound(pn_reactor_t *reactor, pn_event_t *event) {
     pn_transport_close_tail(transport);
     pn_transport_close_head(transport);
   }
-  if (str) pn_free(str);
+  pn_free(str);
   pn_reactor_selectable_transport(reactor, sock, transport);
 }
 


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