| 626 | |
| 627 | |
| 628 | static int fixup_phostport2proxy(void** param) |
| 629 | { |
| 630 | struct proxy_l *proxy; |
| 631 | str s = *(str*)*param; |
| 632 | int port; |
| 633 | int proto; |
| 634 | str host; |
| 635 | |
| 636 | if (s.s == NULL || s.len == 0) { |
| 637 | LM_CRIT("empty parameter\n"); |
| 638 | return E_UNSPEC; |
| 639 | } |
| 640 | |
| 641 | if (parse_phostport(s.s, s.len, &host.s, &host.len, &port, &proto)!=0){ |
| 642 | LM_CRIT("invalid parameter <%.*s>\n",s.len, s.s); |
| 643 | return E_UNSPEC; |
| 644 | } |
| 645 | |
| 646 | proxy = mk_proxy( &host, port, proto, 0); |
| 647 | if (proxy==0) { |
| 648 | LM_ERR("failed to resolve <%.*s>\n", host.len, host.s ); |
| 649 | return ser_error; |
| 650 | } |
| 651 | *(param)=proxy; |
| 652 | return 0; |
| 653 | } |
| 654 | |
| 655 | static int fixup_free_proxy(void **param) |
| 656 | { |
nothing calls this directly
no test coverage detected