Module: sip-router
Branch: master
Commit: ffca34a67b64079cf66a0d4c0cd5419fff3f2255
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ffca34a…
Author: Marius Zbihlei <marius.zbihlei(a)1and1.ro>
Committer: Marius Zbihlei <marius.zbihlei(a)1and1.ro>
Date: Mon Oct 26 13:37:43 2009 +0200
Fixed avpops avp_db_store as before no state was used and it caused to loop endessly.
---
modules/avpops/avpops_impl.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/modules/avpops/avpops_impl.c b/modules/avpops/avpops_impl.c
index c6fa543..ab0ec91 100644
--- a/modules/avpops/avpops_impl.c
+++ b/modules/avpops/avpops_impl.c
@@ -659,13 +659,14 @@ int ops_dbstore_avps (struct sip_msg* msg, struct fis_param *sp,
/* set uuid/(username and domain) fields */
n =0 ;
-
+ memset(&st, 0, sizeof(struct search_state));
+ int counter = 1;
if ((dbp->a.opd&AVPOPS_VAL_NONE)==0)
{
/* avp name is known ->set it and its type */
store_vals[1].val.str_val = dbp->sa; /*attr name*/
- avp = search_first_avp( name_type, avp_name, &i_s, 0);
- for( ; avp; avp=search_first_avp( name_type, avp_name, &i_s, &st))
+ avp = search_first_avp( name_type, avp_name, &i_s, &st);
+ for( ; avp; avp=search_next_avp( &st, &i_s))
{
/* don't insert avps which were loaded */
if (avp->flags&AVP_IS_IN_DB)