From 9eb6836b72cdf4f1f3c3c3dcacb351eb952b9abc Mon Sep 17 00:00:00 2001 From: winlin Date: Mon, 20 Feb 2023 15:17:28 +0800 Subject: [PATCH] WHIP: Support DELETE resource. --- trunk/src/app/srs_app_rtc_api.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/trunk/src/app/srs_app_rtc_api.cpp b/trunk/src/app/srs_app_rtc_api.cpp index f8ca69e54d..aa4e49d309 100644 --- a/trunk/src/app/srs_app_rtc_api.cpp +++ b/trunk/src/app/srs_app_rtc_api.cpp @@ -600,6 +600,14 @@ srs_error_t SrsGoApiRtcWhip::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessa // For each RTC session, we use short-term HTTP connection. w->header()->set("Connection", "Close"); + // Client stop publish. + // TODO: FIXME: Stop and cleanup the RTC session. + if (r->method() == SRS_CONSTS_HTTP_DELETE) { + srs_trace("WHIP: Delete stream %s", r->url().c_str()); + w->write_header(SRS_CONSTS_HTTP_OK); + return w->write(NULL, 0); + } + string remote_sdp_str; if ((err = r->body_read_all(remote_sdp_str)) != srs_success) { return srs_error_wrap(err, "read sdp");