diff options
| author | Gordon Sim <gsim@apache.org> | 2012-11-23 16:57:03 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2012-11-23 16:57:03 +0000 |
| commit | 8f32b12e42a3e3032cf0cfa2bc3e80efcca69457 (patch) | |
| tree | b921395d2c0fb0b687920cb6b037accc4c231ea4 /cpp/src | |
| parent | 57036cbee30c301a68b8acfdcd67ceabcf260fa1 (diff) | |
| download | qpid-python-8f32b12e42a3e3032cf0cfa2bc3e80efcca69457.tar.gz | |
QPID-4465: check subject before setting filter
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1412963 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
| -rw-r--r-- | cpp/src/qpid/messaging/amqp/ReceiverContext.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/cpp/src/qpid/messaging/amqp/ReceiverContext.cpp b/cpp/src/qpid/messaging/amqp/ReceiverContext.cpp index 8034df311a..414793c7fd 100644 --- a/cpp/src/qpid/messaging/amqp/ReceiverContext.cpp +++ b/cpp/src/qpid/messaging/amqp/ReceiverContext.cpp @@ -120,18 +120,20 @@ void ReceiverContext::configure(pn_terminus_t* source) const helper.setNodeProperties(source); } - //filter: - pn_data_t* filter = pn_terminus_filter(source); - pn_data_put_map(filter); - pn_data_enter(filter); - pn_data_put_symbol(filter, convert("subject")); - //TODO: At present inserting described values into the map doesn't seem to work; correct this once resolved - //pn_data_put_described(filter); - //pn_data_enter(filter); - //pn_data_put_ulong(filter, getFilterDescriptor(address.getSubject())); - pn_data_put_string(filter, convert(address.getSubject())); - //pn_data_exit(filter); - pn_data_exit(filter); + if (!address.getSubject().empty()) { + //filter: + pn_data_t* filter = pn_terminus_filter(source); + pn_data_put_map(filter); + pn_data_enter(filter); + pn_data_put_symbol(filter, convert("subject")); + //TODO: At present inserting described values into the map doesn't seem to work; correct this once resolved + //pn_data_put_described(filter); + //pn_data_enter(filter); + //pn_data_put_ulong(filter, getFilterDescriptor(address.getSubject())); + pn_data_put_string(filter, convert(address.getSubject())); + //pn_data_exit(filter); + pn_data_exit(filter); + } } bool ReceiverContext::isClosed() const |
