Răsfoiți Sursa

Fixed avpops avp_db_store as before no state was used and it caused to loop endessly.

Marius Zbihlei 16 ani în urmă
părinte
comite
ffca34a67b
1 a modificat fișierele cu 4 adăugiri și 3 ștergeri
  1. 4 3
      modules/avpops/avpops_impl.c

+ 4 - 3
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)