kamailio.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
List overview
Download
sr-dev
September 2012
----- 2024 -----
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
sr-dev@lists.kamailio.org
32 participants
173 discussions
Start a n
N
ew thread
git:3.3: modules_k/rls: Added missing lock_release()
by Peter Dunkley
Module: sip-router Branch: 3.3 Commit: 831b80f9aecabfdfa37bcb806bc1192e46681869 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=831b80f…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com> Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com> Date: Tue Sep 11 13:03:32 2012 +0100 modules_k/rls: Added missing lock_release() - Found and fixed by Hugh Waite @ Crocodile RCS Ltd (cherry picked from commit 725020f91493d33c5fa86828a421ed465731658e) --- modules_k/rls/resource_notify.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/modules_k/rls/resource_notify.c b/modules_k/rls/resource_notify.c index 1285925..9c757ad 100644 --- a/modules_k/rls/resource_notify.c +++ b/modules_k/rls/resource_notify.c @@ -127,6 +127,12 @@ void get_dialog_from_did(char* did, subs_t **dialog, unsigned int *hash_code) /* save dialog info */ *dialog= pres_copy_subs(s, PKG_MEM_TYPE); + if(*dialog== NULL) + { + LM_ERR("while copying subs_t structure\n"); + lock_release(&rls_table[*hash_code].lock); + return; + } } if ((*dialog)->expires < (int)time(NULL))
12 years, 2 months
1
0
0
0
git:3.3: modules_k/rls: Fixed segmentation fault when uploading new contact lists for a logged in subscriber
by Peter Dunkley
Module: sip-router Branch: 3.3 Commit: 28aec07bcf81ab83d9b7af03de792cb66cf0ca3f URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=28aec07…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com> Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com> Date: Tue Sep 11 13:10:08 2012 +0100 modules_k/rls: Fixed segmentation fault when uploading new contact lists for a logged in subscriber - Found and fixed by Hugh Waite @ Crocodile RCS Ltd (cherry picked from commit 6924912be955b9f7ba47fd57b22ffe0c01eb68b2) --- modules_k/rls/subscribe.c | 29 ++++++++--------------------- 1 files changed, 8 insertions(+), 21 deletions(-) diff --git a/modules_k/rls/subscribe.c b/modules_k/rls/subscribe.c index 9b7f31d..8422f78 100644 --- a/modules_k/rls/subscribe.c +++ b/modules_k/rls/subscribe.c @@ -69,9 +69,6 @@ int resource_subscriptions(subs_t* subs, xmlNodePtr rl_node); int update_rlsubs( subs_t* subs,unsigned int hash_code); int remove_expired_rlsubs( subs_t* subs,unsigned int hash_code); -list_entry_t *rls_contact_list = NULL; -list_entry_t *rls_subs_list = NULL; - /** * return the XML node for rls-services matching uri */ @@ -920,7 +917,9 @@ int send_resource_subs(char* uri, void* param) str pres_uri, *tmp_str; struct sip_uri parsed_pres_uri; int duplicate = 0; - subs_info_t *s = (subs_info_t *) param; + + subs_info_t *s = (subs_info_t *) ((void**)param)[0]; + list_entry_t **rls_contact_list = (list_entry_t **) ((void**)param)[1]; pres_uri.s = uri; pres_uri.len = strlen(uri); @@ -962,7 +961,7 @@ int send_resource_subs(char* uri, void* param) } memcpy(tmp_str->s, pres_uri.s, pres_uri.len); tmp_str->len = pres_uri.len; - rls_contact_list = list_insert(tmp_str, rls_contact_list, &duplicate); + *rls_contact_list = list_insert(tmp_str, *rls_contact_list, &duplicate); if (duplicate != 0) { LM_WARN("%.*s has %.*s multiple times in the same resource list\n", @@ -984,6 +983,9 @@ int resource_subscriptions(subs_t* subs, xmlNodePtr xmlnode) str extra_headers; str did_str= {0, 0}; str *tmp_str; + list_entry_t *rls_contact_list = NULL; + list_entry_t *rls_subs_list = NULL; + void* params[2] = {&s, &rls_contact_list}; /* if is initial send an initial Subscribe * else search in hash table for a previous subscription */ @@ -1024,25 +1026,10 @@ int resource_subscriptions(subs_t* subs, xmlNodePtr xmlnode) s.internal_update_flag = subs->internal_update_flag; - if (rls_contact_list != NULL) - { - LM_WARN("contact list is not empty\n"); - list_free(&rls_contact_list); - } - - if (subs->internal_update_flag == INTERNAL_UPDATE_TRUE) - { - if (rls_subs_list != NULL) - { - LM_WARN("subscriber list is not empty\n"); - list_free(&rls_subs_list); - } - } - counter = 0; if(process_list_and_exec(xmlnode, subs->watcher_user, subs->watcher_domain, - send_resource_subs, (void*)(&s))<0) + send_resource_subs, params)<0) { LM_ERR("while processing list\n"); goto error;
12 years, 2 months
1
0
0
0
git:3.3: modules_k/rls: Fixed issues with for() loops in DB only mode
by Peter Dunkley
Module: sip-router Branch: 3.3 Commit: 0c5d596371712e98b2b59fe6b3b0911f2252fcd0 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0c5d596…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com> Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com> Date: Tue Sep 11 13:08:38 2012 +0100 modules_k/rls: Fixed issues with for() loops in DB only mode - Found and fixed by Hugh Waite @ Crocodile RCS Ltd (cherry picked from commit 7b64e538b350ebd520b80f668045b9f3c7d68fb9) --- modules_k/rls/rls_db.c | 15 +++++++++------ modules_k/rls/subscribe.c | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/modules_k/rls/rls_db.c b/modules_k/rls/rls_db.c index 5728a2f..938f3b7 100644 --- a/modules_k/rls/rls_db.c +++ b/modules_k/rls/rls_db.c @@ -121,7 +121,7 @@ int delete_expired_subs_rlsdb( void ) db1_res_t *result = NULL; int n_query_cols = 0, n_result_cols = 0; int r_callid_col = 0, r_to_tag_col = 0, r_from_tag_col = 0; - int i; + int i, nr_rows; subs_t subs; str rlsubs_did = {0, 0}; @@ -157,10 +157,13 @@ int delete_expired_subs_rlsdb( void ) if(result == NULL) goto error; - for (i = 0; i <RES_ROW_N(result); i++) + rows = RES_ROWS(result); + nr_rows = RES_ROW_N(result); + + for (i = 0; i < nr_rows; i++) { - rows = RES_ROWS(result); - values = ROW_VALUES(rows); + memset(&subs, 0, sizeof(subs_t)); + values = ROW_VALUES(&rows[i]); subs.callid.s = (char *) VAL_STRING(&values[r_callid_col]); subs.callid.len = strlen(subs.callid.s); @@ -415,11 +418,11 @@ int update_all_subs_rlsdb(str *watcher_user, str *watcher_domain, str *evt) nr_rows = RES_ROW_N(result); + rows = RES_ROWS(result); /* get the results and fill in return data structure */ for (loop=0; loop <nr_rows; loop++) { - rows = RES_ROWS(result); - values = ROW_VALUES(rows); + values = ROW_VALUES(&rows[loop]); size= sizeof(subs_t) + ( strlen(VAL_STRING(values+r_pres_uri_col)) diff --git a/modules_k/rls/subscribe.c b/modules_k/rls/subscribe.c index 1126762..9b7f31d 100644 --- a/modules_k/rls/subscribe.c +++ b/modules_k/rls/subscribe.c @@ -327,7 +327,7 @@ int reply_200(struct sip_msg* msg, str* contact, int expires) LM_ERR("no more pkg memory\n"); return -1; } - hdr_append.len = sprintf(hdr_append.s, "Expires: %d\r\n", expires); + hdr_append.len = sprintf(hdr_append.s, "Expires: %d\r\n", expires); if(hdr_append.len< 0) { LM_ERR("unsuccessful sprintf\n");
12 years, 2 months
1
0
0
0
git:3.3: modules_k/rls: core_hash() not used correctly to distribute notifier traffic
by Peter Dunkley
Module: sip-router Branch: 3.3 Commit: 1fe1770aa372b6d22554428fb7172215e502b20c URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1fe1770…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com> Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com> Date: Tue Sep 11 13:06:54 2012 +0100 modules_k/rls: core_hash() not used correctly to distribute notifier traffic - Found and fixed by Hugh Waite @ Crocodile RCS Ltd (cherry picked from commit 5235a1d6218e0bb16f6c9998789864635f54d03e) --- modules_k/rls/resource_notify.c | 4 ++-- modules_k/rls/rls_db.c | 4 ++-- modules_k/rls/subscribe.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules_k/rls/resource_notify.c b/modules_k/rls/resource_notify.c index 9c757ad..89f4e4f 100644 --- a/modules_k/rls/resource_notify.c +++ b/modules_k/rls/resource_notify.c @@ -720,9 +720,9 @@ int rls_handle_notify(struct sip_msg* msg, char* c1, char* c2) query_vals[n_query_cols].nul = 0; if (dbmode == RLS_DB_ONLY) query_vals[n_query_cols].val.int_val= - core_hash(res_id, NULL, + core_hash(res_id, NULL, 0) % (waitn_time * rls_notifier_poll_rate - * rls_notifier_processes) - 1); + * rls_notifier_processes); else query_vals[n_query_cols].val.int_val = UPDATED_TYPE; n_query_cols++; diff --git a/modules_k/rls/rls_db.c b/modules_k/rls/rls_db.c index 97ac7d6..5728a2f 100644 --- a/modules_k/rls/rls_db.c +++ b/modules_k/rls/rls_db.c @@ -174,8 +174,8 @@ int delete_expired_subs_rlsdb( void ) LM_ERR("cannot build rls subs did\n"); goto error; } - subs.updated = core_hash(&rlsubs_did, NULL, - (waitn_time * rls_notifier_poll_rate * rls_notifier_processes) - 1); + subs.updated = core_hash(&rlsubs_did, NULL, 0) % + (waitn_time * rls_notifier_poll_rate * rls_notifier_processes); n_query_cols = 0; diff --git a/modules_k/rls/subscribe.c b/modules_k/rls/subscribe.c index c9577de..1126762 100644 --- a/modules_k/rls/subscribe.c +++ b/modules_k/rls/subscribe.c @@ -586,8 +586,8 @@ int rls_handle_subscribe(struct sip_msg* msg, str watcher_user, str watcher_doma LM_ERR("cannot build rls subs did\n"); goto error; } - subs.updated = core_hash(&rlsubs_did, NULL, - (waitn_time * rls_notifier_poll_rate * rls_notifier_processes) - 1); + subs.updated = core_hash(&rlsubs_did, NULL, 0) % + (waitn_time * rls_notifier_poll_rate * rls_notifier_processes); if(get_to(msg)->tag_value.s==NULL || get_to(msg)->tag_value.len==0) { /* initial Subscribe */
12 years, 2 months
1
0
0
0
git:3.3: modules_k/presence: core_hash not used correctly to distribute notifier traffic
by Peter Dunkley
Module: sip-router Branch: 3.3 Commit: 262982b13c887c15e4c5a4d667530aad3fb8801c URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=262982b…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com> Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com> Date: Tue Sep 11 12:53:58 2012 +0100 modules_k/presence: core_hash not used correctly to distribute notifier traffic - Found and fixed by Hugh Waite @ Crocodile RCS Ltd (cherry picked from commit 4b9aa7f144b8cf3e6da775563528913ed79e0553) --- modules_k/presence/notify.c | 13 +++++++------ modules_k/presence/presence.c | 4 ++-- modules_k/presence/subscribe.c | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/modules_k/presence/notify.c b/modules_k/presence/notify.c index 4f5396d..d601acc 100644 --- a/modules_k/presence/notify.c +++ b/modules_k/presence/notify.c @@ -2223,9 +2223,9 @@ int set_wipeer_subs_updated(str *pres_uri, pres_ev_t *event, int full) update_cols[n_update_cols] = &str_updated_col; update_vals[n_update_cols].type = DB1_INT; update_vals[n_update_cols].nul = 0; - update_vals[n_update_cols].val.int_val = core_hash(&callid, - &from_tag, (pres_waitn_time * pres_notifier_poll_rate - * pres_notifier_processes) - 1); + update_vals[n_update_cols].val.int_val = + core_hash(&callid, &from_tag, 0) % (pres_waitn_time * + pres_notifier_poll_rate * pres_notifier_processes); n_update_cols++; if (full) @@ -2283,9 +2283,10 @@ int set_updated(subs_t *sub) update_cols[0] = &str_updated_col; update_vals[0].type = DB1_INT; update_vals[0].nul = 0; - update_vals[0].val.int_val = core_hash(&sub->callid, &sub->from_tag, - (pres_waitn_time * pres_notifier_poll_rate - * pres_notifier_processes) - 1); + update_vals[0].val.int_val = + core_hash(&sub->callid, &sub->from_tag, 0) % + (pres_waitn_time * pres_notifier_poll_rate + * pres_notifier_processes); if (pa_dbf.use_table(pa_db, &active_watchers_table) < 0) { diff --git a/modules_k/presence/presence.c b/modules_k/presence/presence.c index 118b4d2..0adec43 100644 --- a/modules_k/presence/presence.c +++ b/modules_k/presence/presence.c @@ -1407,9 +1407,9 @@ static int update_pw_dialogs_dbonlymode(subs_t* subs, subs_t** subs_array) * pres_notifier_processes)); } else { db_vals[n_update_cols].val.int_val = - core_hash(&subs->callid, &subs->from_tag, + core_hash(&subs->callid, &subs->from_tag, 0) % (pres_waitn_time * pres_notifier_poll_rate - * pres_notifier_processes) - 1); + * pres_notifier_processes); } n_update_cols++; diff --git a/modules_k/presence/subscribe.c b/modules_k/presence/subscribe.c index c8e9960..deeef3e 100644 --- a/modules_k/presence/subscribe.c +++ b/modules_k/presence/subscribe.c @@ -470,9 +470,9 @@ int update_subscription_notifier(struct sip_msg* msg, subs_t* subs, *sent_reply= 0; /* Set the notifier/update fields for the subscription */ - subs->updated = core_hash(&subs->callid, &subs->from_tag, + subs->updated = core_hash(&subs->callid, &subs->from_tag, 0) % (pres_waitn_time * pres_notifier_poll_rate - * pres_notifier_processes) - 1); + * pres_notifier_processes); if (subs->event->type & WINFO_TYPE) subs->updated_winfo = UPDATED_TYPE; else if (subs->event->wipeer)
12 years, 2 months
1
0
0
0
git:3.3: modules_k/presence: Improved check for expired dialogs in DB only mode with notifier tasks
by Peter Dunkley
Module: sip-router Branch: 3.3 Commit: 42a123c416d5906bfefd7eaae8ef81cacda80a41 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=42a123c…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com> Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com> Date: Tue Sep 11 12:56:52 2012 +0100 modules_k/presence: Improved check for expired dialogs in DB only mode with notifier tasks (cherry picked from commit d9087dbbf411f71486a4ce765aa5d6dfeb531f9c) --- modules_k/presence/subscribe.c | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/modules_k/presence/subscribe.c b/modules_k/presence/subscribe.c index deeef3e..7e90cce 100644 --- a/modules_k/presence/subscribe.c +++ b/modules_k/presence/subscribe.c @@ -1581,9 +1581,9 @@ int handle_expired_subs(subs_t* s) void update_db_subs_timer_notifier(void) { - db_key_t query_cols[1], result_cols[3]; - db_val_t query_vals[1], *values; - db_op_t query_ops[1]; + db_key_t query_cols[2], result_cols[3]; + db_val_t query_vals[2], *values; + db_op_t query_ops[2]; db_row_t *rows; db1_res_t *result = NULL; int n_query_cols = 0, n_result_cols = 0; @@ -1610,6 +1610,13 @@ void update_db_subs_timer_notifier(void) query_ops[n_query_cols]= OP_LT; n_query_cols++; + query_cols[n_query_cols]= &str_updated_col; + query_vals[n_query_cols].type = DB1_INT; + query_vals[n_query_cols].nul = 0; + query_vals[n_query_cols].val.int_val= NO_UPDATE_TYPE; + query_ops[n_query_cols]= OP_EQ; + n_query_cols++; + result_cols[r_callid_col=n_result_cols++] = &str_callid_col; result_cols[r_to_tag_col=n_result_cols++] = &str_to_tag_col; result_cols[r_from_tag_col=n_result_cols++] = &str_from_tag_col;
12 years, 2 months
1
0
0
0
git:3.3: modules_k/presence: Fixed inconsistencies in use of expires_offset for removing subcriptions
by Peter Dunkley
Module: sip-router Branch: 3.3 Commit: b4c70bca1cb3f0dc722bd89933fa566e790837a1 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b4c70bc…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com> Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com> Date: Tue Sep 11 12:51:33 2012 +0100 modules_k/presence: Fixed inconsistencies in use of expires_offset for removing subcriptions - These caused particular problems on mulit-server, DB only, systems - Found and fixed by Hugh Waite @ Crocodile RCS Ltd. (cherry picked from commit a29a2a81bc541af020955dbda0d352445fef5788) --- modules_k/presence/notify.c | 26 +++++++++----------------- modules_k/presence/presence.c | 6 +++--- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/modules_k/presence/notify.c b/modules_k/presence/notify.c index dd15bab..4f5396d 100644 --- a/modules_k/presence/notify.c +++ b/modules_k/presence/notify.c @@ -246,7 +246,7 @@ int get_wi_subs_db(subs_t* subs, watcher_t* watchers) int n_result_cols = 0; int n_query_cols = 0; int i; - int status_col, expires_col, watcher_user_col, watcher_domain_col, callid_col; + int status_col, watcher_user_col, watcher_domain_col, callid_col; query_cols[n_query_cols] = &str_presentity_uri_col; query_ops[n_query_cols] = OP_EQ; @@ -266,11 +266,10 @@ int get_wi_subs_db(subs_t* subs, watcher_t* watchers) query_ops[n_query_cols] = OP_GT; query_vals[n_query_cols].type = DB1_INT; query_vals[n_query_cols].nul = 0; - query_vals[n_query_cols].val.int_val = (int)time(NULL) - expires_offset; + query_vals[n_query_cols].val.int_val = (int)time(NULL) + expires_offset; n_query_cols++; result_cols[status_col=n_result_cols++] = &str_status_col; - result_cols[expires_col=n_result_cols++] = &str_expires_col; result_cols[watcher_user_col=n_result_cols++] = &str_watcher_username_col; result_cols[watcher_domain_col=n_result_cols++] = &str_watcher_domain_col; result_cols[callid_col=n_result_cols++] = &str_callid_col; @@ -581,11 +580,11 @@ error: str* get_p_notify_body(str pres_uri, pres_ev_t* event, str* etag, str* contact) { - db_key_t query_cols[6]; - db_val_t query_vals[6]; - db_key_t result_cols[6]; + db_key_t query_cols[3]; + db_val_t query_vals[3]; + db_key_t result_cols[3]; db1_res_t *result = NULL; - int body_col, expires_col, etag_col= 0, sender_col; + int body_col, etag_col= 0, sender_col; str** body_array= NULL; str* notify_body= NULL; db_row_t *row= NULL ; @@ -646,7 +645,6 @@ str* get_p_notify_body(str pres_uri, pres_ev_t* event, str* etag, n_query_cols++; result_cols[body_col=n_result_cols++] = &str_body_col; - result_cols[expires_col=n_result_cols++] = &str_expires_col; result_cols[etag_col=n_result_cols++] = &str_etag_col; result_cols[sender_col=n_result_cols++] = &str_sender_col; @@ -1087,9 +1085,6 @@ int get_subs_db(str* pres_uri, pres_ev_t* event, str* sender, row = &result->rows[i]; row_vals = ROW_VALUES(row); - // if(row_vals[expires_col].val.int_val< (int)time(NULL)) - // continue; - if(row_vals[reason_col].val.string_val) { if(strlen(row_vals[reason_col].val.string_val) != 0) continue; @@ -1145,11 +1140,10 @@ int get_subs_db(str* pres_uri, pres_ev_t* event, str* sender, s.event= event; s.local_cseq = row_vals[cseq_col].val.int_val +1; - if(row_vals[expires_col].val.int_val < (int)time(NULL)) + if(row_vals[expires_col].val.int_val < (int)time(NULL) + expires_offset) s.expires = 0; else - s.expires = row_vals[expires_col].val.int_val - - (int)time(NULL); + s.expires = row_vals[expires_col].val.int_val - (int)time(NULL); s.version = row_vals[version_col].val.int_val +1; s_new= mem_copy_subs(&s, PKG_MEM_TYPE); @@ -2845,13 +2839,11 @@ int process_dialogs(int round, int presence_winfo) cached_updated_winfo = sub.updated_winfo = VAL_INT(&dvalues[updated_winfo_col]); - if (VAL_INT(&dvalues[expires_col]) > now) + if (VAL_INT(&dvalues[expires_col]) > now + expires_offset) sub.expires = VAL_INT(&dvalues[expires_col]) - now; else sub.expires = 0; - if (sub.expires < expires_offset) sub.expires = 0; - sub.updated = round; if ((notify_sent = notifier_notify(&sub, &updated, &end_transaction)) < 0) diff --git a/modules_k/presence/presence.c b/modules_k/presence/presence.c index 29470bc..118b4d2 100644 --- a/modules_k/presence/presence.c +++ b/modules_k/presence/presence.c @@ -1348,10 +1348,10 @@ static int update_pw_dialogs_dbonlymode(subs_t* subs, subs_t** subs_array) s.expires = row_vals[r_expires_col].val.int_val; - if( s.expires < (int)time(NULL) ) - s.expires = 0; - else + if( s.expires > (int)time(NULL) + expires_offset) s.expires -= (int)time(NULL); + else + s.expires = 0; s.version = row_vals[r_version_col].val.int_val;
12 years, 2 months
1
0
0
0
git:3.3: modules_k/presence: Fixed some problems with for() loops in DB only mode
by Peter Dunkley
Module: sip-router Branch: 3.3 Commit: c2616fb78a9828203fbc9e885d96f07364df5000 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c2616fb…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com> Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com> Date: Tue Sep 11 12:55:49 2012 +0100 modules_k/presence: Fixed some problems with for() loops in DB only mode - Found and fixed by Hugh Waite @ Crocodile RCS Ltd (cherry picked from commit cd6415240ff243842b4e11b095103f00fd64d0d9) --- modules_k/presence/presence.c | 4 ++-- modules_k/presence/subscribe.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules_k/presence/presence.c b/modules_k/presence/presence.c index 0adec43..ed7f4d1 100644 --- a/modules_k/presence/presence.c +++ b/modules_k/presence/presence.c @@ -1277,11 +1277,11 @@ static int update_pw_dialogs_dbonlymode(subs_t* subs, subs_t** subs_array) return 0; } + rows = RES_ROWS(result); /* get the results and fill in return data structure */ for (loop=0; loop <nr_rows; loop++) { - rows = RES_ROWS(result); - row_vals = ROW_VALUES(rows); + row_vals = ROW_VALUES(&rows[loop]); memset(&s, 0, sizeof(subs_t)); s.status= subs->status; diff --git a/modules_k/presence/subscribe.c b/modules_k/presence/subscribe.c index 7e90cce..ad43f7b 100644 --- a/modules_k/presence/subscribe.c +++ b/modules_k/presence/subscribe.c @@ -1641,6 +1641,7 @@ void update_db_subs_timer_notifier(void) for (i = 0; i <RES_ROW_N(result); i++) { values = ROW_VALUES(&rows[i]); + memset(&subs, 0, sizeof(subs_t)); subs.callid.s = (char *) VAL_STRING(&values[r_callid_col]); subs.callid.len = strlen(subs.callid.s);
12 years, 2 months
1
0
0
0
git:3.3: modules_k/presence: Fixed level of a diagnostic message
by Peter Dunkley
Module: sip-router Branch: 3.3 Commit: ed672fdde6d6adbe7066162a6b1cbae8cc3948a8 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ed672fd…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com> Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com> Date: Tue Sep 11 12:54:51 2012 +0100 modules_k/presence: Fixed level of a diagnostic message (cherry picked from commit 3635a0d920f0d03e85b8b97a44d878f0f8d13931) --- modules_k/presence/notify.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/modules_k/presence/notify.c b/modules_k/presence/notify.c index d6bea37..dd15bab 100644 --- a/modules_k/presence/notify.c +++ b/modules_k/presence/notify.c @@ -2810,7 +2810,7 @@ int process_dialogs(int round, int presence_winfo) if (dialog->n <= 0) { - LM_WARN("record not found\n"); + LM_INFO("record not found - this may be observed in multi-server systems\n"); if (cleanup_missing_dialog(&sub) < 0) LM_ERR("cleaning up after missing record\n"); goto next_dialog;
12 years, 2 months
1
0
0
0
git:master: modules_k/pua: Adjusted locking for dialog insertion. Candidate fix for "temporary dialog" error reported by Juha
by Peter Dunkley
Module: sip-router Branch: master Commit: b0d642016cca83c519ea9aa0e04aa9bf353e07e4 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b0d6420…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com> Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com> Date: Tue Sep 11 13:23:23 2012 +0100 modules_k/pua: Adjusted locking for dialog insertion. Candidate fix for "temporary dialog" error reported by Juha --- modules_k/pua/hash.c | 18 +++--------------- modules_k/pua/hash.h | 3 ++- modules_k/pua/pua.c | 7 ++++++- modules_k/pua/send_publish.c | 4 +++- modules_k/pua/send_subscribe.c | 6 ++---- 5 files changed, 16 insertions(+), 22 deletions(-) diff --git a/modules_k/pua/hash.c b/modules_k/pua/hash.c index 1fa6149..9ad169b 100644 --- a/modules_k/pua/hash.c +++ b/modules_k/pua/hash.c @@ -235,7 +235,7 @@ void update_htable(ua_pres_t* p, time_t desired_expires, int expires, } } /* insert in front; so when searching the most recent result is returned*/ -void _insert_htable(ua_pres_t* presentity, unsigned int hash_code) +void insert_htable(ua_pres_t* presentity, unsigned int hash_code) { ua_pres_t* p= NULL; @@ -253,18 +253,6 @@ void _insert_htable(ua_pres_t* presentity, unsigned int hash_code) p->next= presentity; } -void insert_htable(ua_pres_t* presentity) -{ - unsigned int hash_code; - - hash_code= core_hash(presentity->pres_uri,presentity->watcher_uri, HASH_SIZE); - lock_get(&HashT->p_records[hash_code].lock); - - _insert_htable(presentity, hash_code); - - lock_release(&HashT->p_records[hash_code].lock); -} - /* This function used to perform a search to find the hash table entry that matches the presentity it is passed. However, everywhere it is used it is passed a pointer to the correct @@ -349,7 +337,7 @@ int convert_temporary_dialog(ua_pres_t *dialog) else return -1; - _insert_htable(dialog, hash_code); + insert_htable(dialog, hash_code); lock_release(&HashT->p_records[hash_code].lock); @@ -695,4 +683,4 @@ list_entry_t *get_subs_list(str *did) } done: return list; -} \ No newline at end of file +} diff --git a/modules_k/pua/hash.h b/modules_k/pua/hash.h index 61ccd54..9912eba 100644 --- a/modules_k/pua/hash.h +++ b/modules_k/pua/hash.h @@ -116,7 +116,8 @@ htable_t* new_htable(void); ua_pres_t* search_htable(ua_pres_t* pres, unsigned int hash_code); -void insert_htable(ua_pres_t* presentity ); +void insert_htable(ua_pres_t* presentity, unsigned int hash_code); + void update_htable(ua_pres_t* presentity,time_t desired_expires, int expires, str* etag, unsigned int hash_code, str* contact); diff --git a/modules_k/pua/pua.c b/modules_k/pua/pua.c index 2297219..8734d35 100644 --- a/modules_k/pua/pua.c +++ b/modules_k/pua/pua.c @@ -391,6 +391,7 @@ static int db_restore(void) int watcher_col,callid_col,totag_col,fromtag_col,cseq_col,remote_contact_col; int event_col,contact_col,tuple_col,record_route_col, extra_headers_col; int version_col; + unsigned int hash_code; if (dbmode==PUA_DB_ONLY) { @@ -643,7 +644,11 @@ static int db_restore(void) } print_ua_pres(p); - insert_htable(p); + + hash_code= core_hash(p->pres_uri, p->watcher_uri, HASH_SIZE); + lock_get(&HashT->p_records[hash_code].lock); + insert_htable(p, hash_code); + lock_release(&HashT->p_records[hash_code].lock); } } while((db_fetch_next(&pua_dbf, pua_fetch_rows, pua_db, &res)==1) diff --git a/modules_k/pua/send_publish.c b/modules_k/pua/send_publish.c index 1f4ed37..3a86cf3 100644 --- a/modules_k/pua/send_publish.c +++ b/modules_k/pua/send_publish.c @@ -422,7 +422,9 @@ void publ_cback_func(struct cell *t, int type, struct tmcb_params *ps) } else { - insert_htable(presentity); + lock_get(&HashT->p_records[hash_code].lock); + insert_htable(presentity, hash_code); + lock_release(&HashT->p_records[hash_code].lock); } LM_DBG("***Inserted in hash table\n"); diff --git a/modules_k/pua/send_subscribe.c b/modules_k/pua/send_subscribe.c index 1c10bf0..006bae4 100644 --- a/modules_k/pua/send_subscribe.c +++ b/modules_k/pua/send_subscribe.c @@ -1029,9 +1029,6 @@ int send_subscribe(subs_info_t* subs) int size; insert: - if (dbmode!=PUA_DB_ONLY) - lock_release(&HashT->p_records[hash_code].lock); - if (subs->expires == 0) /* Don't create a new dialog when expires == 0 */ goto done; @@ -1141,7 +1138,8 @@ insert: } else { - insert_htable(presentity); + insert_htable(presentity, hash_code); + lock_release(&HashT->p_records[hash_code].lock); } uac_r.dialog->rem_target.s = 0;
12 years, 2 months
1
0
0
0
← Newer
1
...
8
9
10
11
12
13
14
...
18
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Results per page:
10
25
50
100
200