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
May 2011
----- 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
28 participants
166 discussions
Start a n
N
ew thread
git:master: htable: init tables directly in shm
by Daniel-Constantin Mierla
Module: sip-router Branch: master Commit: eef79d7f5e0fcacbf4a01232cd5039e8a6a1b464 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=eef79d7…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Sat Apr 30 12:10:14 2011 +0200 htable: init tables directly in shm - initial developed version didn't have access to shared memory during parameter setting, starting with 3.0 shm is initialized before module parameter section, thus code was simplified getting rid of the temporary clone in pkg - helper structure and functions to store and parse 'key=>value' strings added - parsing of 'htable' parameter format was simplified reusing the parse_params() function --- modules_k/htable/ht_api.c | 251 ++++++++++++++++++++++++--------------------- modules_k/htable/ht_api.h | 4 +- modules_k/htable/htable.c | 2 +- 3 files changed, 136 insertions(+), 121 deletions(-) diff --git a/modules_k/htable/ht_api.c b/modules_k/htable/ht_api.c index fe9a66e..31f8543 100644 --- a/modules_k/htable/ht_api.c +++ b/modules_k/htable/ht_api.c @@ -24,7 +24,9 @@ #include "../../mem/shm_mem.h" #include "../../mem/mem.h" +#include "../../shm_init.h" #include "../../dprint.h" +#include "../../parser/parse_param.h" #include "../../lib/kcore/hash_func.h" #include "../../ut.h" #include "../../re.h" @@ -38,8 +40,104 @@ ht_t *_ht_root = NULL; -ht_t *_ht_pkg_root = NULL; +typedef struct _keyvalue { + str key; + str value; + int type; + union { + param_t *params; + } u; +} keyvalue_t; + + +#define KEYVALUE_TYPE_NONE 0 +#define KEYVALUE_TYPE_PARAMS 1 + +/** + * parse a string like: 'key=>value' + * - the value can be parameter list: 'name1=value1;...;nameX=valueX' + */ +int keyvalue_parse_str(str *data, int type, keyvalue_t *res) +{ + char *p; + str s; + str in; + param_hooks_t phooks; + + if(data==NULL || data->s==NULL || data->len<=0 || res==NULL) + { + LM_ERR("invalid parameters\n"); + return -1; + } + + memset(res, 0, sizeof(keyvalue_t)); + + in.s = data->s; + in.len = data->len; + + p = in.s; + while(p<in.s+in.len && (*p==' ' || *p=='\t' || *p=='\n' || *p=='\r')) + p++; + if(p>in.s+in.len || *p=='\0') + goto error; + res->key.s = p; + while(p < in.s + in.len) + { + if(*p=='=' || *p==' ' || *p=='\t' || *p=='\n' || *p=='\r') + break; + p++; + } + if(p>in.s+in.len || *p=='\0') + goto error; + res->key.len = (int)(p - res->key.s); + if(*p!='=') + { + while(p<in.s+in.len && (*p==' ' || *p=='\t' || *p=='\n' || *p=='\r')) + p++; + if(p>in.s+in.len || *p=='\0' || *p!='=') + goto error; + } + p++; + if(*p!='>') + goto error; + p++; + while(p<in.s+in.len && (*p==' ' || *p=='\t' || *p=='\n' || *p=='\r')) + p++; + + s.s = p; + s.len = in.s + in.len - p; + res->value.s = s.s; + res->value.len = s.len; + res->type = type; + if(type==KEYVALUE_TYPE_PARAMS) + { + if(s.s[s.len-1]==';') + s.len--; + if (parse_params(&s, CLASS_ANY, &phooks, &res->u.params)<0) + { + LM_ERR("failed parsing params value\n"); + goto error; + } + } + return 0; +error: + LM_ERR("invalid input parameter [%.*s] at [%d]\n", in.len, in.s, + (int)(p-in.s)); + return -1; +} + +void keyvalue_destroy(keyvalue_t *res) +{ + if(res==NULL) + return; + if(res->type==KEYVALUE_TYPE_PARAMS) + { + if(res->u.params!=NULL) + free_params(res->u.params); + } + memset(res, 0, sizeof(keyvalue_t)); +} ht_cell_t* ht_cell_new(str *name, int type, int_str *val, unsigned int cellid) { @@ -86,7 +184,6 @@ int ht_cell_free(ht_cell_t *cell) return 0; } - int ht_cell_pkg_free(ht_cell_t *cell) { if(cell==NULL) @@ -95,6 +192,7 @@ int ht_cell_pkg_free(ht_cell_t *cell) return 0; } + ht_t* ht_get_table(str *name) { unsigned int htid; @@ -117,7 +215,7 @@ ht_t* ht_get_table(str *name) return NULL; } -int ht_pkg_init(str *name, int autoexp, str *dbtable, int size, int dbmode) +int ht_add_table(str *name, int autoexp, str *dbtable, int size, int dbmode) { unsigned int htid; ht_t *ht; @@ -125,7 +223,7 @@ int ht_pkg_init(str *name, int autoexp, str *dbtable, int size, int dbmode) htid = ht_compute_hash(name); /* does it exist */ - ht = _ht_pkg_root; + ht = _ht_root; while(ht!=NULL) { if(htid == ht->htid && name->len==ht->name.len @@ -137,10 +235,10 @@ int ht_pkg_init(str *name, int autoexp, str *dbtable, int size, int dbmode) ht = ht->next; } - ht = (ht_t*)pkg_malloc(sizeof(ht_t)); + ht = (ht_t*)shm_malloc(sizeof(ht_t)); if(ht==NULL) { - LM_ERR("no more pkg\n"); + LM_ERR("no more shared memory\n"); return -1; } memset(ht, 0, sizeof(ht_t)); @@ -157,35 +255,24 @@ int ht_pkg_init(str *name, int autoexp, str *dbtable, int size, int dbmode) ht->dbtable = *dbtable; ht->dbmode = dbmode; - ht->next = _ht_pkg_root; - _ht_pkg_root = ht; + ht->next = _ht_root; + _ht_root = ht; return 0; } -int ht_shm_init(void) +int ht_init_tables(void) { - ht_t *htp; - ht_t *htp0; ht_t *ht; int i; - htp = _ht_pkg_root; + ht = _ht_root; - while(htp) + while(ht) { - htp0 = htp->next; - ht = (ht_t*)shm_malloc(sizeof(ht_t)); - if(ht==NULL) - { - LM_ERR("no more shm\n"); - return -1; - } - memcpy(ht, htp, sizeof(ht_t)); - ht->entries = (ht_entry_t*)shm_malloc(ht->htsize*sizeof(ht_entry_t)); if(ht->entries==NULL) { - LM_ERR("no more shm.\n"); + LM_ERR("no more shm for [%.*s]\n", ht->name.len, ht->name.s); shm_free(ht); return -1; } @@ -195,7 +282,8 @@ int ht_shm_init(void) { if(lock_init(&ht->entries[i].lock)==0) { - LM_ERR("cannot initalize lock[%d]\n", i); + LM_ERR("cannot initalize lock[%d] in [%.*s]\n", i, + ht->name.len, ht->name.s); i--; while(i>=0) { @@ -208,12 +296,8 @@ int ht_shm_init(void) } } - ht->next = _ht_root; - _ht_root = ht; - pkg_free(htp); - htp = htp0; + ht = ht->next; } - _ht_pkg_root = NULL; return 0; } @@ -512,129 +596,60 @@ int ht_dbg(void) int ht_table_spec(char *spec) { + keyvalue_t kval; str name; str dbtable = {0, 0}; unsigned int autoexpire = 0; unsigned int size = 4; - int type = 0; unsigned int dbmode = 0; str in; str tok; - char *p; + param_t *pit=NULL; + if(!shm_initialized()) + { + LM_ERR("shared memory was not initialized\n"); + return -1; + } /* parse: name=>dbtable=abc;autoexpire=123;size=123*/ in.s = spec; in.len = strlen(in.s); - - p = in.s; - while(p<in.s+in.len && (*p==' ' || *p=='\t' || *p=='\n' || *p=='\r')) - p++; - if(p>in.s+in.len || *p=='\0') - goto error; - name.s = p; - while(p < in.s + in.len) - { - if(*p=='=' || *p==' ' || *p=='\t' || *p=='\n' || *p=='\r') - break; - p++; - } - if(p>in.s+in.len || *p=='\0') - goto error; - name.len = p - name.s; - if(*p!='=') - { - while(p<in.s+in.len && (*p==' ' || *p=='\t' || *p=='\n' || *p=='\r')) - p++; - if(p>in.s+in.len || *p=='\0' || *p!='=') - goto error; - } - p++; - if(*p!='>') - goto error; - p++; - while(p<in.s+in.len && (*p==' ' || *p=='\t' || *p=='\n' || *p=='\r')) - p++; - -next_token: - tok.s = p; - while(p < in.s + in.len) + if(keyvalue_parse_str(&in, KEYVALUE_TYPE_PARAMS, &kval)<0) { - if(*p=='=' || *p==' ' || *p=='\t' || *p=='\n' || *p=='\r') - break; - p++; + LM_ERR("failed parsing: %.*s\n", in.len, in.s); + return -1; } - if(p>in.s+in.len || *p=='\0') - goto error; - tok.len = p - tok.s; - if(tok.len==7 && strncmp(tok.s, "dbtable", 7)==0) - type = 1; - else if(tok.len==10 && strncmp(tok.s, "autoexpire", 10)==0) - type = 2; - else if(tok.len==4 && strncmp(tok.s, "size", 4)==0) - type = 3; - else if(tok.len==6 && strncmp(tok.s, "dbmode", 6)==0) - type = 4; - else goto error; + name = kval.key; - if(*p!='=') + for (pit = kval.u.params; pit; pit=pit->next) { - while(p<in.s+in.len && (*p==' ' || *p=='\t' || *p=='\n' || *p=='\r')) - p++; - if(p>in.s+in.len || *p=='\0' || *p!='=') - goto error; - } - p++; - while(p<in.s+in.len && (*p==' ' || *p=='\t' || *p=='\n' || *p=='\r')) - p++; - if(p>in.s+in.len || *p=='\0') - goto error; - tok.s = p; - while(p < in.s + in.len) - { - if(*p==';' || *p==' ' || *p=='\t' || *p=='\n' || *p=='\r') - break; - p++; - } - if(p>in.s+in.len || *p=='\0') - goto error; - tok.len = p - tok.s; - switch(type) - { - case 1: + tok = pit->body; + if(pit->name.len==7 && strncmp(pit->name.s, "dbtable", 7)==0) { dbtable = tok; LM_DBG("htable [%.*s] - dbtable [%.*s]\n", name.len, name.s, dbtable.len, dbtable.s); - break; - case 2: + } else if(pit->name.len==10 && strncmp(pit->name.s, "autoexpire", 10)==0) { if(str2int(&tok, &autoexpire)!=0) goto error; LM_DBG("htable [%.*s] - expire [%u]\n", name.len, name.s, autoexpire); - break; - case 3: + } else if(pit->name.len==4 && strncmp(pit->name.s, "size", 4)==0) { if(str2int(&tok, &size)!=0) goto error; LM_DBG("htable [%.*s] - size [%u]\n", name.len, name.s, size); - break; - case 4: + } else if(pit->name.len==6 && strncmp(pit->name.s, "dbmode", 6)==0) { if(str2int(&tok, &dbmode)!=0) goto error; LM_DBG("htable [%.*s] - dbmode [%u]\n", name.len, name.s, dbmode); - break; + } else { goto error; } } - while(p<in.s+in.len && (*p==';' || *p==' ' || *p=='\t' - || *p=='\n' || *p=='\r')) - p++; - if(p<in.s+in.len) - goto next_token; - return ht_pkg_init(&name, autoexpire, &dbtable, size, dbmode); + return ht_add_table(&name, autoexpire, &dbtable, size, dbmode); error: - LM_ERR("invalid htable parameter [%.*s] at [%d]\n", in.len, in.s, - (int)(p-in.s)); + LM_ERR("invalid htable parameter [%.*s]\n", in.len, in.s); return -1; } diff --git a/modules_k/htable/ht_api.h b/modules_k/htable/ht_api.h index 71c8e21..a55e6cd 100644 --- a/modules_k/htable/ht_api.h +++ b/modules_k/htable/ht_api.h @@ -66,8 +66,8 @@ typedef struct _ht_pv { pv_elem_t *pve; } ht_pv_t, *ht_pv_p; -int ht_pkg_init(str *name, int autoexp, str *dbtable, int size, int dbmode); -int ht_shm_init(void); +int ht_add_table(str *name, int autoexp, str *dbtable, int size, int dbmode); +int ht_init_tables(void); int ht_destroy(void); int ht_set_cell(ht_t *ht, str *name, int type, int_str *val, int mode); int ht_del_cell(ht_t *ht, str *name); diff --git a/modules_k/htable/htable.c b/modules_k/htable/htable.c index f7af1d9..461817f 100644 --- a/modules_k/htable/htable.c +++ b/modules_k/htable/htable.c @@ -144,7 +144,7 @@ static int mod_init(void) return -1; } - if(ht_shm_init()!=0) + if(ht_init_tables()!=0) return -1; ht_db_init_params();
13 years, 6 months
1
0
0
0
git:master: ratelimit: set macro to cast pointers diff to int
by Daniel-Constantin Mierla
Module: sip-router Branch: master Commit: 4e4e5359a16952a0a24838e1725774ea83a2dd92 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=4e4e535…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Sat Apr 30 10:21:07 2011 +0200 ratelimit: set macro to cast pointers diff to int --- modules/ratelimit/ratelimit.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ratelimit/ratelimit.c b/modules/ratelimit/ratelimit.c index 53ff559..2b34889 100644 --- a/modules/ratelimit/ratelimit.c +++ b/modules/ratelimit/ratelimit.c @@ -63,8 +63,8 @@ MODULE_VERSION */ #define RL_TIMER_INTERVAL 10 -#define RXLS(m, str, i) (m)[i].rm_eo - (m)[i].rm_so, (str) + (m)[i].rm_so -#define RXL(m, str, i) (m)[i].rm_eo - (m)[i].rm_so +#define RXLS(m, str, i) (int)((m)[i].rm_eo - (m)[i].rm_so), (str) + (m)[i].rm_so +#define RXL(m, str, i) (int)((m)[i].rm_eo - (m)[i].rm_so) #define RXS(m, str, i) (str) + (m)[i].rm_so static inline int str_cmp(const str * a, const str * b);
13 years, 6 months
1
0
0
0
git:master: p_usrloc: casted parameter to int to get rid of compile warning
by Daniel-Constantin Mierla
Module: sip-router Branch: master Commit: d98db9d2b952958d08c8668c89490adc028c8013 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d98db9d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Sat Apr 30 10:22:04 2011 +0200 p_usrloc: casted parameter to int to get rid of compile warning --- modules_k/p_usrloc/ul_db_handle.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/modules_k/p_usrloc/ul_db_handle.c b/modules_k/p_usrloc/ul_db_handle.c index 471c308..3216426 100644 --- a/modules_k/p_usrloc/ul_db_handle.c +++ b/modules_k/p_usrloc/ul_db_handle.c @@ -617,7 +617,8 @@ int load_data(db_func_t * dbf, db1_con_t * dbh, ul_db_handle_t * handle, int id) goto ret; } if(strlen((char *)VAL_STRING(ROW_VALUES(row) + 1)) >= (UL_DB_URL_LEN - 1)){ - LM_ERR("weird: very large URL (%d Bytes)\n", strlen((char *)VAL_STRING(ROW_VALUES(row) + 1)) + 1); + LM_ERR("weird: very large URL (%d Bytes)\n", + (int)(strlen((char *)VAL_STRING(ROW_VALUES(row) + 1)) + 1)); ret = -1; goto ret; }
13 years, 6 months
1
0
0
0
git:master: core: fixed compile warnings on mac os x
by Daniel-Constantin Mierla
Module: sip-router Branch: master Commit: c769479936c3671c4ad9fa4d9609c5b03a8a3191 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c769479…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Sat Apr 30 10:20:42 2011 +0200 core: fixed compile warnings on mac os x --- io_wait.h | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/io_wait.h b/io_wait.h index 7220dd5..b7ae925 100644 --- a/io_wait.h +++ b/io_wait.h @@ -283,9 +283,9 @@ retry2: io_wait_loop_kqueue EV_ERROR case */ if (unlikely(!(errno == EBADF || errno == ENOENT))) BUG("kq_ev_change: kevent flush changes failed:" - " (unexpected error) %s [%d] (%d/%d)\n", + " (unexpected error) %s [%d] (%d/%lu)\n", strerror(errno), errno, - r, h->kq_nchanges); + r, (unsigned long)h->kq_nchanges); continue; /* skip over it */ } } @@ -1219,9 +1219,10 @@ again: BUG("io_wait_loop_kqueue: unknown filter: kqueue: event " "%d/%d: fd=%d, filter=%d, flags=0x%x, fflags=0x%x," " data=%lx, udata=%lx\n", - r, n, h->kq_array[r].ident, h->kq_array[r].filter, + r, n, (int)h->kq_array[r].ident, (int)h->kq_array[r].filter, h->kq_array[r].flags, h->kq_array[r].fflags, - (long)h->kq_array[r].data, (long)h->kq_array[r].udata); + (unsigned long)h->kq_array[r].data, + (unsigned long)h->kq_array[r].udata); } } }
13 years, 6 months
1
0
0
0
git:master: pv: fixed compile warning
by Daniel-Constantin Mierla
Module: sip-router Branch: master Commit: dbbe2521314a92fa7b76787e815a4de6bb8480c0 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=dbbe252…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Sat Apr 30 09:55:22 2011 +0200 pv: fixed compile warning - solve: dereferencing type-punned pointer will break strict-aliasing rules --- modules_k/pv/pv_trans.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/modules_k/pv/pv_trans.c b/modules_k/pv/pv_trans.c index 4cf2555..8cb59f4 100644 --- a/modules_k/pv/pv_trans.c +++ b/modules_k/pv/pv_trans.c @@ -71,6 +71,7 @@ int tr_eval_string(struct sip_msg *msg, tr_param_t *tp, int subtype, char *p, *s; str st, st2; pv_value_t v, w; + void *vp; if(val==NULL || val->flags&PV_VAL_NULL) return -1; @@ -539,7 +540,8 @@ int tr_eval_string(struct sip_msg *msg, tr_param_t *tp, int subtype, j = 0; max = val->rs.len - st.len; while (i < val->rs.len && j < TR_BUFFER_SIZE) { - if (i <= max && val->rs.s[i] == st.s[0] && strncmp(val->rs.s+i, st.s, st.len) == 0) { + if (i <= max && val->rs.s[i] == st.s[0] + && strncmp(val->rs.s+i, st.s, st.len) == 0) { strncpy(_tr_buffer+j, st2.s, st2.len); i += st.len; j += st2.len; @@ -557,7 +559,8 @@ int tr_eval_string(struct sip_msg *msg, tr_param_t *tp, int subtype, LM_ERR("timeformat invalid parameters\n"); return -1; } - if(!(val->flags&PV_VAL_INT) && (str2int(&val->rs, (unsigned int*) &val->ri)!=0)) + if(!(val->flags&PV_VAL_INT) && (str2int(&val->rs, + (unsigned int*) &val->ri)!=0)) { LM_ERR("value is not numeric\n"); return -1; @@ -582,7 +585,9 @@ int tr_eval_string(struct sip_msg *msg, tr_param_t *tp, int subtype, } memcpy(s, st.s, st.len); s[st.len] = '\0'; - val->rs.len = strftime(_tr_buffer, TR_BUFFER_SIZE-1, s, localtime((time_t*) &val->ri)); + vp = (void*)&val->ri; + val->rs.len = strftime(_tr_buffer, TR_BUFFER_SIZE-1, s, + localtime((time_t*)vp)); pkg_free(s); val->flags = PV_VAL_STR; val->rs.s = _tr_buffer;
13 years, 6 months
1
0
0
0
git:master: p_usrloc: include <time.h> to make compiler happy on mac os x
by Daniel-Constantin Mierla
Module: sip-router Branch: master Commit: 370b7020fc9b1b22e5ecce323f311a5daee5d958 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=370b702…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Sat Apr 30 09:57:44 2011 +0200 p_usrloc: include <time.h> to make compiler happy on mac os x --- modules_k/p_usrloc/ul_check.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/modules_k/p_usrloc/ul_check.h b/modules_k/p_usrloc/ul_check.h index f8fe10a..1e461a3 100644 --- a/modules_k/p_usrloc/ul_check.h +++ b/modules_k/p_usrloc/ul_check.h @@ -22,6 +22,8 @@ #ifndef SP_P_USRLOC_CHECK_H #define SP_P_USRLOC_CHECK_H +#include <time.h> + #include "../../lock_ops.h" struct check_data {
13 years, 6 months
1
0
0
0
← Newer
1
...
14
15
16
17
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Results per page:
10
25
50
100
200