From e590537dca10864d3265466154e2beca05e9b2d7 Mon Sep 17 00:00:00 2001 From: winlin Date: Fri, 2 Jan 2015 12:56:15 +0800 Subject: [PATCH] fix #207, trim the last 0 of log. 1.0.18 --- README.md | 1 + trunk/src/app/srs_app_log.cpp | 7 +++---- trunk/src/core/srs_core.hpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index aff39123a..ebef16c45 100755 --- a/README.md +++ b/README.md @@ -383,6 +383,7 @@ Supported operating systems and hardware: * 2013-10-17, Created.
## History +* v1.0, 2015-01-02, hotfix [#207](https://github.com/winlinvip/simple-rtmp-server/issues/207), trim the last 0 of log. 1.0.18 * v1.0, 2015-01-02, hotfix [#216](https://github.com/winlinvip/simple-rtmp-server/issues/216), http-callback post in application/json content-type. 1.0.17 * v1.0, 2015-01-01, hotfix [#270](https://github.com/winlinvip/simple-rtmp-server/issues/270), memory leak for http client post. 1.0.16 * v1.0, 2014-12-29, hotfix [#267](https://github.com/winlinvip/simple-rtmp-server/issues/267), the forward dest ep should use server. 1.0.15 diff --git a/trunk/src/app/srs_app_log.cpp b/trunk/src/app/srs_app_log.cpp index d2c920dc3..6dbff7829 100644 --- a/trunk/src/app/srs_app_log.cpp +++ b/trunk/src/app/srs_app_log.cpp @@ -326,7 +326,6 @@ void SrsFastLog::write_log(int& fd, char *str_log, int size, int level) // add some to the end of char. str_log[size++] = LOG_TAIL; - str_log[size++] = 0; // if not to file, to console and return. if (!log_to_file_tank) { @@ -336,11 +335,11 @@ void SrsFastLog::write_log(int& fd, char *str_log, int size, int level) // \033[33m : yellow text code in shell // \033[0m : normal text code if (level <= SrsLogLevel::Trace) { - printf("%s", str_log); + printf("%.*s", size, str_log); } else if (level == SrsLogLevel::Warn) { - printf("\033[33m%s\033[0m", str_log); + printf("\033[33m%.*s\033[0m", size, str_log); } else{ - printf("\033[31m%s\033[0m", str_log); + printf("\033[31m%.*s\033[0m", size, str_log); } return; diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 7fadd5f19..7e35420e7 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // current release version #define VERSION_MAJOR 1 #define VERSION_MINOR 0 -#define VERSION_REVISION 17 +#define VERSION_REVISION 18 // server info. #define RTMP_SIG_SRS_KEY "SRS" #define RTMP_SIG_SRS_ROLE "origin/edge server"