mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine the global variables.
This commit is contained in:
parent
b06203e777
commit
2d387035cd
6 changed files with 42 additions and 39 deletions
|
@ -55,7 +55,7 @@ using namespace std;
|
|||
|
||||
using namespace _srs_internal;
|
||||
|
||||
// the version to identify the core.
|
||||
// @global the version to identify the core.
|
||||
const char* _srs_version = "XCORE-"RTMP_SIG_SRS_SERVER;
|
||||
|
||||
#define SRS_WIKI_URL_LOG "https://github.com/ossrs/srs/wiki/v1_CN_SrsLog"
|
||||
|
@ -4194,7 +4194,7 @@ bool SrsConfig::get_utc_time()
|
|||
}
|
||||
|
||||
string SrsConfig::get_work_dir() {
|
||||
static string DEFAULT = "";
|
||||
static string DEFAULT = "./";
|
||||
|
||||
SrsConfDirective* conf = root->get("work_dir");
|
||||
if( !conf || conf->arg0().empty()) {
|
||||
|
|
|
@ -125,7 +125,7 @@ extern std::string srs_config_bool2switch(const std::string& sbool);
|
|||
*/
|
||||
extern int srs_config_transform_vhost(SrsConfDirective* root);
|
||||
|
||||
// global config
|
||||
// @global config object.
|
||||
extern SrsConfig* _srs_config;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1318,6 +1318,7 @@ SrsConnection* SrsServer::fd2conn(SrsListenerType type, st_netfd_t stfd)
|
|||
}
|
||||
|
||||
SrsConnection* conn = NULL;
|
||||
bool close_for_not_served = false;
|
||||
|
||||
if (type == SrsListenerRtmpStream) {
|
||||
conn = new SrsRtmpConn(this, stfd, ip);
|
||||
|
@ -1326,18 +1327,23 @@ SrsConnection* SrsServer::fd2conn(SrsListenerType type, st_netfd_t stfd)
|
|||
conn = new SrsHttpApi(this, stfd, http_api_mux, ip);
|
||||
#else
|
||||
srs_warn("close http client for server not support http-api");
|
||||
srs_close_stfd(stfd);
|
||||
return ret;
|
||||
close_for_not_served = true;
|
||||
#endif
|
||||
} else if (type == SrsListenerHttpStream) {
|
||||
#ifdef SRS_AUTO_HTTP_SERVER
|
||||
conn = new SrsResponseOnlyHttpConn(this, stfd, http_server, ip);
|
||||
#else
|
||||
srs_warn("close http client for server not support http-server");
|
||||
return NULL;
|
||||
close_for_not_served = true;
|
||||
#endif
|
||||
} else {
|
||||
// TODO: FIXME: handler others
|
||||
srs_assert(false);
|
||||
}
|
||||
|
||||
if (close_for_not_served) {
|
||||
srs_close_stfd(stfd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return conn;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue