| 149 | |
| 150 | |
| 151 | char *build_cancel(struct cell *Trans,unsigned int branch, |
| 152 | unsigned int *len ) |
| 153 | { |
| 154 | str method = str_init(CANCEL); |
| 155 | str reason = str_init(CANCEL_REASON_200); |
| 156 | str *extra = NULL; |
| 157 | |
| 158 | /* add the reason hdr, as per RFC 3326 */ |
| 159 | if (is_invite(Trans) && Trans->uas.status==200) { |
| 160 | extra = &reason; |
| 161 | } else if (_extra_cancel_hdrs.s) { |
| 162 | extra = &_extra_cancel_hdrs; |
| 163 | } |
| 164 | return build_local( Trans, branch, &method, extra, |
| 165 | NULL /*reply*/ , len ); |
| 166 | /* ^^^^ when CANCELing, there are 0 chances to have a reply stored into |
| 167 | * transaction ; set it NULL to avoid using the temporary stored reply |
| 168 | * (by t_should_relay_response) which may lead into races ( building the |
| 169 | * cancel versus handling a final response in a different process )*/ |
| 170 | } |
| 171 | |
| 172 |
no test coverage detected