| 614 | } |
| 615 | |
| 616 | static void md_curl_req_cleanup(md_http_request_t *req) |
| 617 | { |
| 618 | md_curl_internals_t *internals = req->internals; |
| 619 | if (internals) { |
| 620 | if (internals->curl) { |
| 621 | CURL *curl = md_http_get_impl_data(req->http); |
| 622 | if (curl == internals->curl) { |
| 623 | /* NOP: we have this curl at the md_http_t already */ |
| 624 | } |
| 625 | else if (!curl) { |
| 626 | /* no curl at the md_http_t yet, install this one */ |
| 627 | md_log_perror(MD_LOG_MARK, MD_LOG_TRACE3, 0, req->pool, "register curl instance at http"); |
| 628 | md_http_set_impl_data(req->http, internals->curl); |
| 629 | } |
| 630 | else { |
| 631 | /* There already is a curl at the md_http_t and it's not this one. */ |
| 632 | curl_easy_cleanup(internals->curl); |
| 633 | } |
| 634 | } |
| 635 | if (internals->req_hdrs) curl_slist_free_all(internals->req_hdrs); |
| 636 | req->internals = NULL; |
| 637 | } |
| 638 | } |
| 639 | |
| 640 | static void md_curl_cleanup(md_http_t *http, apr_pool_t *pool) |
| 641 | { |
nothing calls this directly
no test coverage detected