| 954 | |
| 955 | |
| 956 | static int remove_body_part_f(struct sip_msg *msg, void *type, void *revert) |
| 957 | { |
| 958 | struct sip_msg_body * b; |
| 959 | struct body_part * p; |
| 960 | int deleted = 0; |
| 961 | |
| 962 | if (parse_sip_body(msg)<0 || (b=msg->body)==NULL) { |
| 963 | LM_DBG("no body found\n"); |
| 964 | return -1; |
| 965 | } |
| 966 | |
| 967 | p = &b->first; |
| 968 | deleted = -1; |
| 969 | |
| 970 | for ( p=&b->first ; p ; p=p->next) { |
| 971 | |
| 972 | if ( (type==NULL) || ( !revert && (p->mime==((int)(long)type)) ) |
| 973 | || ( revert && (p->mime!=((int)(long)type)) ) ) { |
| 974 | delete_body_part( msg, p); |
| 975 | deleted = 1; |
| 976 | } |
| 977 | |
| 978 | } |
| 979 | |
| 980 | return deleted; |
| 981 | } |
| 982 | |
| 983 | /* |
| 984 | * Function to add a new body |
nothing calls this directly
no test coverage detected