From 86e506e6ec7235fded615798529a7efbb82ddb07 Mon Sep 17 00:00:00 2001 From: winlin Date: Sat, 7 Aug 2021 15:59:00 +0800 Subject: [PATCH] API: For #2508, query feature docker and packager. v4.0.148 --- trunk/auto/auto_headers.sh | 1 + trunk/src/app/srs_app_latest_version.cpp | 10 ++++++++++ trunk/src/core/srs_core_version3.hpp | 2 +- trunk/src/core/srs_core_version4.hpp | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/trunk/auto/auto_headers.sh b/trunk/auto/auto_headers.sh index 824daab86..2c5f40649 100755 --- a/trunk/auto/auto_headers.sh +++ b/trunk/auto/auto_headers.sh @@ -11,6 +11,7 @@ echo "#ifndef SRS_AUTO_HEADER_HPP" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_HEADER_HPP" >> $SRS_AUTO_HEADERS_H echo "" >> $SRS_AUTO_HEADERS_H +echo "#define SRS_PACKAGER \"${SRS_AUTO_PACKAGER}\"" >> $SRS_AUTO_HEADERS_H echo "#define SRS_BUILD_TS \"`date +%s`\"" >> $SRS_AUTO_HEADERS_H echo "#define SRS_BUILD_DATE \"`date \"+%Y-%m-%d %H:%M:%S\"`\"" >> $SRS_AUTO_HEADERS_H echo "#define SRS_UNAME \"`uname -a`\"" >> $SRS_AUTO_HEADERS_H diff --git a/trunk/src/app/srs_app_latest_version.cpp b/trunk/src/app/srs_app_latest_version.cpp index e4e9b60e5..1d3c60221 100644 --- a/trunk/src/app/srs_app_latest_version.cpp +++ b/trunk/src/app/srs_app_latest_version.cpp @@ -39,6 +39,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include using namespace std; +// Whether we are in docker, defined in main module. +extern bool _srs_in_docker; + +void srs_build_features(stringstream& ss) +{ + ss << "&docker=" << _srs_in_docker + << "&packager=" << SRS_PACKAGER; +} + SrsLatestVersion::SrsLatestVersion() { trd_ = new SrsSTCoroutine("signal", this); @@ -111,6 +120,7 @@ srs_error_t SrsLatestVersion::query_latest_version() << "&id=" << server_id_ << "&role=srs" << "&eip=" << srs_get_public_internet_address() << "&ts=" << srsu2ms(srs_get_system_time()); + srs_build_features(ss); string url = ss.str(); SrsHttpUri uri; diff --git a/trunk/src/core/srs_core_version3.hpp b/trunk/src/core/srs_core_version3.hpp index d0caaee8c..137bbc08c 100644 --- a/trunk/src/core/srs_core_version3.hpp +++ b/trunk/src/core/srs_core_version3.hpp @@ -7,6 +7,6 @@ #ifndef SRS_CORE_VERSION3_HPP #define SRS_CORE_VERSION3_HPP -#define SRS_VERSION3_REVISION 165 +#define SRS_VERSION3_REVISION 166 #endif diff --git a/trunk/src/core/srs_core_version4.hpp b/trunk/src/core/srs_core_version4.hpp index 646bed6b8..b7a0daa10 100644 --- a/trunk/src/core/srs_core_version4.hpp +++ b/trunk/src/core/srs_core_version4.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 4 #define VERSION_MINOR 0 -#define VERSION_REVISION 147 +#define VERSION_REVISION 148 #endif