gnurl_easy_getinfo(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸ’… gnurl_easy_getinfo(3) β€” libgnurl Manual edition ✨

🌸 NAME 🌸

curl_easy_getinfo β€” extract information from a curl handle. That's the whole vibe: it's the little function that lets you ask a curl session what's up. πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

Okay so this is the C glow-up, bestie:

#include <gnurl/curl.h>

CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ... );

That's the exact signature, no cap. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

Use this function to request internal information from the curl session, like you're sliding into its DMs and asking for the tea. The third argument MUST be a pointer to a long, a pointer to a char *, a pointer to a struct curl_slist * or a pointer to a double (as this documentation describes further down). The data pointed-to will be filled in accordingly and can be relied upon only if the function returns CURLE_OK. Use this function AFTER a performed transfer if you want to get transfer related data. Periodt.

🫢 Do not free the memory returned by this function unless it is explicitly mentioned below. That's important, bestie. Do not be out here freeing random curl memory because it will not slay.

✨ AVAILABLE INFORMATION ✨

The following information can be extracted. Here's the menu, and yes, it's giving encyclopedia but make it cute:


⏱️ TIMES ⏱️

An overview of the six time values available from curl_easy_getinfo(). And yes, the diagram is iconic:

curl_easy_perform()
    |
    |--NAMELOOKUP
    |--|--CONNECT
    |--|--|--APPCONNECT
    |--|--|--|--PRETRANSFER
    |--|--|--|--|--STARTTRANSFER
    |--|--|--|--|--|--TOTAL
    |--|--|--|--|--|--REDIRECT

πŸŒ€ NAMELOOKUP

CURLINFO_NAMELOOKUP_TIME and CURLINFO_NAMELOOKUP_TIME_T. The time it took from the start until the name resolving was completed. Lowkey the "finding the address" era. πŸ’…

πŸ”Œ CONNECT

CURLINFO_CONNECT_TIME and CURLINFO_CONNECT_TIME_T. The time it took from the start until the connect to the remote host (or proxy) was completed. That's the "we're actually in" moment. 🫢

🀝 APPCONNECT

CURLINFO_APPCONNECT_TIME and CURLINFO_APPCONNECT_TIME_T. The time it took from the start until the SSL connect/handshake with the remote host was completed. (Added in 7.19.0) The latter is the integer version (measuring microseconds). (Added in 7.60.0) Cute little handshake timeline, slay. ✨

🎬 PRETRANSFER

CURLINFO_PRETRANSFER_TIME and CURLINFO_PRETRANSFER_TIME_T. The time it took from the start until the file transfer is just about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved. It's giving backstage prep. πŸŽ€

πŸš€ STARTTRANSFER

CURLINFO_STARTTRANSFER_TIME and CURLINFO_STARTTRANSFER_TIME_T. The time it took from the start until the first byte is received by libcurl. First byte = main character entrance. πŸ’–

🌈 TOTAL

CURLINFO_TOTAL_TIME and CURLINFO_TOTAL_TIME_T. Total time of the previous request. The whole journey, periodt. ⭐

🎯 REDIRECT

CURLINFO_REDIRECT_TIME and CURLINFO_REDIRECT_TIME_T. The time it took for all redirection steps include name lookup, connect, pretransfer and transfer before final transaction was started. So, this is zero if no redirection took place. No redirects, no redirect time, iykyk. πŸ¦‹


πŸ’œ RETURN VALUE πŸ’œ

If the operation was successful, CURLE_OK is returned. Otherwise an appropriate error code will be returned. That's it, that's the vibe check. 🫢


πŸ‘‘ SEE ALSO πŸ‘‘

curl_easy_setopt(3)


πŸ₯Ί Okay bestie, cute little sign-off time: this page is from the source/version libcurl 7.19.4, dated 11 Feb 2009, and it's the gnurl_easy_getinfo(3) manual page. Bye bestie, go get that info! πŸ’–βœ¨
πŸ“¦ where this page comes from