mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-16 22:38:38 +00:00
FS-9775: Added support for removing finished transactions via latent purging while expiring
Also added support to send error message responses and updated the test to confirm, errors still need to be updated to send an error responses
This commit is contained in:
1 parent
f95ca83b06
commit
7ac7a7e75b
6 files changed
+290
-47
No files matched your search
@@ -48,15 +48,20 @@ KS_DECLARE(ks_status_t) ks_dht2_transaction_free(ks_dht2_transaction_t *transact
|
||||
*
|
||||
*/
|
||||
KS_DECLARE(ks_status_t) ks_dht2_transaction_init(ks_dht2_transaction_t *transaction,
|
||||
ks_sockaddr_t *raddr,
|
||||
uint32_t transactionid,
|
||||
ks_dht2_message_callback_t callback)
|
||||
{
|
||||
ks_assert(transaction);
|
||||
ks_assert(raddr);
|
||||
ks_assert(transaction->pool);
|
||||
ks_assert(callback);
|
||||
|
||||
transaction->raddr = *raddr;
|
||||
transaction->transactionid = transactionid;
|
||||
transaction->callback = callback;
|
||||
transaction->expiration = ks_time_now_sec() + KS_DHT_TRANSACTION_EXPIRATION_DELAY;
|
||||
transaction->finished = KS_FALSE;
|
||||
|
||||
return KS_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -68,8 +73,11 @@ KS_DECLARE(ks_status_t) ks_dht2_transaction_deinit(ks_dht2_transaction_t *transa
|
||||
{
|
||||
ks_assert(transaction);
|
||||
|
||||
transaction->raddr = (const ks_sockaddr_t){ 0 };
|
||||
transaction->transactionid = 0;
|
||||
transaction->callback = NULL;
|
||||
transaction->expiration = 0;
|
||||
transaction->finished = KS_FALSE;
|
||||
|
||||
return KS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user