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

For #464, support origin cluster api

This commit is contained in:
winlin 2018-02-15 20:55:34 +08:00
parent d0fbf44d18
commit 469250f850
9 changed files with 185 additions and 6 deletions

View file

@ -51,6 +51,7 @@ using namespace std;
#include <srs_kernel_consts.hpp>
#include <srs_app_kafka.hpp>
#include <srs_app_thread.hpp>
#include <srs_app_coworkers.hpp>
// system interval in ms,
// all resolution times should be times togother,
@ -772,6 +773,9 @@ srs_error_t SrsServer::http_handle()
if ((err = http_api_mux->handle("/api/v1/raw", new SrsGoApiRaw(this))) != srs_success) {
return srs_error_wrap(err, "handle raw");
}
if ((err = http_api_mux->handle("/api/v1/clusters", new SrsGoApiClusters())) != srs_success) {
return srs_error_wrap(err, "handle raw");
}
// test the request info.
if ((err = http_api_mux->handle("/api/v1/tests/requests", new SrsGoApiRequests())) != srs_success) {
@ -1397,11 +1401,19 @@ srs_error_t SrsServer::on_publish(SrsSource* s, SrsRequest* r)
return srs_error_wrap(err, "http mount");
}
SrsCoWorkers* coworkers = SrsCoWorkers::instance();
if ((err = coworkers->on_publish(s, r)) != srs_success) {
return srs_error_wrap(err, "coworkers");
}
return err;
}
void SrsServer::on_unpublish(SrsSource* s, SrsRequest* r)
{
http_server->http_unmount(s, r);
SrsCoWorkers* coworkers = SrsCoWorkers::instance();
coworkers->on_unpublish(s, r);
}