| 3828 | |
| 3829 | |
| 3830 | static int pv_set_force_sock(struct sip_msg* msg, pv_param_t *param, |
| 3831 | int op, pv_value_t *val) |
| 3832 | { |
| 3833 | const struct socket_info *si; |
| 3834 | |
| 3835 | if(msg==NULL || param==NULL) |
| 3836 | { |
| 3837 | LM_ERR("bad parameters\n"); |
| 3838 | return -1; |
| 3839 | } |
| 3840 | |
| 3841 | if(val==NULL) |
| 3842 | { |
| 3843 | msg->force_send_socket = NULL; |
| 3844 | return 0; |
| 3845 | } |
| 3846 | |
| 3847 | if(!(val->flags&PV_VAL_STR) || val->rs.len<=0) |
| 3848 | { |
| 3849 | LM_ERR("str value required to set the force send sock\n"); |
| 3850 | goto error; |
| 3851 | } |
| 3852 | |
| 3853 | si = parse_sock_info(&val->rs); |
| 3854 | if (si!=NULL) |
| 3855 | { |
| 3856 | msg->force_send_socket = si; |
| 3857 | } else { |
| 3858 | LM_WARN("no socket found to match [%.*s]\n", |
| 3859 | val->rs.len, val->rs.s); |
| 3860 | } |
| 3861 | |
| 3862 | return 0; |
| 3863 | error: |
| 3864 | return -1; |
| 3865 | } |
| 3866 | |
| 3867 | |
| 3868 | /********* end PV set functions *********/ |
nothing calls this directly
no test coverage detected