From 435569a1692c8795442fa565408046387fe669ff Mon Sep 17 00:00:00 2001 From: Divya Sampath Kumar Date: Wed, 1 May 2024 10:18:29 -0700 Subject: [PATCH] Readd dumpResponseCurlEasyInfo and comment out since it is unused --- src/source/Response.c | 74 +++++++++++++++++++++++++++++++++++++++++++ src/source/Response.h | 6 ++++ 2 files changed, 80 insertions(+) diff --git a/src/source/Response.c b/src/source/Response.c index 90c89a223..6d979664f 100644 --- a/src/source/Response.c +++ b/src/source/Response.c @@ -282,6 +282,80 @@ VOID terminateCurlSession(PCurlResponse pCurlResponse, UINT64 timeout) } } +/* UNCOMMENT if required to use for CURL debugging. Not used at the moment. +VOID dumpResponseCurlEasyInfo(PCurlResponse pCurlResponse) +{ + DOUBLE time; + curl_off_t value; + CURLcode ret; + + if (pCurlResponse != NULL) { + ret = curl_easy_getinfo(pCurlResponse->pCurl, CURLINFO_TOTAL_TIME, &time); + if (ret == CURLE_OK) { + DLOGI("TOTAL_TIME: %f", time); + } else { + DLOGW("Unable to dump TOTAL_TIME"); + } + + ret = curl_easy_getinfo(pCurlResponse->pCurl, CURLINFO_NAMELOOKUP_TIME, &time); + if (ret == CURLE_OK) { + DLOGI("NAMELOOKUP_TIME: %f", time); + } else { + DLOGW("Unable to dump NAMELOOKUP_TIME"); + } + + ret = curl_easy_getinfo(pCurlResponse->pCurl, CURLINFO_CONNECT_TIME, &time); + if (ret == CURLE_OK) { + DLOGI("CONNECT_TIME: %f", time); + } else { + DLOGW("Unable to dump CONNECT_TIME"); + } + + ret = curl_easy_getinfo(pCurlResponse->pCurl, CURLINFO_APPCONNECT_TIME, &time); + if (ret == CURLE_OK) { + DLOGI("APPCONNECT_TIME: %f", time); + } else { + DLOGW("Unable to dump APPCONNECT_TIME"); + } + + ret = curl_easy_getinfo(pCurlResponse->pCurl, CURLINFO_PRETRANSFER_TIME, &time); + if (ret == CURLE_OK) { + DLOGI("PRETRANSFER_TIME: %f", time); + } else { + DLOGW("Unable to dump PRETRANSFER_TIME"); + } + + ret = curl_easy_getinfo(pCurlResponse->pCurl, CURLINFO_STARTTRANSFER_TIME, &time); + if (ret == CURLE_OK) { + DLOGI("STARTTRANSFER_TIME: %f", time); + } else { + DLOGW("Unable to dump STARTTRANSFER_TIME"); + } + + ret = curl_easy_getinfo(pCurlResponse->pCurl, CURLINFO_REDIRECT_TIME, &time); + if (ret == CURLE_OK) { + DLOGI("REDIRECT_TIME: %f", time); + } else { + DLOGW("Unable to dump REDIRECT_TIME"); + } + + ret = curl_easy_getinfo(pCurlResponse->pCurl, CURLINFO_SPEED_UPLOAD_T, &value); + if (ret == CURLE_OK) { + DLOGI("CURLINFO_SPEED_UPLOAD: %" CURL_FORMAT_CURL_OFF_T, value); + } else { + DLOGW("Unable to dump CURLINFO_SPEED_UPLOAD"); + } + + ret = curl_easy_getinfo(pCurlResponse->pCurl, CURLINFO_SIZE_UPLOAD_T, &value); + if (ret == CURLE_OK) { + DLOGI("CURLINFO_SIZE_UPLOAD: %" CURL_FORMAT_CURL_OFF_T, value); + } else { + DLOGW("Unable to dump CURLINFO_SIZE_UPLOAD"); + } + } +} + */ + SERVICE_CALL_RESULT getServiceCallResultFromCurlStatus(CURLcode curlStatus) { switch (curlStatus) { diff --git a/src/source/Response.h b/src/source/Response.h index 6e0c0bf8f..60fe1b241 100644 --- a/src/source/Response.h +++ b/src/source/Response.h @@ -115,6 +115,12 @@ STATUS closeCurlHandles(PCurlResponse); * @param - UINT64 - IN - Timeout value to use in 100ns * */ + +/* @param - PCurlResponse - IN - Response object + * + * VOID dumpResponseCurlEasyInfo(PCurlResponse); + */ + VOID terminateCurlSession(PCurlResponse, UINT64); /**