@@ -73,24 +73,9 @@ extern tag_t* leg_tags;
73
73
74
74
static const str tag_delim = str_init ("->" );
75
75
76
- /* here we copy the strings returned by int2str (which uses a static buffer) */
77
- static char int_buf [MAX_ACC_BUFS ][INT2STR_MAX_LEN * MAX_ACC_INT_BUF ];
78
-
79
- static char * static_detector [2 ] = {NULL ,NULL };
80
-
81
76
typedef struct acc_extra * * (* str2bkend )(str * );
82
77
83
78
84
- void init_acc_extra (void )
85
- {
86
- int i ;
87
- /* ugly trick to get the address of the static buffer */
88
- static_detector [0 ] = int2str ( (unsigned long )3 , & i ) + i ;
89
- /* remember directly the static buffer returned by ip_addr2a()*/
90
- static_detector [1 ] = _ip_addr_A_buffs [0 ];
91
- }
92
-
93
-
94
79
/*
95
80
* insert a tag int the tags vector
96
81
* @param tag to insert(str value)
@@ -528,14 +513,13 @@ int extra2int( struct acc_extra *extra, int *attrs )
528
513
int extra2strar ( extra_value_t * values , str * val_arr , int idx )
529
514
{
530
515
int n ;
531
- int r ;
532
516
533
517
if (idx < 0 || idx > MAX_ACC_BUFS - 2 /* last one is for legs */ ) {
534
518
LM_ERR ("Invalid buffer index %d - maximum %d\n" , idx , MAX_ACC_BUFS - 2 );
535
519
return 0 ;
536
520
}
537
521
538
- for ( n = 0 , r = 0 ; n < extra_tgs_len ; n ++ ) {
522
+ for ( n = 0 ; n < extra_tgs_len ; n ++ ) {
539
523
/* get the value */
540
524
/* check for overflow */
541
525
if (n == MAX_ACC_EXTRA ) {
@@ -549,15 +533,7 @@ int extra2strar( extra_value_t* values, str *val_arr, int idx)
549
533
val_arr [n ].len = 0 ;
550
534
} else {
551
535
/* set the value into the acc buffer */
552
- if (values [n ].value .s + values [n ].value .len == static_detector [0 ] ||
553
- values [n ].value .s == static_detector [1 ]) {
554
- val_arr [n ].s = int_buf [idx ] + r * INT2STR_MAX_LEN ;
555
- val_arr [n ].len = values [n ].value .len ;
556
- memcpy (val_arr [n ].s , values [n ].value .s , values [n ].value .len );
557
- r ++ ;
558
- } else {
559
- val_arr [n ] = values [n ].value ;
560
- }
536
+ val_arr [n ] = values [n ].value ;
561
537
}
562
538
}
563
539
0 commit comments