1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

UTest: Fix utest warnings.

This commit is contained in:
winlin 2022-10-05 22:33:12 +08:00
parent cfbbe3044f
commit 9c81a0e1bd
8 changed files with 603 additions and 560 deletions

View file

@ -7246,20 +7246,11 @@ string SrsConfig::get_https_api_listen()
{
SRS_OVERWRITE_BY_ENV_STRING("srs.http_api.https.listen");
#ifdef SRS_UTEST
// We should not use static default, because we need to reset for different testcase.
string DEFAULT = "";
#else
static string DEFAULT = "";
#endif
// We should not use static default, because we need to reset for different use scenarios.
string DEFAULT = "1990";
// Follow the HTTPS server if config HTTP API as the same of HTTP server.
if (DEFAULT.empty()) {
if (get_http_api_listen() == get_http_stream_listen()) {
DEFAULT = get_https_stream_listen();
} else {
DEFAULT = "1990";
}
if (get_http_api_listen() == get_http_stream_listen()) {
DEFAULT = get_https_stream_listen();
}
SrsConfDirective* conf = get_https_api();

View file

@ -172,7 +172,7 @@ private:
public:
SrsFastCoroutine(std::string n, ISrsCoroutineHandler* h);
SrsFastCoroutine(std::string n, ISrsCoroutineHandler* h, SrsContextId cid);
~SrsFastCoroutine();
virtual ~SrsFastCoroutine();
public:
void set_stack_size(int v);
public:

View file

@ -2047,7 +2047,7 @@ std::string SrsApmSpan::text_propagator()
// For text based propagation, for example, HTTP header "Traceparent: 00-bb8dedf16c53ab4b6ceb1f4ca6d985bb-29247096662468ab-01"
// About the "%.2x", please see https://www.quora.com/What-does-2x-do-in-C-code for detail.
int nn = snprintf(buf, sizeof(buf), "%.2x-%s-%s-%.2x", supportedVersion, ctx_->trace_id_.c_str(), ctx_->span_id_.c_str(), FlagsSampled);
if (nn > 0 && nn < sizeof(buf)) {
if (nn > 0 && nn < (int)sizeof(buf)) {
return string(buf, nn);
}