summaryrefslogtreecommitdiff
path: root/cpp/lib/common
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2007-02-09 00:52:46 +0000
committerAndrew Stitcher <astitcher@apache.org>2007-02-09 00:52:46 +0000
commitf197f0c88e1f5ed37a14617b1006f6579c4319e7 (patch)
tree63481b59b90c60e69550da9b95d268f36e1bcc84 /cpp/lib/common
parent5611851b2094372ba5cb77c93ba475e95ce76437 (diff)
downloadqpid-python-f197f0c88e1f5ed37a14617b1006f6579c4319e7.tar.gz
r1102@fuschia: andrew | 2007-02-09 00:52:04 +0000
Got ack working for the non batched case Small tidy up in broker Channel git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@505108 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/lib/common')
-rw-r--r--cpp/lib/common/framing/ChannelAdapter.cpp9
-rw-r--r--cpp/lib/common/framing/ChannelAdapter.h1
-rw-r--r--cpp/lib/common/framing/Requester.h3
3 files changed, 11 insertions, 2 deletions
diff --git a/cpp/lib/common/framing/ChannelAdapter.cpp b/cpp/lib/common/framing/ChannelAdapter.cpp
index 149c8144b4..53ab30faa0 100644
--- a/cpp/lib/common/framing/ChannelAdapter.cpp
+++ b/cpp/lib/common/framing/ChannelAdapter.cpp
@@ -55,7 +55,9 @@ void ChannelAdapter::send(AMQBody::shared_ptr body) {
void ChannelAdapter::handleRequest(AMQRequestBody::shared_ptr request) {
assertMethodOk(*request);
- responder.received(request->getData());
+ AMQRequestBody::Data& requestData = request->getData();
+ responder.received(requestData);
+ requestInProgress = requestData.requestId;
handleMethodInContext(request, MethodContext(this, request));
}
@@ -63,7 +65,10 @@ void ChannelAdapter::handleResponse(AMQResponseBody::shared_ptr response) {
assertMethodOk(*response);
// TODO aconway 2007-01-30: Consider a response handled on receipt.
// Review - any cases where this is not the case?
- requester.processed(response->getData());
+ AMQResponseBody::Data& responseData = response->getData();
+ requester.processed(responseData);
+ // For a response this is taken to be the request being responded to (for convenience)
+ requestInProgress = responseData.requestId;
handleMethod(response);
}
diff --git a/cpp/lib/common/framing/ChannelAdapter.h b/cpp/lib/common/framing/ChannelAdapter.h
index 26cac76aae..c2eba2f4e9 100644
--- a/cpp/lib/common/framing/ChannelAdapter.h
+++ b/cpp/lib/common/framing/ChannelAdapter.h
@@ -87,6 +87,7 @@ class ChannelAdapter : public BodyHandler {
const MethodContext& context) = 0;
RequestId getRequestInProgress() { return requestInProgress; }
+ RequestId getNextSendRequestId() { return requester.getNextId(); }
private:
ChannelId id;
diff --git a/cpp/lib/common/framing/Requester.h b/cpp/lib/common/framing/Requester.h
index 562ba681c1..dae5b1eaee 100644
--- a/cpp/lib/common/framing/Requester.h
+++ b/cpp/lib/common/framing/Requester.h
@@ -46,6 +46,9 @@ class Requester
/** Called after processing a response. */
void processed(const AMQResponseBody::Data&);
+ /** Get the next id to be used. */
+ RequestId getNextId() { return lastId + 1; }
+
private:
std::set<RequestId> requests; /** Sent but not responded to */
RequestId lastId;