summaryrefslogtreecommitdiff
path: root/lib/rtsp.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2022-11-08 15:34:12 +0100
committerDaniel Stenberg <daniel@haxx.se>2022-11-09 09:40:00 +0100
commit2bc04d4980b0fa929b511fb35e41c42e16d44438 (patch)
treef8a8ddb2788a5873a08464f9343ae5a16cd53a6a /lib/rtsp.c
parente46d388c87ad79fce209b1742f8bcf6664cbf43e (diff)
downloadcurl-2bc04d4980b0fa929b511fb35e41c42e16d44438.tar.gz
rtsp: fix RTSP auth
Verified with test 3100 Fixes #4750 Closes #9870
Diffstat (limited to 'lib/rtsp.c')
-rw-r--r--lib/rtsp.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/rtsp.c b/lib/rtsp.c
index 700479f29..e32756fd8 100644
--- a/lib/rtsp.c
+++ b/lib/rtsp.c
@@ -267,6 +267,19 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done)
rtsp->CSeq_sent = data->state.rtsp_next_client_CSeq;
rtsp->CSeq_recv = 0;
+ /* Setup the first_* fields to allow auth details get sent
+ to this origin */
+
+ /* Free to avoid leaking memory on multiple requests */
+ free(data->state.first_host);
+
+ data->state.first_host = strdup(conn->host.name);
+ if(!data->state.first_host)
+ return CURLE_OUT_OF_MEMORY;
+
+ data->state.first_remote_port = conn->remote_port;
+ data->state.first_remote_protocol = conn->handler->protocol;
+
/* Setup the 'p_request' pointer to the proper p_request string
* Since all RTSP requests are included here, there is no need to
* support custom requests like HTTP.