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

qpid-dispatch git commit: DISPATCH-516 - Do not respond to display name query if there is no reply_to in the message

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master a2e11aab8 -> 4ef453fd1


DISPATCH-516 - Do not respond to display name query if there is no reply_to in the message


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

Branch: refs/heads/master
Commit: 4ef453fd12b21eb8b62b25680cb64aab61cfc288
Parents: a2e11aa
Author: Ganesh Murthy <gm...@redhat.com>
Authored: Wed Oct 12 16:10:38 2016 -0400
Committer: Ganesh Murthy <gm...@redhat.com>
Committed: Wed Oct 12 16:10:38 2016 -0400

----------------------------------------------------------------------
 .../qpid_dispatch_internal/display_name/display_name.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4ef453fd/python/qpid_dispatch_internal/display_name/display_name.py
----------------------------------------------------------------------
diff --git a/python/qpid_dispatch_internal/display_name/display_name.py b/python/qpid_dispatch_internal/display_name/display_name.py
index 9cce3a7..7a1bdd5 100644
--- a/python/qpid_dispatch_internal/display_name/display_name.py
+++ b/python/qpid_dispatch_internal/display_name/display_name.py
@@ -116,9 +116,15 @@ class DisplayNameService(object):
             self.log(LOG_ERROR, "Exception in raw message processing: body=%r\n%s" %
                      (message.body, format_exc(LOG_STACK_LIMIT)))
 
-        response = Message(address=message.reply_to,
-                           body=body,
-                           correlation_id=message.correlation_id)
+        # Make sure the incoming message has a reply_to, otherwise don't bother responding.
+        # This check will make sure that the core thread does not crash.
+        if message.reply_to:
+            response = Message(address=message.reply_to,
+                               body=body,
+                               correlation_id=message.correlation_id)
+        else:
+            # If there is no reply_to, we simple won't respond.
+            return
 
         self.io_adapter[0].send(response)
 


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