diff options
author | Gordon Sim <gsim@apache.org> | 2008-10-13 20:57:14 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2008-10-13 20:57:14 +0000 |
commit | 037882cebf617cd18b5aa372fc22f50e692df2c6 (patch) | |
tree | cd65ec5f69bf53934691c4bf19ec5d8bb2595a55 /cpp/src/qpid/client/SessionImpl.cpp | |
parent | b35f51d15628fbaba6aa1a379a3988cdccf47d2c (diff) | |
download | qpid-python-037882cebf617cd18b5aa372fc22f50e692df2c6.tar.gz |
Reverted a small part of r703237 as it causes deadlocks under load. Session controls can _not_ be subject to bounds checking on the queue of outgoing frames as is done for commands.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@704245 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/SessionImpl.cpp')
-rw-r--r-- | cpp/src/qpid/client/SessionImpl.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/cpp/src/qpid/client/SessionImpl.cpp b/cpp/src/qpid/client/SessionImpl.cpp index 49dd97e324..2d0f83b894 100644 --- a/cpp/src/qpid/client/SessionImpl.cpp +++ b/cpp/src/qpid/client/SessionImpl.cpp @@ -59,7 +59,8 @@ SessionImpl::SessionImpl(const std::string& name, shared_ptr<ConnectionImpl> con connectionShared(conn), connectionWeak(conn), weakPtr(false), - proxy(out), + ioHandler(*this), + proxy(ioHandler), nextIn(0), nextOut(0) { @@ -424,9 +425,22 @@ void SessionImpl::handleIn(AMQFrame& frame) // network thread void SessionImpl::handleOut(AMQFrame& frame) // user thread { + sendFrame(frame, true); +} + +void SessionImpl::proxyOut(AMQFrame& frame) // network thread +{ + //Note: this case is treated slightly differently that command + //frames sent by application; session controls should not be + //blocked by bounds checking on the outgoing frame queue. + sendFrame(frame, false); +} + +void SessionImpl::sendFrame(AMQFrame& frame, bool canBlock) +{ boost::shared_ptr<ConnectionImpl> c = connectionWeak.lock(); if (c) { - c->expand(frame.encodedSize(), true); + c->expand(frame.encodedSize(), canBlock); channel.handle(frame); } } |