mirror of
https://github.com/matrix-construct/construct
synced 2024-11-16 23:10:54 +01:00
authd: add provider timeout setting API
This commit is contained in:
parent
1b4dba98a6
commit
2e1e0b9981
2 changed files with 16 additions and 0 deletions
|
@ -389,3 +389,17 @@ set_provider_data(struct auth_client *auth, uint32_t id, void *data)
|
|||
auth->data[(size_t)id] = data;
|
||||
}
|
||||
|
||||
void
|
||||
set_provider_timeout_relative(struct auth_client *auth, uint32_t id, time_t timeout)
|
||||
{
|
||||
lrb_assert(id < rb_dlink_list_length(&auth_providers));
|
||||
auth->timeout[(size_t)id] = timeout + rb_current_time();
|
||||
}
|
||||
|
||||
void
|
||||
set_provider_timeout_absolute(struct auth_client *auth, uint32_t id, time_t timeout)
|
||||
{
|
||||
lrb_assert(id < rb_dlink_list_length(&auth_providers));
|
||||
auth->timeout[(size_t)id] = timeout;
|
||||
}
|
||||
|
||||
|
|
|
@ -117,6 +117,8 @@ void handle_cancel_connection(int parc, char *parv[]);
|
|||
|
||||
void *get_provider_data(struct auth_client *auth, uint32_t id);
|
||||
void set_provider_data(struct auth_client *auth, uint32_t id, void *data);
|
||||
void set_provider_timeout_relative(struct auth_client *auth, uint32_t id, time_t timeout);
|
||||
void set_provider_timeout_absolute(struct auth_client *auth, uint32_t id, time_t timeout);
|
||||
|
||||
/* Provider is operating on this auth_client (set this if you have async work to do) */
|
||||
static inline void
|
||||
|
|
Loading…
Reference in a new issue