From 293ee180a40f4b18f52099d069b7130687df6e8b Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Fri, 1 Jun 2012 12:01:23 +0200 Subject: [PATCH] feature #1288: Update request id in add method for sync requests. AuthManager updated. --- include/MadManager.h | 15 +-------------- src/authm/AuthManager.cc | 4 ++-- src/mad/MadManager.cc | 8 +++----- 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/include/MadManager.h b/include/MadManager.h index 98ead506c8..43cfd434f5 100644 --- a/include/MadManager.h +++ b/include/MadManager.h @@ -113,7 +113,7 @@ protected: * @param ar pointer to the request * @return the id for the request */ - int add_request(SyncRequest *ar); + void add_request(SyncRequest *ar); /** * Gets request from the Request map @@ -122,19 +122,6 @@ protected: */ SyncRequest * get_request(int id); - /** - * Discards a pending request. Call this before freeing not notified or - * timeout requests. - */ - void discard_request(int id) - { - lock(); - - sync_requests.erase(id); - - unlock(); - } - private: /** * Function to lock the Manager diff --git a/src/authm/AuthManager.cc b/src/authm/AuthManager.cc index 2c6aad22b1..c7ba3b694b 100644 --- a/src/authm/AuthManager.cc +++ b/src/authm/AuthManager.cc @@ -241,7 +241,7 @@ void AuthManager::authenticate_action(AuthRequest * ar) // Queue the request // ------------------------------------------------------------------------ - ar->id = add_request(ar); + add_request(ar); // ------------------------------------------------------------------------ // Make the request to the driver @@ -285,7 +285,7 @@ void AuthManager::authorize_action(AuthRequest * ar) // Queue the request // ------------------------------------------------------------------------ - ar->id = add_request(ar); + add_request(ar); // ------------------------------------------------------------------------ // Make the request to the driver diff --git a/src/mad/MadManager.cc b/src/mad/MadManager.cc index 4fd2514be9..099ca18131 100644 --- a/src/mad/MadManager.cc +++ b/src/mad/MadManager.cc @@ -377,20 +377,18 @@ void MadManager::check_time_outs_action() /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ -int MadManager::add_request(SyncRequest *ar) +void MadManager::add_request(SyncRequest *ar) { static int request_id = 0; int id; lock(); - id = request_id++; + ar->id = request_id++; - sync_requests.insert(sync_requests.end(),make_pair(id,ar)); + sync_requests.insert(sync_requests.end(),make_pair(ar->id,ar)); unlock(); - - return id; } /* -------------------------------------------------------------------------- */