mirror of
				https://github.com/ossrs/srs.git
				synced 2025-03-09 15:49:59 +00:00 
			
		
		
		
	rename SrsReloadHandler to ISrsReloadHandler
This commit is contained in:
		
							parent
							
								
									010b7a7595
								
							
						
					
					
						commit
						f016914ac1
					
				
					 6 changed files with 19 additions and 19 deletions
				
			
		|  | @ -452,12 +452,12 @@ int SrsConfig::reload() | |||
| 	conf.root = NULL; | ||||
| 	 | ||||
| 	// merge config.
 | ||||
| 	std::vector<SrsReloadHandler*>::iterator it; | ||||
| 	std::vector<ISrsReloadHandler*>::iterator it; | ||||
| 
 | ||||
| 	// merge config: listen
 | ||||
| 	if (!srs_directive_equals(root->get("listen"), old_root->get("listen"))) { | ||||
| 		for (it = subscribes.begin(); it != subscribes.end(); ++it) { | ||||
| 			SrsReloadHandler* subscribe = *it; | ||||
| 			ISrsReloadHandler* subscribe = *it; | ||||
| 			if ((ret = subscribe->on_reload_listen()) != ERROR_SUCCESS) { | ||||
| 				srs_error("notify subscribes reload listen failed. ret=%d", ret); | ||||
| 				return ret; | ||||
|  | @ -468,7 +468,7 @@ int SrsConfig::reload() | |||
| 	// merge config: pithy_print
 | ||||
| 	if (!srs_directive_equals(root->get("pithy_print"), old_root->get("pithy_print"))) { | ||||
| 		for (it = subscribes.begin(); it != subscribes.end(); ++it) { | ||||
| 			SrsReloadHandler* subscribe = *it; | ||||
| 			ISrsReloadHandler* subscribe = *it; | ||||
| 			if ((ret = subscribe->on_reload_pithy_print()) != ERROR_SUCCESS) { | ||||
| 				srs_error("notify subscribes pithy_print listen failed. ret=%d", ret); | ||||
| 				return ret; | ||||
|  | @ -482,9 +482,9 @@ int SrsConfig::reload() | |||
| 	return ret; | ||||
| } | ||||
| 
 | ||||
| void SrsConfig::subscribe(SrsReloadHandler* handler) | ||||
| void SrsConfig::subscribe(ISrsReloadHandler* handler) | ||||
| { | ||||
| 	std::vector<SrsReloadHandler*>::iterator it; | ||||
| 	std::vector<ISrsReloadHandler*>::iterator it; | ||||
| 	 | ||||
| 	it = std::find(subscribes.begin(), subscribes.end(), handler); | ||||
| 	if (it != subscribes.end()) { | ||||
|  | @ -494,9 +494,9 @@ void SrsConfig::subscribe(SrsReloadHandler* handler) | |||
| 	subscribes.push_back(handler); | ||||
| } | ||||
| 
 | ||||
| void SrsConfig::unsubscribe(SrsReloadHandler* handler) | ||||
| void SrsConfig::unsubscribe(ISrsReloadHandler* handler) | ||||
| { | ||||
| 	std::vector<SrsReloadHandler*>::iterator it; | ||||
| 	std::vector<ISrsReloadHandler*>::iterator it; | ||||
| 	 | ||||
| 	it = std::find(subscribes.begin(), subscribes.end(), handler); | ||||
| 	if (it == subscribes.end()) { | ||||
|  |  | |||
|  | @ -96,14 +96,14 @@ private: | |||
| 	bool show_version; | ||||
| 	std::string config_file; | ||||
| 	SrsConfDirective* root; | ||||
| 	std::vector<SrsReloadHandler*> subscribes; | ||||
| 	std::vector<ISrsReloadHandler*> subscribes; | ||||
| public: | ||||
| 	SrsConfig(); | ||||
| 	virtual ~SrsConfig(); | ||||
| public: | ||||
| 	virtual int reload(); | ||||
| 	virtual void subscribe(SrsReloadHandler* handler); | ||||
| 	virtual void unsubscribe(SrsReloadHandler* handler); | ||||
| 	virtual void subscribe(ISrsReloadHandler* handler); | ||||
| 	virtual void unsubscribe(ISrsReloadHandler* handler); | ||||
| public: | ||||
| 	virtual int parse_options(int argc, char** argv); | ||||
| private: | ||||
|  |  | |||
|  | @ -33,7 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
| 
 | ||||
| #define SRS_STAGE_DEFAULT_INTERVAL_MS 1200 | ||||
| 
 | ||||
| struct SrsStageInfo : public SrsReloadHandler | ||||
| struct SrsStageInfo : public ISrsReloadHandler | ||||
| { | ||||
| 	int stage_id; | ||||
| 	int pithy_print_time_ms; | ||||
|  |  | |||
|  | @ -25,20 +25,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
| 
 | ||||
| #include <srs_core_error.hpp> | ||||
| 
 | ||||
| SrsReloadHandler::SrsReloadHandler() | ||||
| ISrsReloadHandler::ISrsReloadHandler() | ||||
| { | ||||
| } | ||||
| 
 | ||||
| SrsReloadHandler::~SrsReloadHandler() | ||||
| ISrsReloadHandler::~ISrsReloadHandler() | ||||
| { | ||||
| } | ||||
| 
 | ||||
| int SrsReloadHandler::on_reload_listen() | ||||
| int ISrsReloadHandler::on_reload_listen() | ||||
| { | ||||
| 	return ERROR_SUCCESS; | ||||
| } | ||||
| 
 | ||||
| int SrsReloadHandler::on_reload_pithy_print() | ||||
| int ISrsReloadHandler::on_reload_pithy_print() | ||||
| { | ||||
| 	return ERROR_SUCCESS; | ||||
| } | ||||
|  |  | |||
|  | @ -32,11 +32,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
| /**
 | ||||
| * the handler for config reload. | ||||
| */ | ||||
| class SrsReloadHandler | ||||
| class ISrsReloadHandler | ||||
| { | ||||
| public: | ||||
| 	SrsReloadHandler(); | ||||
| 	virtual ~SrsReloadHandler(); | ||||
| 	ISrsReloadHandler(); | ||||
| 	virtual ~ISrsReloadHandler(); | ||||
| public: | ||||
| 	virtual int on_reload_listen(); | ||||
| 	virtual int on_reload_pithy_print(); | ||||
|  |  | |||
|  | @ -65,7 +65,7 @@ public: | |||
| 	virtual int cycle(); | ||||
| }; | ||||
| 
 | ||||
| class SrsServer : public SrsReloadHandler | ||||
| class SrsServer : public ISrsReloadHandler | ||||
| { | ||||
| 	friend class SrsListener; | ||||
| private: | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue