1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

fix #442: HTTP API kickoff client.

This commit is contained in:
lovacat 2015-08-11 15:23:46 +08:00
parent 0e3128d3e3
commit e8c0ca7af0
10 changed files with 121 additions and 18 deletions

12
trunk/src/protocol/srs_http_stack.cpp Normal file → Executable file
View file

@ -246,7 +246,17 @@ SrsHttpRedirectHandler::~SrsHttpRedirectHandler()
int SrsHttpRedirectHandler::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
{
int ret = ERROR_SUCCESS;
// TODO: FIXME: implements it.
string msg = "Moved Permsanently";
w->header()->set_content_type("text/plain; charset=utf-8");
w->header()->set_content_length(msg.length());
w->header()->set("Location", url);
w->write_header(code);
w->write((char*)msg.data(), (int)msg.length());
w->final_request();
srs_info("redirect to %s.", url.c_str());
return ret;
}