Browse code

acc: set again the type of db vals

- work properly when nullable modparam is set and var can be null on
some transactions

Daniel-Constantin Mierla authored on 13/11/2021 19:31:38
Showing 1 changed files
... ...
@@ -466,7 +466,9 @@ int acc_db_request( struct sip_msg *rq)
466 466
 			LM_DBG("attr[%d] is NULL\n", i);
467 467
 			VAL_NULL(db_vals + i) = 1;
468 468
 		} else {
469
-			LM_DBG("attr[%d] is STR\n", i);
469
+			LM_DBG("attr[%d] is STR len=%d\n", i, val_arr[i].len);
470
+			VAL_NULL(db_vals+i) = 0;
471
+			VAL_TYPE(db_vals+i)=DB1_STR;
470 472
 			VAL_STR(db_vals+i) = val_arr[i];
471 473
 		}
472 474
 	}
... ...
@@ -502,6 +504,8 @@ int acc_db_request( struct sip_msg *rq)
502 504
 			if (acc_extra_nullable == 1 && type_arr[i] == TYPE_NULL) {
503 505
 					VAL_NULL(db_vals + i) = 1;
504 506
 				} else {
507
+					VAL_NULL(db_vals+i) = 0;
508
+					VAL_TYPE(db_vals+i)=DB1_STR;
505 509
 					VAL_STR(db_vals+i)=val_arr[i];
506 510
 				}
507 511
 			}