1--- 2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3SPDX-License-Identifier: curl 4Title: CURLOPT_RTSP_SESSION_ID 5Section: 3 6Source: libcurl 7See-also: 8 - CURLOPT_RTSP_REQUEST (3) 9 - CURLOPT_RTSP_STREAM_URI (3) 10Protocol: 11 - RTSP 12--- 13 14# NAME 15 16CURLOPT_RTSP_SESSION_ID - RTSP session ID 17 18# SYNOPSIS 19 20~~~c 21#include <curl/curl.h> 22 23CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RTSP_SESSION_ID, char *id); 24~~~ 25 26# DESCRIPTION 27 28Pass a char pointer as a parameter to set the value of the current RTSP 29Session ID for the handle. Useful for resuming an in-progress session. Once 30this value is set to any non-NULL value, libcurl returns 31*CURLE_RTSP_SESSION_ERROR* if ID received from the server does not match. If 32unset (or set to NULL), libcurl automatically sets the ID the first time the 33server sets it in a response. 34 35The application does not have to keep the string around after setting this 36option. 37 38# DEFAULT 39 40NULL 41 42# EXAMPLE 43 44~~~c 45int main(void) 46{ 47 CURL *curl = curl_easy_init(); 48 if(curl) { 49 CURLcode res; 50 char *prev_id; /* saved from before somehow */ 51 curl_easy_setopt(curl, CURLOPT_URL, "rtsp://example.com/"); 52 curl_easy_setopt(curl, CURLOPT_RTSP_SESSION_ID, prev_id); 53 res = curl_easy_perform(curl); 54 curl_easy_cleanup(curl); 55 } 56} 57~~~ 58 59# AVAILABILITY 60 61Added in 7.20.0 62 63# RETURN VALUE 64 65Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or 66CURLE_OUT_OF_MEMORY if there was insufficient heap space. 67