| 169 | } |
| 170 | |
| 171 | static apr_status_t req_set_body(md_http_request_t *req, const char *content_type, |
| 172 | apr_bucket_brigade *body, apr_off_t body_len, |
| 173 | int detect_len) |
| 174 | { |
| 175 | apr_status_t rv = APR_SUCCESS; |
| 176 | |
| 177 | if (body && detect_len) { |
| 178 | rv = apr_brigade_length(body, 1, &body_len); |
| 179 | if (rv != APR_SUCCESS) { |
| 180 | return rv; |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | req->body = body; |
| 185 | req->body_len = body? body_len : 0; |
| 186 | if (content_type) { |
| 187 | apr_table_set(req->headers, "Content-Type", content_type); |
| 188 | } |
| 189 | else { |
| 190 | apr_table_unset(req->headers, "Content-Type"); |
| 191 | } |
| 192 | return rv; |
| 193 | } |
| 194 | |
| 195 | static apr_status_t req_set_body_data(md_http_request_t *req, const char *content_type, |
| 196 | const md_data_t *body) |
no outgoing calls
no test coverage detected