
Go to the source code of this file.
Defines | |
| #define | BUSY_BUFFER ((char *)-1) |
| A buffer is empty but cannot be used by anyone else. | |
Typedefs | |
| typedef unsigned int(* | tuaccancel_f )(str *headers, str *body, unsigned int cancelledIdx, unsigned int cancelledLabel, transaction_cb cb, void *cbp) |
Functions | |
| char * | build_cancel (struct cell *Trans, unsigned int branch, unsigned int *len) |
| void | cancel_branch (struct cell *t, int branch) |
| void | cancel_uacs (struct cell *t, branch_bm_t cancel_bm) |
| cancel branches scheduled for deletion | |
| static short | should_cancel_branch (struct cell *t, int b) |
| unsigned int | t_uac_cancel (str *headers, str *body, unsigned int cancelledIdx, unsigned int cancelledLabel, transaction_cb cb, void *cbp) |
| This function cancels a previously created local invite transaction. | |
| int | unixsock_uac_cancel (str *msg) |
| void | which_cancel (struct cell *t, branch_bm_t *cancel_bm) |
| Determine which branches should be canceled. | |
Definition in file t_cancel.h.
| #define BUSY_BUFFER ((char *)-1) |
A buffer is empty but cannot be used by anyone else.
particularly, we use this value in the buffer pointer in local_buffer to tell "a process is already scheduled to generate a CANCEL, other processes are not supposed to" (which might happen if for example in a three-branch forking, two 200 would enter separate processes and compete for canceling the third branch); note that to really avoid race conditions, the value must be set in REPLY_LOCK
Definition at line 48 of file t_cancel.h.
Referenced by cancel_branch(), free_cell(), should_cancel_branch(), and t_cancel_branches().
| typedef unsigned int(* tuaccancel_f)(str *headers, str *body, unsigned int cancelledIdx, unsigned int cancelledLabel, transaction_cb cb, void *cbp) |
Definition at line 59 of file t_cancel.h.
| char* build_cancel | ( | struct cell * | Trans, | |
| unsigned int | branch, | |||
| unsigned int * | len | |||
| ) |
Definition at line 124 of file t_cancel.c.
References build_local(), CANCEL, CANCEL_LEN, and cell::to.
Referenced by cancel_branch().
| void cancel_branch | ( | struct cell * | t, | |
| int | branch | |||
| ) |
Definition at line 80 of file t_cancel.c.
References retr_buf::activ_type, retr_buf::branch, retr_buf::buffer, build_cancel(), BUSY_BUFFER, retr_buf::dst, has_tran_tmcbs, _str::len, len, LM_CRIT, LM_DBG, LM_ERR, ua_client::local_cancel, ua_server::request, ua_client::request, run_trans_callbacks(), _str::s, SEND_BUFFER, set_extra_tmcb_params(), start_retr(), TMCB_REQUEST_BUILT, TYPE_LOCAL_CANCEL, cell::uac, and cell::uas.
Referenced by cancel_uacs(), fake_reply(), and reply_received().
| void cancel_uacs | ( | struct cell * | t, | |
| branch_bm_t | cancel_bm | |||
| ) |
cancel branches scheduled for deletion
Definition at line 69 of file t_cancel.c.
References cancel_branch(), and cell::nr_of_outgoings.
Referenced by _reply_light(), cancel_invite(), local_reply(), mi_tm_cancel(), relay_reply(), reply_received(), and t_cancel_branches().
| static short should_cancel_branch | ( | struct cell * | t, | |
| int | b | |||
| ) | [inline, static] |
Definition at line 66 of file t_cancel.h.
References retr_buf::buffer, BUSY_BUFFER, ua_client::flags, ua_client::last_received, ua_client::local_cancel, NULL, _str::s, T_UAC_TO_CANCEL_FLAG, and cell::uac.
Referenced by fake_reply(), and which_cancel().
| unsigned int t_uac_cancel | ( | str * | headers, | |
| str * | body, | |||
| unsigned int | cancelled_hashIdx, | |||
| unsigned int | cancelled_label, | |||
| transaction_cb | cb, | |||
| void * | cbp | |||
| ) |
This function cancels a previously created local invite transaction.
The cancel parameter should NOT have any via (CANCEL is hop-by-hop).
>0 if OK (returns the LABEL of the cancel).
Definition at line 140 of file t_cancel.c.
References buf, retr_buf::buffer, build_cell(), build_uac_cancel(), retr_buf::dst, cell::flags, free_cell(), cell::hash_index, insert_into_hash_table_unsafe(), insert_tmcb(), is_local, cell::label, ua_client::last_received, _str::len, len, LM_ERR, LM_WARN, LOCK_HASH, cell::method, cell::nr_of_outgoings, dest_info::proto, dest_info::proto_reserved1, remove_from_hash_table_unsafe(), ua_client::request, reset_avps(), _str::s, SEND_BUFFER, dest_info::send_sock, start_retr(), T_IS_LOCAL_FLAG, t_lookup_ident(), cell::tmcb_hl, TMCB_LOCAL_COMPLETED, TMCB_RESPONSE_IN, dest_info::to, cell::uac, and UNLOCK_HASH.
Referenced by load_tm().
| int unixsock_uac_cancel | ( | str * | msg | ) |
| void which_cancel | ( | struct cell * | t, | |
| branch_bm_t * | cancel_bm | |||
| ) |
Determine which branches should be canceled.
Do it only from within REPLY_LOCK, otherwise collisions could occur (e.g., two 200 for two branches processed by two processes might concurrently try to generate a CANCEL for the third branch, resulting in race conditions during writing to cancel buffer
Definition at line 56 of file t_cancel.c.
References cell::first_branch, and should_cancel_branch().
Referenced by _reply_light(), cancel_invite(), local_reply(), t_cancel_branches(), and t_should_relay_response().
1.5.6