GNURLINFO...SESSION_ID(3)
π NAME π
GNURLINFO...SESSION_ID(3) is the page, the manual is curl_easy_getinfo options, and the star of the show is CURLINFO_RTSP_SESSION_ID β get RTSP session ID. Periodt. π
π SYNOPSIS π
Okay bestie, the summoning circle looks like this:
#include <gnurl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_RTSP_SESSION_ID, char
**id);
π¦ DESCRIPTION π¦
Pass a pointer to a char pointer to receive a pointer to a string holding the most recent RTSP Session ID. That's the move. π«Ά
Applications wishing to resume an RTSP session on another connection should retrieve this info before closing the active connection. Literally grab it before the connection dips, iykyk.
The id pointer will be NULL or pointing to private memory you MUST NOT free β it gets freed when you call curl_easy_cleanup(3) on the corresponding CURL handle.
β οΈ Do not free thatidpointer! It's private memory. It gets freed when you callcurl_easy_cleanup(3)on the correspondingCURLhandle. Not me warning you twice β this is important, fr fr. π
π PROTOCOLS π
RTSP. That's the entire protocol guest list, no cap. π
πΈ EXAMPLE πΈ
Here's the code moment β keep it exact, bestie:
CURL *curl = curl_easy_init();
if(curl) {
CURLcode res;
curl_easy_setopt(curl, CURLOPT_URL, "rtsp://rtsp.example.com");
res = curl_easy_perform(curl);
if(res == CURLE_OK) {
char *id;
curl_easy_getinfo(curl, CURLINFO_RTSP_SESSION_ID, &id);
}
curl_easy_cleanup(curl);
}
π AVAILABILITY π
Added in 7.20.0. Vintage but still iconic. π
β RETURN VALUE β
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. Vibe check: supported = CURLE_OK, not supported = CURLE_UNKNOWN_OPTION. Periodt. π₯
π§ SEE ALSO π§
Go peek at curl_easy_getinfo(3), curl_easy_setopt(3), β yes, that trailing comma is canon. π
xoxo π β this page is from libcurl 7.44.0, dated 12 Sep 2015, and it's GNURLINFO...SESSION_ID(3), signing off. Stay hydrated and don't free private memory. π§π
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms