summaryrefslogtreecommitdiff
path: root/qpid/python
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/python')
-rw-r--r--qpid/python/qpid/delegates.py6
-rw-r--r--qpid/python/qpid/messaging/driver.py5
-rw-r--r--qpid/python/qpid/messaging/endpoints.py1
-rw-r--r--qpid/python/qpid/tests/messaging/endpoints.py6
4 files changed, 13 insertions, 5 deletions
diff --git a/qpid/python/qpid/delegates.py b/qpid/python/qpid/delegates.py
index 8dbdc37564..685cf49f54 100644
--- a/qpid/python/qpid/delegates.py
+++ b/qpid/python/qpid/delegates.py
@@ -159,7 +159,8 @@ class Client(Delegate):
def __init__(self, connection, username=None, password=None,
mechanism=None, heartbeat=None, **kwargs):
Delegate.__init__(self, connection)
-
+ self.client_properties=Client.PROPERTIES.copy()
+ self.client_properties.update(kwargs.get("client_properties",{}))
##
## self.acceptableMechanisms is the list of SASL mechanisms that the client is willing to
## use. If it's None, then any mechanism is acceptable.
@@ -215,7 +216,8 @@ class Client(Delegate):
mech = "ANONYMOUS"
if not mech in mech_list:
raise Closed("No acceptable SASL authentication mechanism available")
- ch.connection_start_ok(client_properties=Client.PROPERTIES, mechanism=mech, response=initial)
+ ch.connection_start_ok(client_properties=self.client_properties,
+ mechanism=mech, response=initial)
def connection_secure(self, ch, secure):
resp = None
diff --git a/qpid/python/qpid/messaging/driver.py b/qpid/python/qpid/messaging/driver.py
index dda5e38a61..0358659111 100644
--- a/qpid/python/qpid/messaging/driver.py
+++ b/qpid/python/qpid/messaging/driver.py
@@ -705,7 +705,10 @@ class Engine:
mech, initial = self._sasl.start(" ".join(mechs))
except sasl.SASLError, e:
raise AuthenticationFailure(text=str(e))
- self.write_op(ConnectionStartOk(client_properties=CLIENT_PROPERTIES,
+
+ client_properties = CLIENT_PROPERTIES.copy()
+ client_properties.update(self.connection.client_properties)
+ self.write_op(ConnectionStartOk(client_properties=client_properties,
mechanism=mech, response=initial))
def do_connection_secure(self, secure):
diff --git a/qpid/python/qpid/messaging/endpoints.py b/qpid/python/qpid/messaging/endpoints.py
index faa382a755..e632c0c5b8 100644
--- a/qpid/python/qpid/messaging/endpoints.py
+++ b/qpid/python/qpid/messaging/endpoints.py
@@ -170,6 +170,7 @@ class Connection(Endpoint):
self.ssl_keyfile = options.get("ssl_keyfile", None)
self.ssl_certfile = options.get("ssl_certfile", None)
self.ssl_trustfile = options.get("ssl_trustfile", None)
+ self.client_properties = options.get("client_properties", {})
self.options = options
diff --git a/qpid/python/qpid/tests/messaging/endpoints.py b/qpid/python/qpid/tests/messaging/endpoints.py
index db5ec03df2..935db54458 100644
--- a/qpid/python/qpid/tests/messaging/endpoints.py
+++ b/qpid/python/qpid/tests/messaging/endpoints.py
@@ -886,9 +886,11 @@ class ReceiverTests(Base):
rc = self.ssn.receiver('test-receiver-queue; {mode: consume}')
self.drain(rb, expected=msgs)
self.drain(rc, expected=msgs)
- rb2 = self.ssn.receiver(rb.source)
- self.assertEmpty(rb2)
+ rc2 = self.ssn.receiver(rc.source)
+ self.assertEmpty(rc2)
self.drain(self.rcv, expected=[])
+ rb2 = self.ssn.receiver(rb.source)
+ self.drain(rb2, expected=msgs)
# XXX: need testUnsettled()