Skip to content

Commit

Permalink
refine code.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Dec 31, 2015
1 parent eca46c0 commit 26211ab
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 12 deletions.
5 changes: 5 additions & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ CONTRIBUTORS ordered by first contribution.
* allspace<[email protected]> "The srs-librtmp windows support"
* niesongsong<[email protected]> "Configure support relative path"
* rudeb0t<[email protected]> "Bug fixed"
* CallMeNP<[email protected]> "Bug fixed"
* synote<[email protected]> "Bug fixed"
* lovecat<[email protected]> "Bug fixed"
* panda1986<[email protected]> "Bug fixed"
* YueHonghui<[email protected]> "Bug fixed"

2 changes: 1 addition & 1 deletion trunk/src/app/srs_app_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/app/srs_app_http_conn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 12 additions & 9 deletions trunk/src/core/srs_core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 "[email protected]"
// 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 "[email protected]"
#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")"
Expand Down Expand Up @@ -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>

Expand Down
10 changes: 10 additions & 0 deletions trunk/src/kernel/srs_kernel_utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions trunk/src/kernel/srs_kernel_utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion trunk/src/main/srs_main_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 26211ab

Please sign in to comment.