]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1914] Store the request into a queue
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Thu, 17 May 2012 13:32:36 +0000 (15:32 +0200)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Thu, 17 May 2012 13:32:36 +0000 (15:32 +0200)
The requests submitted by groupReadMsgAsync are stored into the list.
The tests still fail, since nothing is interested in the content of the
list yet.

src/lib/config/ccsession.cc
src/lib/config/ccsession.h

index 63fa4cdcf938e312be36eaf71f2a2b9e11c76840..38474c814198e74ccf9887e0aa0d0ed32bd90cb1 100644 (file)
@@ -764,5 +764,27 @@ ModuleCCSession::sendStopping() {
     session_.group_sendmsg(cmd, "ConfigManager");
 }
 
+class ModuleCCSession::AsyncRecvRequest {
+public: // Everything is public here, as the definition is hidden anyway
+    AsyncRecvCallback callback;
+    string recipient;
+    int seq;
+    bool is_reply;
+};
+
+ModuleCCSession::AsyncRecvRequestID
+ModuleCCSession::groupRecvMsgAsync(const AsyncRecvCallback& callback,
+                                   bool is_reply, int seq,
+                                   const string& recipient) {
+    // This just stores the request, the handling is done in checkCommand()
+    boost::shared_ptr<AsyncRecvRequest> request(new AsyncRecvRequest);
+    request->callback = callback;
+    request->recipient = recipient;
+    request->seq = seq;
+    request->is_reply = is_reply;
+    // push_back would be simpler, but it does not return the iterator we need
+    return (async_recv_requests_.insert(async_recv_requests_.end(), request));
+}
+
 }
 }
index 66b8896f08378cdb2378a293ef865319319dc82b..7d2bb71f86846a42adfced65031df19f72cbb543 100644 (file)
@@ -451,7 +451,7 @@ public:
     ///     callback or can be used to cancel the request by cancelAsyncRecv.
     /// \todo Decide what to do with instance and what was it meant for anyway.
     AsyncRecvRequestID groupRecvMsgAsync(const AsyncRecvCallback& callback,
-                                         bool is_reply = true, int seq = -1,
+                                         bool is_reply, int seq = -1,
                                          const std::string& recipient =
                                          std::string());