Skip to content

Commit

Permalink
WHIP: Support DELETE resource.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Mar 22, 2023
1 parent c001aca commit 9eb6836
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions trunk/src/app/srs_app_rtc_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 9eb6836

Please sign in to comment.