Module: sip-router
Branch: sr_3.0
Commit: bbf9bcd1ca6a7f75f3b9f7a82c9ed606a4b990db
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=bbf9bcd1ca6a7f75f3b9f7a82c9ed606a4b990db

Author: Marius Zbihlei <[email protected]>
Committer: Henning Westerholt <[email protected]>
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.
(cherry picked from commit ffca34a67b64079cf66a0d4c0cd5419fff3f2255)

---

 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)


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to