mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
for bug #277, the http server subscribe the reload.
This commit is contained in:
parent
f1393ee43f
commit
c4302b9b61
4 changed files with 12 additions and 18 deletions
|
@ -199,6 +199,13 @@ int SrsHttpServer::initialize()
|
|||
return ret;
|
||||
}
|
||||
|
||||
int SrsHttpServer::on_reload_vhost_http_updated()
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
// TODO: FIXME: implements it.
|
||||
return ret;
|
||||
}
|
||||
|
||||
SrsHttpConn::SrsHttpConn(SrsServer* svr, st_netfd_t fd, SrsHttpServer* m)
|
||||
: SrsConnection(svr, fd)
|
||||
{
|
||||
|
|
|
@ -35,6 +35,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <srs_app_st.hpp>
|
||||
#include <srs_app_conn.hpp>
|
||||
#include <srs_app_http.hpp>
|
||||
#include <srs_app_reload.hpp>
|
||||
|
||||
class SrsStSocket;
|
||||
class SrsHttpParser;
|
||||
|
@ -56,7 +57,7 @@ protected:
|
|||
virtual int serve_flv_stream(ISrsGoHttpResponseWriter* w, SrsHttpMessage* r, std::string fullpath, int offset);
|
||||
};
|
||||
|
||||
class SrsHttpServer
|
||||
class SrsHttpServer : public ISrsReloadHandler
|
||||
{
|
||||
public:
|
||||
SrsGoHttpServeMux mux;
|
||||
|
@ -65,6 +66,9 @@ public:
|
|||
virtual ~SrsHttpServer();
|
||||
public:
|
||||
virtual int initialize();
|
||||
// interface ISrsThreadHandler.
|
||||
public:
|
||||
virtual int on_reload_vhost_http_updated();
|
||||
};
|
||||
|
||||
class SrsHttpConn : public SrsConnection
|
||||
|
|
|
@ -1013,22 +1013,6 @@ int SrsServer::on_reload_vhost_removed(std::string /*vhost*/)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int SrsServer::on_reload_vhost_http_updated()
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
#ifdef SRS_AUTO_HTTP_SERVER
|
||||
srs_freep(http_stream_mux);
|
||||
http_stream_mux = new SrsHttpServer();
|
||||
|
||||
if ((ret = http_stream_mux->initialize()) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int SrsServer::on_reload_http_api_enabled()
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
|
|
@ -236,7 +236,6 @@ public:
|
|||
virtual int on_reload_pid();
|
||||
virtual int on_reload_vhost_added(std::string vhost);
|
||||
virtual int on_reload_vhost_removed(std::string vhost);
|
||||
virtual int on_reload_vhost_http_updated();
|
||||
virtual int on_reload_http_api_enabled();
|
||||
virtual int on_reload_http_api_disabled();
|
||||
virtual int on_reload_http_stream_enabled();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue