Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"files.associations": {
"usrloc.h": "c",
"parse_fline.h": "c",
"common.h": "c",
"data_lump.h": "c",
"digest.h": "c",
"regtime.h": "c"
}
}
5 changes: 5 additions & 0 deletions modules/aaa_diameter/dm_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ struct fd_msg_list {
* to consume them */
struct list_head dm_unreplied_req;
gen_lock_t dm_unreplied_req_lk;
gen_lock_t dm_inbound_req_lk;
unsigned int dm_unreplied_req_timeout = 120; /* sec */


Expand Down Expand Up @@ -536,6 +537,8 @@ static int dm_receive_req(struct msg **_req, struct avp * avp, struct session *
struct msg_hdr *hdr = NULL;
str tid = STR_NULL, avp_arr = STR_NULL;

lock_get(&dm_inbound_req_lk);

FD_CHECK(fd_msg_hdr(req, &hdr));
LM_DBG("received Diameter request (appl: %u, cmd: %u)\n", hdr->msg_appl, hdr->msg_code);

Expand Down Expand Up @@ -603,6 +606,8 @@ static int dm_receive_req(struct msg **_req, struct avp * avp, struct session *
cJSON_Delete(avps);
cJSON_InitHooks(NULL);

lock_release(&dm_inbound_req_lk);

*_req = NULL;
*act = DISP_ACT_CONT;
return 0;
Expand Down
1 change: 1 addition & 0 deletions modules/aaa_diameter/dm_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ int init_mutex_cond(pthread_mutex_t *mutex, pthread_cond_t *cond);

extern struct list_head dm_unreplied_req;
extern gen_lock_t dm_unreplied_req_lk;
extern gen_lock_t dm_inbound_req_lk;
extern unsigned int dm_unreplied_req_timeout;
extern char *dm_conf_filename;
extern char *extra_avps_file;
Expand Down
1 change: 1 addition & 0 deletions modules/aaa_diameter/dm_peer.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ int dm_init_peer(void)

INIT_LIST_HEAD(&dm_unreplied_req);
lock_init(&dm_unreplied_req_lk);
lock_init(&dm_inbound_req_lk);
return 0;
}

Expand Down
Loading