← Commit list

458704d484

Stephen Psaradellis
Stephen Psaradellis
2026-09-14
SUCCESS Duration: 422s

Subject

rtsp: accept a Content-Length body on methods that expected none

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

docs/KNOWN_BUGS.md+0 -10
@@ -490,13 +490,3 @@ See https://curl.se/mail/lib-2024-05/0026.html and
The transfer ends with error "QUIC connection is draining".
[curl issue 12037](https://github.com/curl/curl/issues/12037)
-
-# RTSP
-
-## Some methods do not support response bodies
-
-The RTSP implementation is written to assume that a number of RTSP methods
-always get responses without bodies, even though there seems to be no
-indication in the RFC that this is always the case.
-
-[curl issue 12414](https://github.com/curl/curl/issues/12414)
lib/http.c+9 -0
@@ -4210,6 +4210,15 @@ static CURLcode http_on_response(struct Curl_easy *data,
if(result)
goto out;
+#ifndef CURL_DISABLE_RTSP
+ /* An RTSP response to any method may carry a body, which is announced
+ with Content-Length (RFC 2326 section 12.14). Read it instead of
+ treating it as excess data. */
+ if((conn->scheme->protocol & CURLPROTO_RTSP) && data->req.no_body &&
+ (k->size > 0))
+ data->req.no_body = FALSE;
+#endif
+
/* If we requested a "no body", this is a good time to get
* out and return home.
*/
tests/data/Makefile.am+1 -0
@@ -676,6 +676,7 @@ TESTCASES = \
test654 \
test655 \
test656 \
+ test657 \
test658 \
test659 \
test660 \
tests/data/test657+58 -0
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<testcase>
+<info>
+<keywords>
+RTSP
+OPTIONS
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+RTSP/1.0 200 OK
+Server: RTSPD/libcurl-test
+CSeq: 1
+Public: DESCRIBE, OPTIONS, SETUP, TEARDOWN, PLAY, PAUSE
+Content-Length: 18
+
+No-More: sessions
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+rtsp
+</server>
+<tool>
+lib567
+</tool>
+<name>
+RTSP OPTIONS response with a body
+</name>
+<command>
+rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol crlf="headers">
+OPTIONS rtsp://%HOSTIP:%RTSPPORT/%TESTNUMBER RTSP/1.0
+CSeq: 1
+User-Agent: test567
+Test-Number: 567
+
+</protocol>
+<stdout>
+RTSP/1.0 200 OK
+Server: RTSPD/libcurl-test
+CSeq: 1
+Public: DESCRIBE, OPTIONS, SETUP, TEARDOWN, PLAY, PAUSE
+Content-Length: 18
+
+No-More: sessions
+</stdout>
+</verify>
+</testcase>