| 403 | } |
| 404 | |
| 405 | static int append_var(char *name, char *value, int len, struct hf_wrapper **list) |
| 406 | { |
| 407 | struct hf_wrapper *w; |
| 408 | |
| 409 | w=(struct hf_wrapper *)pkg_malloc(sizeof(struct hf_wrapper)); |
| 410 | if (!w) { |
| 411 | LM_ERR("ran out of pkg mem\n"); |
| 412 | return 0; |
| 413 | } |
| 414 | memset(w, 0, sizeof(struct hf_wrapper)); |
| 415 | w->var_type=W_AV; |
| 416 | w->u.av.attr.s=name; |
| 417 | w->u.av.attr.len=strlen(name); |
| 418 | w->u.av.val.s=value; |
| 419 | /* NULL strings considered empty, if len unknown, calculate it now */ |
| 420 | w->u.av.val.len= value==0?0:(len==0? strlen(value) : len); |
| 421 | w->next_other=*list; |
| 422 | *list=w; |
| 423 | return 1; |
| 424 | } |
| 425 | |
| 426 | static int append_fixed_vars(struct sip_msg *msg, struct hf_wrapper **list) |
| 427 | { |