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
August 2010
----- 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
26 participants
346 discussions
Start a n
N
ew thread
git:master: textops(k): declare variables at function start
by Andrei Pelinescu-Onciul
Module: sip-router Branch: master Commit: ba63bfee9c4406d4694e886cf2d0236e8a3cc893 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ba63bfe…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org> Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org> Date: Thu Aug 26 21:52:24 2010 +0200 textops(k): declare variables at function start Fixes compilation with gcc < 3.0. --- modules_k/textops/api.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules_k/textops/api.c b/modules_k/textops/api.c index f2bd094..aad62e1 100644 --- a/modules_k/textops/api.c +++ b/modules_k/textops/api.c @@ -53,12 +53,14 @@ int remove_hf_api(struct sip_msg *msg, str* str_hf){ int search_append_api(struct sip_msg *msg, str *regex, str *data_str){ int retval; + char *data; + void **param; - char *data=pkg_malloc(data_str->len+1); + data=pkg_malloc(data_str->len+1); memcpy(data,data_str->s,data_str->len); memset(data+data_str->len,0,1); - void **param=pkg_malloc(sizeof(void*)); + param=pkg_malloc(sizeof(void*)); *param=pkg_malloc(regex->len+1); memcpy(*param,regex->s,regex->len); memset(*param+regex->len,0,1);
14 years, 3 months
1
0
0
0
git:master: registrar(k): declare variables at function start
by Andrei Pelinescu-Onciul
Module: sip-router Branch: master Commit: 1a8ce8fdc91f1708057430bcbe07b5edb656591a URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1a8ce8f…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org> Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org> Date: Thu Aug 26 21:51:41 2010 +0200 registrar(k): declare variables at function start Fixes compilation with gcc < 3.0. --- modules_k/registrar/reg_mod.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/modules_k/registrar/reg_mod.c b/modules_k/registrar/reg_mod.c index 10e4362..239447e 100644 --- a/modules_k/registrar/reg_mod.c +++ b/modules_k/registrar/reg_mod.c @@ -241,6 +241,7 @@ static int mod_init(void) pv_spec_t avp_spec; str s; bind_usrloc_t bind_usrloc; + qvalue_t dq; #ifdef STATISTICS @@ -326,7 +327,7 @@ static int mod_init(void) } /* Normalize default_q parameter */ - qvalue_t dq = cfg_get(registrar, registrar_cfg, default_q); + dq = cfg_get(registrar, registrar_cfg, default_q); if ( dq!= Q_UNSPECIFIED) { if (dq > MAX_Q) { LM_DBG("default_q = %d, lowering to MAX_Q: %d\n", dq, MAX_Q);
14 years, 3 months
1
0
0
0
git:master: mediaproxy: declare variables at function start
by Andrei Pelinescu-Onciul
Module: sip-router Branch: master Commit: 84482678115bfaf3815c03f55376e553f77dafb8 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8448267…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org> Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org> Date: Thu Aug 26 21:49:58 2010 +0200 mediaproxy: declare variables at function start Fixes compilation with gcc < 3.0. --- modules/mediaproxy/mediaproxy.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/modules/mediaproxy/mediaproxy.c b/modules/mediaproxy/mediaproxy.c index 855fb7d..b195123 100644 --- a/modules/mediaproxy/mediaproxy.c +++ b/modules/mediaproxy/mediaproxy.c @@ -1568,6 +1568,7 @@ use_media_proxy(struct sip_msg *msg, char *dialog_id, ice_candidate_data *ice_da Bool removed_session_ip, have_sdp; SessionInfo session; StreamInfo stream; + unsigned int priority; if (msg == NULL) return -1; @@ -1807,7 +1808,7 @@ use_media_proxy(struct sip_msg *msg, char *dialog_id, ice_candidate_data *ice_da struct in_addr hexip; inet_aton(tokens[0].s, &hexip); - unsigned int priority = (ice_data == NULL)?get_ice_candidate_priority(priority_str):ice_data->priority; + priority = (ice_data == NULL)?get_ice_candidate_priority(priority_str):ice_data->priority; port = strtoint(&tokens[j]); candidate.s = buf; candidate.len = sprintf(candidate.s, "a=candidate:R%x 1 UDP %u %.*s %i typ relay%.*s",
14 years, 3 months
1
0
0
0
git:master: dialog(k): declare variables at function start
by Andrei Pelinescu-Onciul
Module: sip-router Branch: master Commit: 361ab5c90f2a8750bf58eb2921b8a40294dbfa80 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=361ab5c…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org> Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org> Date: Thu Aug 26 21:50:59 2010 +0200 dialog(k): declare variables at function start Fixes compilation for gcc < 3.0. --- modules_k/dialog/dlg_req_within.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules_k/dialog/dlg_req_within.c b/modules_k/dialog/dlg_req_within.c index 7d50926..36e3012 100644 --- a/modules_k/dialog/dlg_req_within.c +++ b/modules_k/dialog/dlg_req_within.c @@ -237,6 +237,10 @@ error: */ static inline int send_bye(struct dlg_cell * cell, int dir, str *hdrs) { + uac_req_t uac_r; + dlg_t* dialog_info; + str met = {"BYE", 3}; + int result; /* do not send BYE request for non-confirmed dialogs (not supported) */ if (cell->state != DLG_STATE_CONFIRMED_NA && cell->state != DLG_STATE_CONFIRMED) { LM_ERR("terminating non-confirmed dialogs not supported\n"); @@ -244,10 +248,6 @@ static inline int send_bye(struct dlg_cell * cell, int dir, str *hdrs) } /*verify direction*/ - uac_req_t uac_r; - dlg_t* dialog_info; - str met = {"BYE", 3}; - int result; if ((dialog_info = build_dlg_t(cell, dir)) == 0){ LM_ERR("failed to create dlg_t\n");
14 years, 3 months
1
0
0
0
git:master: mtree: declare variables at function start
by Andrei Pelinescu-Onciul
Module: sip-router Branch: master Commit: 96262b5a05d8f130c6460a8bd97555bc53278f55 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=96262b5…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org> Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org> Date: Thu Aug 26 21:47:56 2010 +0200 mtree: declare variables at function start Fixes compilation for gcc < 3.0. --- modules/mtree/mtree.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/mtree/mtree.c b/modules/mtree/mtree.c index 51d355a..a1626d2 100644 --- a/modules/mtree/mtree.c +++ b/modules/mtree/mtree.c @@ -597,11 +597,12 @@ int mt_table_spec(char* val) param_t* params_list = NULL; param_hooks_t phooks; param_t *pit=NULL; - if(val==NULL) - return -1; m_tree_t tmp; m_tree_t *it, *prev, *ndl; str s; + + if(val==NULL) + return -1; if(!shm_initialized()) {
14 years, 3 months
1
0
0
0
git:master: core: don't use conditionals in macro arguments
by Andrei Pelinescu-Onciul
Module: sip-router Branch: master Commit: b7ef15763937e08779fa24d9ad4681be56c2b622 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b7ef157…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org> Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org> Date: Thu Aug 26 21:46:19 2010 +0200 core: don't use conditionals in macro arguments Older gccs (< 3.3) do not like #ifdefs inside macro calls. --- io_wait.h | 8 +++++--- sctp_server.c | 11 ++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/io_wait.h b/io_wait.h index f3ce324..7220dd5 100644 --- a/io_wait.h +++ b/io_wait.h @@ -812,12 +812,14 @@ inline static int io_watch_chg(io_wait_h* h, int fd, short events, int idx ) del_events=e->events & ~events; switch(h->poll_method){ case POLL_POLL: - fd_array_chg(events #ifdef POLLRDHUP + fd_array_chg(events | /* listen to POLLRDHUP by default (if POLLIN) */ - | (((int)!(events & POLLIN) - 1) & POLLRDHUP) -#endif /* POLLRDHUP */ + (((int)!(events & POLLIN) - 1) & POLLRDHUP) ); +#else /* POLLRDHUP */ + fd_array_chg(events); +#endif /* POLLRDHUP */ break; #ifdef HAVE_SELECT case POLL_SELECT: diff --git a/sctp_server.c b/sctp_server.c index 81bd3b7..cfd7015 100644 --- a/sctp_server.c +++ b/sctp_server.c @@ -2475,12 +2475,17 @@ int sctp_rcv_loop() /* get ancillary data */ for (cmsg=CMSG_FIRSTHDR(&msg); cmsg; cmsg=CMSG_NXTHDR(&msg, cmsg)){ +#ifdef SCTP_EXT if (likely((cmsg->cmsg_level==IPPROTO_SCTP) && ((cmsg->cmsg_type==SCTP_SNDRCV) -#ifdef SCTP_EXT || (cmsg->cmsg_type==SCTP_EXTRCV) -#endif - ) && (cmsg->cmsg_len>=CMSG_LEN(sizeof(*sinfo)))) ){ + ) && (cmsg->cmsg_len>=CMSG_LEN(sizeof(*sinfo)))) ) +#else /* !SCTP_EXT -- same as above but w/o SCTP_EXTRCV */ + if (likely((cmsg->cmsg_level==IPPROTO_SCTP) && + ((cmsg->cmsg_type==SCTP_SNDRCV) + ) && (cmsg->cmsg_len>=CMSG_LEN(sizeof(*sinfo)))) ) +#endif /*SCTP_EXT */ + { sinfo=(struct sctp_sndrcvinfo*)CMSG_DATA(cmsg); DBG("sctp recv: message from %s:%d stream %d ppid %x" " flags %x%s tsn %u" " cumtsn %u assoc_id %d\n",
14 years, 3 months
1
0
0
0
git:master: core: pointer aliasing warning fixes for fix_rval_expr
by Andrei Pelinescu-Onciul
Module: sip-router Branch: master Commit: d6dd5f5649bd5b41c7535bde7230251802e88641 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d6dd5f5…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org> Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org> Date: Thu Aug 26 21:44:59 2010 +0200 core: pointer aliasing warning fixes for fix_rval_expr --- route.c | 18 +++++++++--------- rvalue.c | 21 +++++++++------------ rvalue.h | 2 +- 3 files changed, 19 insertions(+), 22 deletions(-) diff --git a/route.c b/route.c index f198193..45de184 100644 --- a/route.c +++ b/route.c @@ -549,7 +549,7 @@ int fix_expr(struct expr* exp) to non-rvals, e.g. string, avp a.s.o and needs to be done before MATCH_OP and other fixups) */ if (exp->l_type==RVEXP_O){ - if ((ret=fix_rval_expr(&exp->l.param))<0){ + if ((ret=fix_rval_expr(exp->l.param))<0){ ERR("Unable to fix left rval expression\n"); return ret; } @@ -557,7 +557,7 @@ int fix_expr(struct expr* exp) exp_optimize_left(exp); } if (exp->r_type==RVE_ST){ - if ((ret=fix_rval_expr(&exp->r.param))<0){ + if ((ret=fix_rval_expr(exp->r.param))<0){ ERR("Unable to fix right rval expression\n"); return ret; } @@ -747,7 +747,7 @@ int fix_actions(struct action* a) return E_UNSPEC; } */ - if ((ret=fix_rval_expr(&t->val[0].u.data))<0) + if ((ret=fix_rval_expr(t->val[0].u.data))<0) goto error; } if ( (t->val[1].type==ACTIONS_ST)&&(t->val[1].u.data) ){ @@ -775,7 +775,7 @@ int fix_actions(struct action* a) goto error; } if (t->val[0].u.data){ - if ((ret=fix_rval_expr(&t->val[0].u.data))<0) + if ((ret=fix_rval_expr(t->val[0].u.data))<0) goto error; }else{ LOG(L_CRIT, "BUG: fix_actions: null switch()" @@ -827,7 +827,7 @@ int fix_actions(struct action* a) ret = E_SCRIPT; goto error; } - if ((ret=fix_rval_expr(&t->val[0].u.data))<0) + if ((ret=fix_rval_expr(t->val[0].u.data))<0) goto error; }else{ LOG(L_CRIT, "BUG: fix_actions: null while()" @@ -871,7 +871,7 @@ int fix_actions(struct action* a) ret = E_SCRIPT; goto error; } - if ((ret=fix_rval_expr(&t->val[0].u.data))<0) + if ((ret=fix_rval_expr(t->val[0].u.data))<0) goto error; }else{ LOG(L_CRIT, "BUG: fix_actions: null drop/return" @@ -910,7 +910,7 @@ int fix_actions(struct action* a) goto error; } } - if ((ret=fix_rval_expr(&t->val[1].u.data))<0) + if ((ret=fix_rval_expr(t->val[1].u.data))<0) goto error; break; @@ -963,7 +963,7 @@ int fix_actions(struct action* a) /* expression is not constant => fixup & optimize it */ rve_param_no++; - if ((ret=fix_rval_expr(&t->val[i+2].u.data)) + if ((ret=fix_rval_expr(t->val[i+2].u.data)) < 0) { ERR("rve fixup failed\n"); ret = E_BUG; @@ -1104,7 +1104,7 @@ int fix_actions(struct action* a) if (t->val[0].type == RVE_ST) { rve=(struct rval_expr*)t->val[0].u.data; if (!rve_is_constant(rve)) { - if ((ret=fix_rval_expr(&t->val[0].u.data)) < 0){ + if ((ret=fix_rval_expr(t->val[0].u.data)) < 0){ ERR("route() failed to fix rve at %s:%d\n", (t->cfile)?t->cfile:"line", t->cline); ret = E_BUG; diff --git a/rvalue.c b/rvalue.c index 707a7f4..eeac3d5 100644 --- a/rvalue.c +++ b/rvalue.c @@ -2899,7 +2899,7 @@ static int fix_match_rve(struct rval_expr* rve) v.s.s=0; v.re.regex=0; /* normal fix-up for the left side */ - ret=fix_rval_expr((void**)&rve->left.rve); + ret=fix_rval_expr((void*)rve->left.rve); if (ret<0) return ret; /* fixup the right side (RE) */ @@ -2946,7 +2946,7 @@ static int fix_match_rve(struct rval_expr* rve) goto error; }else{ /* right side is not constant => normal fixup */ - return fix_rval_expr((void**)&rve->right.rve); + return fix_rval_expr((void*)rve->right.rve); } return 0; error: @@ -3688,19 +3688,16 @@ error: /** fix a rval_expr. * fixes action, bexprs, resolves selects, pvars and * optimizes simple sub expressions (e.g. 1+2). - * It might modify *p. * - * @param p - double pointer to a rval_expr (might be changed to a new one) - * @return 0 on success, <0 on error (modifies also *p) + * @param p - pointer to a rval_expr + * @return 0 on success, <0 on error (modifies also *(struct rval_expr*)p) */ -int fix_rval_expr(void** p) +int fix_rval_expr(void* p) { - struct rval_expr** prve; struct rval_expr* rve; int ret; - prve=(struct rval_expr**)p; - rve=*prve; + rve=(struct rval_expr*)p; switch(rve->op){ case RVE_NONE_OP: @@ -3716,7 +3713,7 @@ int fix_rval_expr(void** p) case RVE_DEFINED_OP: case RVE_INT_OP: case RVE_STR_OP: - ret=fix_rval_expr((void**)&rve->left.rve); + ret=fix_rval_expr((void*)rve->left.rve); if (ret<0) return ret; break; case RVE_MUL_OP: @@ -3740,9 +3737,9 @@ int fix_rval_expr(void** p) case RVE_STREQ_OP: case RVE_STRDIFF_OP: case RVE_CONCAT_OP: - ret=fix_rval_expr((void**)&rve->left.rve); + ret=fix_rval_expr((void*)rve->left.rve); if (ret<0) return ret; - ret=fix_rval_expr((void**)&rve->right.rve); + ret=fix_rval_expr((void*)rve->right.rve); if (ret<0) return ret; break; case RVE_MATCH_OP: diff --git a/rvalue.h b/rvalue.h index 90c02b3..8e67c2e 100644 --- a/rvalue.h +++ b/rvalue.h @@ -240,5 +240,5 @@ struct rval_expr* mk_rval_expr2(enum rval_expr_op op, struct rval_expr* rve1, void rve_destroy(struct rval_expr* rve); /** fix a rval_expr. */ -int fix_rval_expr(void** p); +int fix_rval_expr(void* p); #endif /* _rvalue_h */
14 years, 3 months
1
0
0
0
git:master: core: use const in some ip_addr functions
by Andrei Pelinescu-Onciul
Module: sip-router Branch: master Commit: e18010e954268a69ccbf72025eaf5f52865d88d3 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e18010e…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org> Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org> Date: Thu Aug 26 21:42:54 2010 +0200 core: use const in some ip_addr functions Fixes various warnings (gcc-4.2) in other parts of the code. --- ip_addr.h | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ip_addr.h b/ip_addr.h index 50fbf58..d751781 100644 --- a/ip_addr.h +++ b/ip_addr.h @@ -365,7 +365,8 @@ static inline void sockaddr2ip_addr(struct ip_addr* ip, struct sockaddr* sa) /* compare 2 sockaddr_unions */ -static inline int su_cmp(union sockaddr_union* s1, union sockaddr_union* s2) +static inline int su_cmp(const union sockaddr_union* s1, + const union sockaddr_union* s2) { if (s1->s.sa_family!=s2->s.sa_family) return 0; switch(s1->s.sa_family){ @@ -387,7 +388,7 @@ static inline int su_cmp(union sockaddr_union* s1, union sockaddr_union* s2) /* gets the port number (host byte order) */ -static inline unsigned short su_getport(union sockaddr_union* su) +static inline unsigned short su_getport(const union sockaddr_union* su) { switch(su->s.sa_family){ case AF_INET:
14 years, 3 months
1
0
0
0
git:master: core: use const char*/str* for hash functions
by Andrei Pelinescu-Onciul
Module: sip-router Branch: master Commit: e8ef6f9a86e14e50634a8bae6db0b0e164cda917 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e8ef6f9…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org> Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org> Date: Thu Aug 26 21:40:45 2010 +0200 core: use const char*/str* for hash functions --- hashes.h | 25 +++++++++++++------------ str_hash.h | 2 +- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/hashes.h b/hashes.h index 58debe4..e6b5f7f 100644 --- a/hashes.h +++ b/hashes.h @@ -83,7 +83,7 @@ /* "raw" 2 strings hash * returns an unsigned int (which you can use modulo table_size as hash value) */ -inline static unsigned int get_hash2_raw(str* key1, str* key2) +inline static unsigned int get_hash2_raw(const str* key1, const str* key2) { char* p; register unsigned v; @@ -101,9 +101,9 @@ inline static unsigned int get_hash2_raw(str* key1, str* key2) /* "raw" 1 string hash * returns an unsigned int (which you can use modulo table_size as hash value) */ -inline static unsigned int get_hash1_raw(char* s, int len) +inline static unsigned int get_hash1_raw(const char* s, int len) { - char* p; + const char* p; register unsigned v; register unsigned h; @@ -148,9 +148,9 @@ inline static unsigned int get_hash1_raw(char* s, int len) /* a little slower than get_hash1_raw() , but better distribution for * numbers and about the same for strings */ -inline static unsigned int get_hash1_raw2(char* s, int len) +inline static unsigned int get_hash1_raw2(const char* s, int len) { - char* p; + const char* p; register unsigned v; register unsigned h; @@ -165,7 +165,7 @@ inline static unsigned int get_hash1_raw2(char* s, int len) /* "raw" 2 strings hash optimized for numeric strings (see above) * returns an unsigned int (which you can use modulo table_size as hash value) */ -inline static unsigned int get_hash2_raw2(str* key1, str* key2) +inline static unsigned int get_hash2_raw2(const str* key1, const str* key2) { char* p; register unsigned v; @@ -184,7 +184,7 @@ inline static unsigned int get_hash2_raw2(str* key1, str* key2) * insensitive) * returns an unsigned int (which you can use modulo table_size as hash value) */ -inline static unsigned int get_hash2_case_raw(str* key1, str* key2) +inline static unsigned int get_hash2_case_raw(const str* key1, const str* key2) { char* p; register unsigned v; @@ -202,9 +202,9 @@ inline static unsigned int get_hash2_case_raw(str* key1, str* key2) /* "raw" 1 string case insensitive hash * returns an unsigned int (which you can use modulo table_size as hash value) */ -inline static unsigned int get_hash1_case_raw(char* s, int len) +inline static unsigned int get_hash1_case_raw(const char* s, int len) { - char* p; + const char* p; register unsigned v; register unsigned h; @@ -218,9 +218,9 @@ inline static unsigned int get_hash1_case_raw(char* s, int len) /* same as get_hash1_raw2, but case insensitive and slower * returns an unsigned int (which you can use modulo table_size as hash value) */ -inline static unsigned int get_hash1_case_raw2(char* s, int len) +inline static unsigned int get_hash1_case_raw2(const char* s, int len) { - char* p; + const char* p; register unsigned v; register unsigned h; @@ -236,7 +236,8 @@ inline static unsigned int get_hash1_case_raw2(char* s, int len) * same as get_hash2_raw2 but case insensitive and slower * returns an unsigned int (which you can use modulo table_size as hash value) */ -inline static unsigned int get_hash2_case_raw2(str* key1, str* key2) +inline static unsigned int get_hash2_case_raw2(const str* key1, + const str* key2) { char* p; register unsigned v; diff --git a/str_hash.h b/str_hash.h index 3c0e17c..1de9748 100644 --- a/str_hash.h +++ b/str_hash.h @@ -96,7 +96,7 @@ inline static void str_hash_add(struct str_hash_table* ht, inline static struct str_hash_entry* str_hash_get(struct str_hash_table* ht, - char* key, int len) + const char* key, int len) { int h; struct str_hash_entry* e;
14 years, 3 months
1
0
0
0
git:master: nat_traversal(k): register stats only ifdef STATISTICS
by Andrei Pelinescu-Onciul
Module: sip-router Branch: master Commit: b3c6ac1339901e83fcec6f689c0f007f69a101b4 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b3c6ac1…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org> Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org> Date: Thu Aug 26 21:30:44 2010 +0200 nat_traversal(k): register stats only ifdef STATISTICS --- modules_k/nat_traversal/nat_traversal.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/modules_k/nat_traversal/nat_traversal.c b/modules_k/nat_traversal/nat_traversal.c index 3e90117..559fb49 100644 --- a/modules_k/nat_traversal/nat_traversal.c +++ b/modules_k/nat_traversal/nat_traversal.c @@ -260,6 +260,7 @@ static pv_export_t pvars[] = { {{0, 0}, 0, 0, 0, 0, 0, 0, 0} }; +#ifdef STATISTICS static stat_export_t statistics[] = { {"keepalive_endpoints", STAT_NO_RESET, &keepalive_endpoints}, {"registered_endpoints", STAT_NO_RESET, ®istered_endpoints}, @@ -267,6 +268,7 @@ static stat_export_t statistics[] = { {"dialog_endpoints", STAT_NO_RESET, &dialog_endpoints}, {0, 0, 0} }; +#endif struct module_exports exports = { "nat_traversal", // module name @@ -1785,11 +1787,13 @@ mod_init(void) keepalive_params.callid_counter = rand(); keepalive_params.from_tag = rand(); +#ifdef STATISTICS // we need the statistics initialized before restoring the keepalive state if (register_module_stats(exports.name, statistics) < 0) { LM_ERR("failed to initialize module statistics\n"); return -1; } +#endif /*STATISTICS*/ // create hash table to hold NAT contacts nat_table = HashTable_new();
14 years, 3 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
...
35
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
Results per page:
10
25
50
100
200