mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-22 13:33:52 +03:00
feature #1288: Update request id in add method for sync requests. AuthManager updated.
This commit is contained in:
parent
f72e5f3a7d
commit
293ee180a4
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
Loading…
Reference in New Issue
Block a user