... | ... |
@@ -3,6 +3,13 @@ Release notes for SIP Express Router (ser) |
3 | 3 |
|
4 | 4 |
$Id$ |
5 | 5 |
|
6 |
+0.8.12 changes |
|
7 |
+ |
|
8 |
+texops: |
|
9 |
+ - subst('s/re/repl/flags') support |
|
10 |
+ |
|
11 |
+ |
|
12 |
+ |
|
6 | 13 |
*********************************************** |
7 | 14 |
* Changes introduced in 0.8.11 |
8 | 15 |
*********************************************** |
... | ... |
@@ -11,6 +11,8 @@ $Id$ |
11 | 11 |
- port receive.c pre_script_cb fix from stable |
12 | 12 |
- extend alias to include port numbers : |
13 | 13 |
something like alias= foo1.bar:5080 foo2.bar foo3.bar:* |
14 |
+- extend listen and alias to include port numbers and protocol: |
|
15 |
+ tcp foo.bar:5063, udp foo.bar:5062, foo2.bar |
|
14 | 16 |
|
15 | 17 |
release: |
16 | 18 |
- change tcp timeouts to 2 or 3 min? |
... | ... |
@@ -451,7 +451,8 @@ error: |
451 | 451 |
|
452 | 452 |
|
453 | 453 |
|
454 |
-/* return the substitution result in a str, input must be 0 term */ |
|
454 |
+/* returns the substitution result in a str, input must be 0 term |
|
455 |
+ * 0 on no match or malloc error */ |
|
455 | 456 |
str* subst_str(char *input, struct sip_msg* msg, struct subst_expr* se) |
456 | 457 |
{ |
457 | 458 |
str* res; |
... | ... |
@@ -468,14 +469,23 @@ str* subst_str(char *input, struct sip_msg* msg, struct subst_expr* se) |
468 | 469 |
len=strlen(input); |
469 | 470 |
end=input+len; |
470 | 471 |
lst=subst_run(se, input, msg); |
471 |
- for (l=lst; l; l=l->next) |
|
472 |
+ if (lst==0){ |
|
473 |
+ DBG("subst_str: no match\n"); |
|
474 |
+ return 0; |
|
475 |
+ } |
|
476 |
+ DBG("subst_str: orig len: %d\n", len); |
|
477 |
+ for (l=lst; l; l=l->next){ |
|
478 |
+ DBG("subst_str: len+=%d (size=%d)\n", l->rpl.len-l->size, l->size ); |
|
472 | 479 |
len+=(int)(l->rpl.len)-l->size; |
480 |
+ } |
|
481 |
+ DBG("subst_str: new len: %d\n", len); |
|
473 | 482 |
res=pkg_malloc(sizeof(str)); |
474 | 483 |
if (res==0){ |
475 | 484 |
LOG(L_ERR, "ERROR: subst_str: mem. allocation error\n"); |
476 | 485 |
goto error; |
477 | 486 |
} |
478 |
- res->s=pkg_malloc(len); |
|
487 |
+ res->s=pkg_malloc(len+1); /* space for null termination */ |
|
488 |
+ res->s[len]=0; |
|
479 | 489 |
if (res->s==0){ |
480 | 490 |
LOG(L_ERR, "ERROR: subst_str: mem. allocation error (res->s)\n"); |
481 | 491 |
goto error; |
... | ... |
@@ -487,8 +497,8 @@ str* subst_str(char *input, struct sip_msg* msg, struct subst_expr* se) |
487 | 497 |
p=input; |
488 | 498 |
for(l=lst; l; l=l->next){ |
489 | 499 |
size=l->offset+input-p; |
490 |
- memcpy(dest, p, size); |
|
491 |
- p+=size; |
|
500 |
+ memcpy(dest, p, size); /* copy till offset */ |
|
501 |
+ p+=size + l->size; /* skip l->size bytes */ |
|
492 | 502 |
dest+=size; |
493 | 503 |
if (l->rpl.len){ |
494 | 504 |
memcpy(dest, l->rpl.s, l->rpl.len); |
... | ... |
@@ -170,7 +170,7 @@ static inline int version_control(void *handle, char *path) |
170 | 170 |
} |
171 | 171 |
if (strcmp(VERSION,*m_ver)==0) |
172 | 172 |
return 1; |
173 |
- LOG(L_ERR, "ERRO: module version mismatch for %s; " |
|
173 |
+ LOG(L_ERR, "ERROR: module version mismatch for %s; " |
|
174 | 174 |
"core: %s; module: %s\n", path, VERSION, *m_ver ); |
175 | 175 |
return 0; |
176 | 176 |
} |