CURLINFO_RTSP_SESSION_ID(3)

✨ CURLINFO_RTSP_SESSION_ID ✨

okay so bestie, welcome to the Library Functions Manual πŸ’– β€” this is the page for CURLINFO_RTSP_SESSION_ID, and it's literally about grabbing your RTSP session ID so you can keep the vibe going across connections. no cap, it's iconic. πŸŽ€


🌸 NAME 🌸

CURLINFO_RTSP_SESSION_ID β€” the RTSP session ID, and yes it's exactly what it sounds like, bestie ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <curl/curl.h>

CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_RTSP_SESSION_ID, char **id);

πŸ’… DESCRIPTION πŸ’…

so here's the tea β˜•: you pass a pointer to a char pointer, and it receives a pointer to a string that holds the most recent RTSP Session ID. literally the freshest session ID you've got, periodt. 🫢

now, if your application wants to resume an RTSP session on another connection, you should retrieve this info before closing the active connection β€” that's the whole point, bestie, don't close the door before you grab the keys πŸ”‘βœ¨

⚠️ okay important vibe check: the id pointer is NULL or points to private memory. you must not free it β€” do not do it, not today, not ever πŸ’€ the memory gets freed automatically when you call curl_easy_cleanup(3) on the corresponding curl handle. so just let it be, she's taken care of πŸ’…

🧚 PROTOCOLS 🧚

this functionality affects rtsp only β€” like, it's rtsp-exclusive, iykyk πŸ¦‹


✨ EXAMPLE ✨

okay here's the whole flex, bestie β€” a full little main function showing you the moves πŸ’–

int main(void)
{
  CURL *curl = curl_easy_init();
  if(curl) {
    CURLcode result;
    curl_easy_setopt(curl, CURLOPT_URL, "rtsp://rtsp.example.com");
    result = curl_easy_perform(curl);
    if(result == CURLE_OK) {
      char *id;
      curl_easy_getinfo(curl, CURLINFO_RTSP_SESSION_ID, &id);
    }
    curl_easy_cleanup(curl);
  }
}

πŸŽ€ AVAILABILITY πŸŽ€

this icon was Added in curl 7.20.0 β€” vintage but still slaying πŸ’…βœ¨


🌈 RETURN VALUE 🌈

curl_easy_getinfo(3) returns a CURLcode indicating success or error. πŸ’–

  • CURLE_OK (0) β€” everything was OK, we love to see it πŸ‘‘
  • non-zero β€” an error occurred 😭 see libcurl-errors(3) for the deets

πŸ”₯ SEE ALSO πŸ”₯


that's the whole page, bestie! πŸ’–πŸ«Ά this was libcurl, dated 2026-10-12, and the page is CURLINFO_RTSP_SESSION_ID(3) β€” now go slay those RTSP sessions, periodt βœ¨πŸ’…πŸŽ€

πŸ“¦ where this page comes from