MCPcopy Create free account
hub / github.com/apache/httpd / md_curl_perform

Function md_curl_perform

modules/md/md_curl.c:400–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398}
399
400static apr_status_t md_curl_perform(md_http_request_t *req)
401{
402 apr_status_t rv = APR_SUCCESS;
403 CURLcode curle;
404 md_curl_internals_t *internals;
405 long l;
406
407 if (APR_SUCCESS != (rv = internals_setup(req))) goto leave;
408 internals = req->internals;
409
410 curle = curl_easy_perform(internals->curl);
411
412 rv = curl_status(curle);
413 if (APR_SUCCESS != rv) {
414 md_log_perror(MD_LOG_MARK, MD_LOG_DEBUG, rv, req->pool,
415 "request failed(%d): %s", curle, curl_easy_strerror(curle));
416 goto leave;
417 }
418
419 rv = curl_status(curl_easy_getinfo(internals->curl, CURLINFO_RESPONSE_CODE, &l));
420 if (APR_SUCCESS == rv) {
421 internals->response->status = (int)l;
422 }
423 md_log_perror(MD_LOG_MARK, MD_LOG_TRACE1, rv, req->pool, "request <-- %d",
424 internals->response->status);
425
426 if (req->cb.on_response) {
427 rv = req->cb.on_response(internals->response, req->cb.on_response_data);
428 req->cb.on_response = NULL;
429 }
430
431leave:
432 fire_status(req, rv);
433 md_http_req_destroy(req);
434 return rv;
435}
436
437static md_http_request_t *find_curl_request(apr_array_header_t *requests, CURL *curl)
438{

Callers

nothing calls this directly

Calls 5

internals_setupFunction · 0.85
curl_statusFunction · 0.85
md_log_perrorFunction · 0.85
fire_statusFunction · 0.85
md_http_req_destroyFunction · 0.85

Tested by

no test coverage detected