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
December
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
July 2017
----- 2024 -----
December 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
23 participants
410 discussions
Start a n
N
ew thread
Re: [sr-dev] [kamailio/kamailio] lib/srdb1: db_table_version() can handle DB1_BIGINT and DB1_DOUBLE values (d0ac747)
by Emmanuel Schmidbauer
can this be backported to stable 5 version? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/commit/d0ac74742f6aeb71492d2a9cab74716…
7 years, 5 months
1
0
0
0
git:master:a5316a8c: rls: updated CONT_COPYDB() macro definition to use ;
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: a5316a8cb6a0476fca44fad43b4c560100994329 URL:
https://github.com/kamailio/kamailio/commit/a5316a8cb6a0476fca44fad43b4c560…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2017-07-13T17:32:14+02:00 rls: updated CONT_COPYDB() macro definition to use ; - the ; is added when using the macro - otherwise potential unexpected error by usage in expressions --- Modified: src/modules/rls/rls_db.c --- Diff:
https://github.com/kamailio/kamailio/commit/a5316a8cb6a0476fca44fad43b4c560…
Patch:
https://github.com/kamailio/kamailio/commit/a5316a8cb6a0476fca44fad43b4c560…
--- diff --git a/src/modules/rls/rls_db.c b/src/modules/rls/rls_db.c index e0eae7a613..5e88dea6cb 100644 --- a/src/modules/rls/rls_db.c +++ b/src/modules/rls/rls_db.c @@ -37,11 +37,11 @@ #define CONT_COPYDB(buf, dest, source)\ do{ \ - dest.s= (char*)buf+ size;\ - memcpy(dest.s, source, strlen(source));\ - dest.len= strlen(source);\ - size+= strlen(source); \ - } while(0); + dest.s= (char*)buf+ size;\ + memcpy(dest.s, source, strlen(source));\ + dest.len= strlen(source);\ + size+= strlen(source); \ + } while(0) /* database connection */ extern db1_con_t *rls_db; @@ -475,10 +475,10 @@ int update_all_subs_rlsdb(str *watcher_user, str *watcher_domain, str *evt) memset(dest, 0, size); size= sizeof(subs_t); - CONT_COPYDB(dest, dest->pres_uri, VAL_STRING(values+r_pres_uri_col)) - CONT_COPYDB(dest, dest->to_tag, VAL_STRING(values+r_to_tag_col)) - CONT_COPYDB(dest, dest->from_tag, VAL_STRING(values+r_from_tag_col)) - CONT_COPYDB(dest, dest->callid, VAL_STRING(values+r_callid_col)) + CONT_COPYDB(dest, dest->pres_uri, VAL_STRING(values+r_pres_uri_col)); + CONT_COPYDB(dest, dest->to_tag, VAL_STRING(values+r_to_tag_col)); + CONT_COPYDB(dest, dest->from_tag, VAL_STRING(values+r_from_tag_col)); + CONT_COPYDB(dest, dest->callid, VAL_STRING(values+r_callid_col)); dest->event = pres_contains_event(evt, &parsed_event); if(dest->event == NULL) @@ -1024,26 +1024,26 @@ subs_t *get_dialog_notify_rlsdb(str callid, str to_tag, str from_tag) memset(dest, 0, size); size= sizeof(subs_t); - CONT_COPYDB(dest, dest->pres_uri, VAL_STRING(values+r_pres_uri_col)) - CONT_COPYDB(dest, dest->to_user, VAL_STRING(values+r_to_user_col)) - CONT_COPYDB(dest, dest->to_domain, VAL_STRING(values+r_to_domain_col)) - CONT_COPYDB(dest, dest->from_user, VAL_STRING(values+r_from_user_col)) - CONT_COPYDB(dest, dest->from_domain, VAL_STRING(values+r_from_domain_col)) - CONT_COPYDB(dest, dest->watcher_user, VAL_STRING(values+r_watcher_user_col)) - CONT_COPYDB(dest, dest->watcher_domain, VAL_STRING(values+r_watcher_domain_col)) - CONT_COPYDB(dest, dest->to_tag, VAL_STRING(values+r_to_tag_col)) - CONT_COPYDB(dest, dest->from_tag, VAL_STRING(values+r_from_tag_col)) - CONT_COPYDB(dest, dest->callid, VAL_STRING(values+r_callid_col)) - CONT_COPYDB(dest, dest->sockinfo_str, VAL_STRING(values+r_socket_info_col)) - CONT_COPYDB(dest, dest->local_contact, VAL_STRING(values+r_local_contact_col)) - CONT_COPYDB(dest, dest->contact, VAL_STRING(values+r_contact_col)) - CONT_COPYDB(dest, dest->record_route, VAL_STRING(values+r_record_route_col)) + CONT_COPYDB(dest, dest->pres_uri, VAL_STRING(values+r_pres_uri_col)); + CONT_COPYDB(dest, dest->to_user, VAL_STRING(values+r_to_user_col)); + CONT_COPYDB(dest, dest->to_domain, VAL_STRING(values+r_to_domain_col)); + CONT_COPYDB(dest, dest->from_user, VAL_STRING(values+r_from_user_col)); + CONT_COPYDB(dest, dest->from_domain, VAL_STRING(values+r_from_domain_col)); + CONT_COPYDB(dest, dest->watcher_user, VAL_STRING(values+r_watcher_user_col)); + CONT_COPYDB(dest, dest->watcher_domain, VAL_STRING(values+r_watcher_domain_col)); + CONT_COPYDB(dest, dest->to_tag, VAL_STRING(values+r_to_tag_col)); + CONT_COPYDB(dest, dest->from_tag, VAL_STRING(values+r_from_tag_col)); + CONT_COPYDB(dest, dest->callid, VAL_STRING(values+r_callid_col)); + CONT_COPYDB(dest, dest->sockinfo_str, VAL_STRING(values+r_socket_info_col)); + CONT_COPYDB(dest, dest->local_contact, VAL_STRING(values+r_local_contact_col)); + CONT_COPYDB(dest, dest->contact, VAL_STRING(values+r_contact_col)); + CONT_COPYDB(dest, dest->record_route, VAL_STRING(values+r_record_route_col)); if(strlen(VAL_STRING(values+r_event_id_col)) > 0) - CONT_COPYDB(dest, dest->event_id, VAL_STRING(values+r_event_id_col)) + CONT_COPYDB(dest, dest->event_id, VAL_STRING(values+r_event_id_col)); if(strlen(VAL_STRING(values+r_reason_col)) > 0) - CONT_COPYDB(dest, dest->reason, VAL_STRING(values+r_reason_col)) + CONT_COPYDB(dest, dest->reason, VAL_STRING(values+r_reason_col)); ev_sname.s= (char *)VAL_STRING(values+r_event_col); ev_sname.len= strlen(ev_sname.s);
7 years, 5 months
1
0
0
0
git:master:833830ba: pua: updates for CONT_COPY() macro
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 833830baccc4968d8a8fd56f2fd8b4a4bfef3612 URL:
https://github.com/kamailio/kamailio/commit/833830baccc4968d8a8fd56f2fd8b4a…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2017-07-13T17:29:35+02:00 pua: updates for CONT_COPY() macro --- Modified: src/modules/pua/send_subscribe.c --- Diff:
https://github.com/kamailio/kamailio/commit/833830baccc4968d8a8fd56f2fd8b4a…
Patch:
https://github.com/kamailio/kamailio/commit/833830baccc4968d8a8fd56f2fd8b4a…
--- diff --git a/src/modules/pua/send_subscribe.c b/src/modules/pua/send_subscribe.c index 06e22aa069..ff1f5bad23 100644 --- a/src/modules/pua/send_subscribe.c +++ b/src/modules/pua/send_subscribe.c @@ -819,7 +819,7 @@ ua_pres_t* subscribe_cbparam(subs_info_t* subs, int ua_flag) if(subs->id.s) { - CONT_COPY(hentity, hentity->id, subs->id) + CONT_COPY(hentity, hentity->id, subs->id); } if(subs->extra_headers) { @@ -885,7 +885,7 @@ ua_pres_t* subs_cbparam_indlg(ua_pres_t* subs, int expires, int ua_flag) hentity->watcher_uri->len= subs->watcher_uri->len; size+= subs->watcher_uri->len; - CONT_COPY(hentity, hentity->contact, subs->contact) + CONT_COPY(hentity, hentity->contact, subs->contact); if(subs->outbound_proxy && subs->outbound_proxy->len && subs->outbound_proxy->s) { @@ -899,12 +899,12 @@ ua_pres_t* subs_cbparam_indlg(ua_pres_t* subs, int expires, int ua_flag) if(subs->id.s) { - CONT_COPY(hentity, hentity->id, subs->id) + CONT_COPY(hentity, hentity->id, subs->id); } if(subs->remote_contact.s) { - CONT_COPY(hentity, hentity->remote_contact, subs->remote_contact) + CONT_COPY(hentity, hentity->remote_contact, subs->remote_contact); } if(subs->extra_headers && subs->extra_headers->s) @@ -919,9 +919,9 @@ ua_pres_t* subs_cbparam_indlg(ua_pres_t* subs, int expires, int ua_flag) } /* copy dialog information */ - CONT_COPY(hentity, hentity->to_tag, subs->to_tag) - CONT_COPY(hentity, hentity->from_tag, subs->from_tag) - CONT_COPY(hentity, hentity->call_id, subs->call_id) + CONT_COPY(hentity, hentity->to_tag, subs->to_tag); + CONT_COPY(hentity, hentity->from_tag, subs->from_tag); + CONT_COPY(hentity, hentity->call_id, subs->call_id); if(expires< 0) hentity->desired_expires= 0;
7 years, 5 months
1
0
0
0
Broken: kamailio/kamailio#4564 (master - c0196f1)
by Travis CI
Build Update for kamailio/kamailio ------------------------------------- Build: #4564 Status: Broken Duration: 4 minutes and 26 seconds Commit: c0196f1 (master) Author: Daniel-Constantin Mierla Message: presence_xml: ensure that node name lenght is at least 9 - needs to accomodate 'provide-xyz' inside get_final_notify_body() View the changeset:
https://github.com/kamailio/kamailio/compare/b4db01f09ca6...c0196f10790a
View the full build log and details:
https://travis-ci.org/kamailio/kamailio/builds/253254958?utm_source=email&u…
-- You can configure recipients for build notifications in your .travis.yml file. See
https://docs.travis-ci.com/user/notifications
7 years, 5 months
1
0
0
0
git:master:c0196f10: presence_xml: ensure that node name lenght is at least 9
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: c0196f10790aacb4053db5c3452645ec32e7894a URL:
https://github.com/kamailio/kamailio/commit/c0196f10790aacb4053db5c3452645e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2017-07-13T17:19:33+02:00 presence_xml: ensure that node name lenght is at least 9 - needs to accomodate 'provide-xyz' inside get_final_notify_body() --- Modified: src/modules/presence_xml/notify_body.c --- Diff:
https://github.com/kamailio/kamailio/commit/c0196f10790aacb4053db5c3452645e…
Patch:
https://github.com/kamailio/kamailio/commit/c0196f10790aacb4053db5c3452645e…
--- diff --git a/src/modules/presence_xml/notify_body.c b/src/modules/presence_xml/notify_body.c index 20160c550c..82b4a4d96e 100644 --- a/src/modules/presence_xml/notify_body.c +++ b/src/modules/presence_xml/notify_body.c @@ -224,6 +224,7 @@ str* get_final_notify_body( subs_t *subs, str* notify_body, xmlNodePtr rule_node xmlDocPtr doc= NULL; #define KSR_FNB_NAME_SIZE 24 char name[KSR_FNB_NAME_SIZE]; + int name_len; char service_uri_scheme[16]; int i= 0, found = 0; str* new_body = NULL; @@ -268,10 +269,15 @@ str* get_final_notify_body( subs_t *subs, str* notify_body, xmlNodePtr rule_node if(xmlStrcasecmp(node->name, (unsigned char*)"text")== 0) continue; - LM_DBG("transf_node->name:%s\n",node->name); + /* handle 'provide-xyz' nodes */ + name_len = strlen((char*)(node->name)); + if(name_len<9) { + continue; + } + LM_DBG("transf_node->name:%s\n", node->name); /* skip 'provide-' (e.g., provide-services) */ - if(strlen((char*)(node->name + 8))>KSR_FNB_NAME_SIZE-1) { + if(name_len-8>KSR_FNB_NAME_SIZE-1) { LM_INFO("unsupported handling of: %s\n", (char*)node->name); continue; }
7 years, 5 months
1
0
0
0
git:master:0eda1dde: presence_xml: safety check for lenght of node name in xml transformations
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 0eda1dde62a6d3d805f0ae32db67055aa0705ce8 URL:
https://github.com/kamailio/kamailio/commit/0eda1dde62a6d3d805f0ae32db67055…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2017-07-13T17:13:46+02:00 presence_xml: safety check for lenght of node name in xml transformations --- Modified: src/modules/presence_xml/notify_body.c --- Diff:
https://github.com/kamailio/kamailio/commit/0eda1dde62a6d3d805f0ae32db67055…
Patch:
https://github.com/kamailio/kamailio/commit/0eda1dde62a6d3d805f0ae32db67055…
--- diff --git a/src/modules/presence_xml/notify_body.c b/src/modules/presence_xml/notify_body.c index 5fc58323f8..20160c550c 100644 --- a/src/modules/presence_xml/notify_body.c +++ b/src/modules/presence_xml/notify_body.c @@ -222,14 +222,15 @@ str* get_final_notify_body( subs_t *subs, str* notify_body, xmlNodePtr rule_node xmlNodePtr doc_root = NULL, doc_node = NULL, provide_node = NULL; xmlNodePtr all_node = NULL; xmlDocPtr doc= NULL; - char name[15]; - char service_uri_scheme[10]; +#define KSR_FNB_NAME_SIZE 24 + char name[KSR_FNB_NAME_SIZE]; + char service_uri_scheme[16]; int i= 0, found = 0; str* new_body = NULL; char* class_cont = NULL, *occurence_ID= NULL, *service_uri= NULL; char* deviceID = NULL; char* content = NULL; - char all_name[20]; + char all_name[KSR_FNB_NAME_SIZE+8]; strcpy(all_name, "all-"); @@ -269,7 +270,12 @@ str* get_final_notify_body( subs_t *subs, str* notify_body, xmlNodePtr rule_node LM_DBG("transf_node->name:%s\n",node->name); - strcpy((char*)name ,(char*)(node->name + 8)); + /* skip 'provide-' (e.g., provide-services) */ + if(strlen((char*)(node->name + 8))>KSR_FNB_NAME_SIZE-1) { + LM_INFO("unsupported handling of: %s\n", (char*)node->name); + continue; + } + strcpy((char*)name, (char*)(node->name + 8)); strcpy(all_name+4, name); if(xmlStrcasecmp((unsigned char*)name,(unsigned char*)"services") == 0)
7 years, 5 months
1
0
0
0
git:master:9d01c307: presence: wrap error macro in do {} while(0), safety checks
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 9d01c307f23675589d95d8d00c9fd289ac30372b URL:
https://github.com/kamailio/kamailio/commit/9d01c307f23675589d95d8d00c9fd28…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2017-07-13T16:50:05+02:00 presence: wrap error macro in do {} while(0), safety checks - free ws_list pointer when sphere is enabled - copy macros not ended with ; in definition -- done it when using --- Modified: src/modules/presence/event_list.c Modified: src/modules/presence/hash.c Modified: src/modules/presence/hash.h Modified: src/modules/presence/presence.c Modified: src/modules/presence/presentity.c Modified: src/modules/presence/subscribe.c --- Diff:
https://github.com/kamailio/kamailio/commit/9d01c307f23675589d95d8d00c9fd28…
Patch:
https://github.com/kamailio/kamailio/commit/9d01c307f23675589d95d8d00c9fd28…
7 years, 5 months
1
0
0
0
git:master:b4db01f0: ndb_redis: do not free pointers in the array in pv name parse function
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: b4db01f09ca646ef1a6473a8c66ccf7120537b53 URL:
https://github.com/kamailio/kamailio/commit/b4db01f09ca646ef1a6473a8c66ccf7…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2017-07-13T09:32:24+02:00 ndb_redis: do not free pointers in the array in pv name parse function - restore last char in cmd in case of error for redisc_exec() --- Modified: src/modules/ndb_redis/ndb_redis_mod.c Modified: src/modules/ndb_redis/redis_client.c --- Diff:
https://github.com/kamailio/kamailio/commit/b4db01f09ca646ef1a6473a8c66ccf7…
Patch:
https://github.com/kamailio/kamailio/commit/b4db01f09ca646ef1a6473a8c66ccf7…
--- diff --git a/src/modules/ndb_redis/ndb_redis_mod.c b/src/modules/ndb_redis/ndb_redis_mod.c index 2dcb531bae..d5462bb1c8 100644 --- a/src/modules/ndb_redis/ndb_redis_mod.c +++ b/src/modules/ndb_redis/ndb_redis_mod.c @@ -618,7 +618,6 @@ int redis_parse_index(str *in, gparam_t *gp) if (gp->v.pvs == NULL) { LM_ERR("no pkg memory left for pv_spec_t\n"); - pkg_free(gp); return -1; } @@ -626,7 +625,6 @@ int redis_parse_index(str *in, gparam_t *gp) { LM_ERR("invalid PV identifier\n"); pkg_free(gp->v.pvs); - pkg_free(gp); return -1; } } else { diff --git a/src/modules/ndb_redis/redis_client.c b/src/modules/ndb_redis/redis_client.c index 520f32364b..1f20fdffa6 100644 --- a/src/modules/ndb_redis/redis_client.c +++ b/src/modules/ndb_redis/redis_client.c @@ -700,6 +700,7 @@ int redisc_exec(str *srv, str *res, str *cmd, ...) redisc_reply_t *rpl; char c; va_list ap, ap2, ap3, ap4; + int ret = -1; va_start(ap, cmd); va_copy(ap2, ap); @@ -709,13 +710,17 @@ int redisc_exec(str *srv, str *res, str *cmd, ...) if(srv==NULL || cmd==NULL || res==NULL) { LM_ERR("invalid parameters"); - goto error_exec; + goto error; } if(srv->len==0 || res->len==0 || cmd->len==0) { LM_ERR("invalid parameters"); - goto error_exec; + goto error; } + + c = cmd->s[cmd->len]; + cmd->s[cmd->len] = '\0'; + rsrv = redisc_get_server(srv); if(rsrv==NULL) { @@ -731,10 +736,11 @@ int redisc_exec(str *srv, str *res, str *cmd, ...) goto error_exec; } LM_DBG("rsrv->ctxRedis = %p\n", rsrv->ctxRedis); - + if (rsrv->piped.pending_commands != 0) { - LM_NOTICE("Calling redis_cmd with pipelined commands in the buffer. Automatically call redis_execute"); + LM_NOTICE("Calling redis_cmd with pipelined commands in the buffer." + " Automatically call redis_execute"); redisc_exec_pipelined(rsrv); } /* if server is disabled do nothing unless the disable time has passed */ @@ -742,15 +748,13 @@ int redisc_exec(str *srv, str *res, str *cmd, ...) { goto srv_disabled; } - + rpl = redisc_get_reply(res); if(rpl==NULL) { LM_ERR("no redis reply id found: %.*s\n", res->len, res->s); goto error_exec; } - c = cmd->s[cmd->len]; - cmd->s[cmd->len] = '\0'; if(rpl->rplRedis!=NULL) { /* clean up previous redis reply */ @@ -831,19 +835,21 @@ int redisc_exec(str *srv, str *res, str *cmd, ...) return 0; error_exec: - va_end(ap); - va_end(ap2); - va_end(ap3); - va_end(ap4); - return -1; + cmd->s[cmd->len] = c; + ret = -1; + goto error; srv_disabled: + cmd->s[cmd->len] = c; + ret = -2; + goto error; + +error: va_end(ap); va_end(ap2); va_end(ap3); va_end(ap4); - return -2; - + return ret; } /**
7 years, 5 months
1
0
0
0
[kamailio/kamailio] core: allow 64-bit integer when checking version number (#1186)
by Emmanuel Schmidbauer
cockroachdb does not have support for 32-bit integers this commit adds basic support into the version table by allowing 64-bit integers from cockroachdb cockroachdb support can be implemented on a per module basis from here on You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1186
-- Commit Summary -- * core: allow 64-bit integer when checking version number -- File Changes -- M src/lib/srdb1/db.c (12) -- Patch Links --
https://github.com/kamailio/kamailio/pull/1186.patch
https://github.com/kamailio/kamailio/pull/1186.diff
-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1186
7 years, 5 months
2
6
0
0
git:master:d0ac7474: lib/srdb1: db_table_version() can handle DB1_BIGINT and DB1_DOUBLE values
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: d0ac74742f6aeb71492d2a9cab747162cdc5ddf8 URL:
https://github.com/kamailio/kamailio/commit/d0ac74742f6aeb71492d2a9cab74716…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2017-07-13T09:03:54+02:00 lib/srdb1: db_table_version() can handle DB1_BIGINT and DB1_DOUBLE values - in case of views or other database engine, the type for version value can be different that DB1_INT. If it is a number, cast it to int - extracted from GH #1186 by Emmanuel Schmidbauer <emmanuel(a)getweave.com> --- Modified: src/lib/srdb1/db.c --- Diff:
https://github.com/kamailio/kamailio/commit/d0ac74742f6aeb71492d2a9cab74716…
Patch:
https://github.com/kamailio/kamailio/commit/d0ac74742f6aeb71492d2a9cab74716…
--- diff --git a/src/lib/srdb1/db.c b/src/lib/srdb1/db.c index e8ddd377a5..c3908af85d 100644 --- a/src/lib/srdb1/db.c +++ b/src/lib/srdb1/db.c @@ -374,7 +374,8 @@ int db_table_version(const db_func_t* dbf, db1_con_t* connection, const str* tab str *version = &version_table; str tmp1 = str_init(TABLENAME_COLUMN); str tmp2 = str_init(VERSION_COLUMN); - int ret; + int ret = 0; + int val_type; if (!dbf||!connection || !table || !table->s) { LM_CRIT("invalid parameter value\n"); @@ -412,7 +413,9 @@ int db_table_version(const db_func_t* dbf, db1_con_t* connection, const str* tab } ver = ROW_VALUES(RES_ROWS(res)); - if ( VAL_TYPE(ver)!=DB1_INT || VAL_NULL(ver) ) { + val_type = VAL_TYPE(ver); + if ( (val_type!=DB1_INT && val_type!=DB1_DOUBLE && val_type!=DB1_BIGINT) + || VAL_NULL(ver) ) { LM_ERR("invalid type (%d) or nul (%d) version " "columns for %.*s\n", VAL_TYPE(ver), VAL_NULL(ver), table->len, ZSW(table->s)); @@ -420,8 +423,16 @@ int db_table_version(const db_func_t* dbf, db1_con_t* connection, const str* tab return -1; } - ret = VAL_INT(ver); + if (val_type == DB1_INT) { + ret = VAL_INT(ver); + } else if (val_type == DB1_BIGINT) { + ret = (int)VAL_BIGINT(ver); + } else if (val_type == DB1_DOUBLE) { + ret = (int)VAL_DOUBLE(ver); + } + dbf->free_result(connection, res); + return ret; }
7 years, 5 months
1
0
0
0
← Newer
1
...
26
27
28
29
30
31
32
...
41
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Results per page:
10
25
50
100
200