summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/SessionImpl.cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2009-02-03 20:41:04 +0000
committerAndrew Stitcher <astitcher@apache.org>2009-02-03 20:41:04 +0000
commit3acf5739b4025362a073c0b3a61537c7991c6eb2 (patch)
tree168788d96d13921e6e02c10fdf2cae319b18880f /cpp/src/qpid/client/SessionImpl.cpp
parent4d7398f3ec2879bb2921f4b464d7b3e9c2503886 (diff)
downloadqpid-python-3acf5739b4025362a073c0b3a61537c7991c6eb2.tar.gz
Add in management statistics for client flow control.
Really fixed Client library to count credit the same way the broker does. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@740433 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/SessionImpl.cpp')
-rw-r--r--cpp/src/qpid/client/SessionImpl.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/cpp/src/qpid/client/SessionImpl.cpp b/cpp/src/qpid/client/SessionImpl.cpp
index c179a31853..ee542a9cf8 100644
--- a/cpp/src/qpid/client/SessionImpl.cpp
+++ b/cpp/src/qpid/client/SessionImpl.cpp
@@ -329,6 +329,10 @@ void SessionImpl::sendRawFrame(AMQFrame& frame) {
Future SessionImpl::sendCommand(const AMQBody& command, const MethodContent* content)
{
+ // Only message transfers have content
+ if (content && sendMsgCredit) {
+ sendMsgCredit->acquire();
+ }
Acquire a(sendLock);
SequenceNumber id = nextOut++;
{
@@ -366,7 +370,7 @@ void SessionImpl::sendContent(const MethodContent& content)
uint64_t data_length = content.getData().length();
if(data_length > 0){
header.setLastSegment(false);
- handleContentOut(header);
+ handleOut(header);
/*Note: end of frame marker included in overhead but not in size*/
const uint32_t frag_size = maxFrameSize - AMQFrame::frameOverhead();
@@ -395,7 +399,7 @@ void SessionImpl::sendContent(const MethodContent& content)
}
}
} else {
- handleContentOut(header);
+ handleOut(header);
}
}
@@ -448,14 +452,6 @@ void SessionImpl::handleOut(AMQFrame& frame) // user thread
sendFrame(frame, true);
}
-void SessionImpl::handleContentOut(AMQFrame& frame) // user thread
-{
- if (sendMsgCredit) {
- sendMsgCredit->acquire();
- }
- sendFrame(frame, true);
-}
-
void SessionImpl::proxyOut(AMQFrame& frame) // network thread
{
//Note: this case is treated slightly differently that command