| 209 | } |
| 210 | |
| 211 | static apr_status_t req_create(md_http_request_t **preq, md_http_t *http, |
| 212 | const char *method, const char *url, |
| 213 | struct apr_table_t *headers) |
| 214 | { |
| 215 | md_http_request_t *req; |
| 216 | apr_pool_t *pool; |
| 217 | apr_status_t rv; |
| 218 | |
| 219 | rv = apr_pool_create(&pool, http->pool); |
| 220 | if (rv != APR_SUCCESS) { |
| 221 | return rv; |
| 222 | } |
| 223 | apr_pool_tag(pool, "md_http_req"); |
| 224 | |
| 225 | req = apr_pcalloc(pool, sizeof(*req)); |
| 226 | req->pool = pool; |
| 227 | req->id = http->next_id++; |
| 228 | req->bucket_alloc = http->bucket_alloc; |
| 229 | req->http = http; |
| 230 | req->method = method; |
| 231 | req->url = url; |
| 232 | req->headers = headers? apr_table_copy(req->pool, headers) : apr_table_make(req->pool, 5); |
| 233 | req->resp_limit = http->resp_limit; |
| 234 | req->user_agent = http->user_agent; |
| 235 | req->proxy_url = http->proxy_url; |
| 236 | req->timeout = http->timeout; |
| 237 | req->ca_file = http->ca_file; |
| 238 | req->unix_socket_path = http->unix_socket_path; |
| 239 | *preq = req; |
| 240 | return rv; |
| 241 | } |
| 242 | |
| 243 | void md_http_req_destroy(md_http_request_t *req) |
| 244 | { |
no outgoing calls
no test coverage detected