winlin

refine code.

... ... @@ -21,4 +21,9 @@ CONTRIBUTORS ordered by first contribution.
* allspace<allspace@gmail.com> "The srs-librtmp windows support"
* niesongsong<nie950@gmail.com> "Configure support relative path"
* rudeb0t<nimrod@themanxgroup.tw> "Bug fixed"
* CallMeNP<np.liamg@gmail.com> "Bug fixed"
* synote<synote@qq.com> "Bug fixed"
* lovecat<littlefawn@163.com> "Bug fixed"
* panda1986<542638787@qq.com> "Bug fixed"
* YueHonghui<hongf.yue@hotmail.com> "Bug fixed"
... ...
... ... @@ -1488,7 +1488,7 @@ int SrsConfig::parse_argv(int& i, char** argv)
void SrsConfig::print_help(char** argv)
{
printf(
RTMP_SIG_SRS_NAME" "RTMP_SIG_SRS_VERSION" "RTMP_SIG_SRS_COPYRIGHT"\n"
RTMP_SIG_SRS_SERVER" "RTMP_SIG_SRS_COPYRIGHT"\n"
"License: "RTMP_SIG_SRS_LICENSE"\n"
"Primary: "RTMP_SIG_SRS_PRIMARY"\n"
"Authors: "RTMP_SIG_SRS_AUTHROS"\n"
... ...
... ... @@ -279,7 +279,7 @@ int SrsHttpResponseWriter::send_header(char* data, int size)
// set server if not set.
if (hdr->get("Server").empty()) {
hdr->set("Server", RTMP_SIG_SRS_KEY"/"RTMP_SIG_SRS_VERSION);
hdr->set("Server", RTMP_SIG_SRS_SERVER);
}
// chunked encoding
... ...
... ... @@ -33,22 +33,27 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define VERSION_MINOR 0
#define VERSION_REVISION 206
// server info.
// generated by configure, only macros.
#include <srs_auto_headers.hpp>
// provider info.
#define RTMP_SIG_SRS_KEY "SRS"
#define RTMP_SIG_SRS_CODE "ZhouGuowen"
#define RTMP_SIG_SRS_ROLE "origin/edge server"
#define RTMP_SIG_SRS_AUTHROS "winlin,wenjie.zhao"
// contact info.
#define RTMP_SIG_SRS_WEB "http://ossrs.net"
#define RTMP_SIG_SRS_EMAIL "winlin@vip.126.com"
// debug info.
#define RTMP_SIG_SRS_ROLE "cluster"
#define RTMP_SIG_SRS_NAME RTMP_SIG_SRS_KEY"(Simple RTMP Server)"
#define RTMP_SIG_SRS_URL_SHORT "github.com/ossrs/srs"
#define RTMP_SIG_SRS_URL "https://"RTMP_SIG_SRS_URL_SHORT
#define RTMP_SIG_SRS_WEB "http://ossrs.net"
#define RTMP_SIG_SRS_EMAIL "winlin@vip.126.com"
#define RTMP_SIG_SRS_LICENSE "The MIT License (MIT)"
#define RTMP_SIG_SRS_COPYRIGHT "Copyright (c) 2013-2015 SRS(ossrs)"
#define RTMP_SIG_SRS_PRIMARY "SRS/"VERSION_STABLE_BRANCH
#define RTMP_SIG_SRS_AUTHROS "winlin,wenjie.zhao"
#define RTMP_SIG_SRS_PRIMARY RTMP_SIG_SRS_KEY"/"VERSION_STABLE_BRANCH
#define RTMP_SIG_SRS_CONTRIBUTORS_URL RTMP_SIG_SRS_URL"/blob/master/AUTHORS.txt"
#define RTMP_SIG_SRS_HANDSHAKE RTMP_SIG_SRS_KEY"("RTMP_SIG_SRS_VERSION")"
#define RTMP_SIG_SRS_RELEASE RTMP_SIG_SRS_URL"/tree/1.0release"
#define RTMP_SIG_SRS_RELEASE RTMP_SIG_SRS_URL"/tree/"VERSION_STABLE_BRANCH".0release"
#define RTMP_SIG_SRS_ISSUES(id) RTMP_SIG_SRS_URL"/issues/"#id
#define RTMP_SIG_SRS_VERSION SRS_XSTR(VERSION_MAJOR)"."SRS_XSTR(VERSION_MINOR)"."SRS_XSTR(VERSION_REVISION)
#define RTMP_SIG_SRS_SERVER RTMP_SIG_SRS_KEY"/"RTMP_SIG_SRS_VERSION"("RTMP_SIG_SRS_CODE")"
... ... @@ -90,8 +95,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <stddef.h>
#include <sys/types.h>
// generated by configure.
#include <srs_auto_headers.hpp>
// important performance options.
#include <srs_core_performance.hpp>
... ...
... ... @@ -289,6 +289,16 @@ bool srs_string_contains(string str, string flag)
return str.find(flag) != string::npos;
}
bool srs_string_contains(string str, string flag0, string flag1)
{
return str.find(flag0) != string::npos || str.find(flag1) != string::npos;
}
bool srs_string_contains(string str, string flag0, string flag1, string flag2)
{
return str.find(flag0) != string::npos || str.find(flag1) != string::npos || str.find(flag2) != string::npos;
}
int srs_do_create_dir_recursively(string dir)
{
int ret = ERROR_SUCCESS;
... ...
... ... @@ -70,6 +70,8 @@ extern bool srs_string_starts_with(std::string str, std::string flag);
extern bool srs_string_starts_with(std::string str, std::string flag0, std::string flag1);
// whether string contains with
extern bool srs_string_contains(std::string str, std::string flag);
extern bool srs_string_contains(std::string str, std::string flag0, std::string flag1);
extern bool srs_string_contains(std::string str, std::string flag0, std::string flag1, std::string flag2);
// create dir recursively
extern int srs_create_dir_recursively(std::string dir);
... ...
... ... @@ -248,6 +248,9 @@ void check_macro_features()
int main(int argc, char** argv)
{
int ret = ERROR_SUCCESS;
// first hello message.
srs_trace(RTMP_SIG_SRS_SERVER);
// TODO: support both little and big endian.
srs_assert(srs_is_little_endian());
... ... @@ -290,7 +293,7 @@ int main(int argc, char** argv)
return ret;
}
srs_trace("srs(ossrs) "RTMP_SIG_SRS_VERSION);
srs_trace(RTMP_SIG_SRS_SERVER", stable is "RTMP_SIG_SRS_PRIMARY);
srs_trace("license: "RTMP_SIG_SRS_LICENSE", "RTMP_SIG_SRS_COPYRIGHT);
srs_trace("primary/master: "RTMP_SIG_SRS_PRIMARY);
srs_trace("authors: "RTMP_SIG_SRS_AUTHROS);
... ...