From 8ac39cb22f1c8348c2b33e3ace8e950983db8263 Mon Sep 17 00:00:00 2001 From: xialixin Date: Sun, 5 Apr 2020 13:45:52 +0800 Subject: [PATCH] del print_sip_message config --- trunk/conf/full.conf | 19 ++++++++++-- trunk/conf/push.gb28181.conf | 5 ---- trunk/src/app/srs_app_config.cpp | 32 ++++++++++----------- trunk/src/app/srs_app_config.hpp | 2 +- trunk/src/service/srs_service_http_conn.cpp | 3 ++ 5 files changed, 36 insertions(+), 25 deletions(-) diff --git a/trunk/conf/full.conf b/trunk/conf/full.conf index 454df82ab..b45a25916 100644 --- a/trunk/conf/full.conf +++ b/trunk/conf/full.conf @@ -322,7 +322,22 @@ stream_caster { # default: off audio_enable off; # The exposed IP to receive media stream. - host 192.168.1.3; + # * Retrieve server IP automatically, from all network interfaces. + # eth0 Retrieve server IP by specified network interface name. # TODO: Implements it. + # $CANDIDATE Read the IP from ENV variable $EIP, use * if not set, see https://github.com/ossrs/srs/issues/307#issuecomment-599028124 + # x.x.x.x A specified IP address or DNS name, which can be access by client such as Chrome. + # You can specific more than one interface name: + # eth0 eth1 Use network interface eth0 and eth1. # TODO: Implements it. + # Also by IP or DNS names: + # 192.168.1.3 10.1.2.3 rtc.me # TODO: Implements it. + # And by multiple ENV variables: + # $CANDIDATE $EIP # TODO: Implements it. + # default: * + host *; + #The media channel is automatically created according to the received RTP packet, + # and the channel ID is generated according to the RTP SSRC + # channelid format: 'chid[ssrc]' [ssrc] is rtp's ssrc + auto_create_channel off; sip { # Whether enable embeded SIP server. @@ -343,8 +358,6 @@ stream_caster { # The keepalive timeout in seconds. # default: 120 keepalive_timeout 120; - # Whether print SIP logs. - print_sip_message off; # Whether play immediately after registered. # default: on auto_play on; diff --git a/trunk/conf/push.gb28181.conf b/trunk/conf/push.gb28181.conf index 38b781723..0b49b8e77 100644 --- a/trunk/conf/push.gb28181.conf +++ b/trunk/conf/push.gb28181.conf @@ -90,11 +90,6 @@ stream_caster { # 认为设备离线 keepalive_timeout 120; - # 日志打印是否打印sip信息 - # off:不打印 - # on:打印接收或发送sip命令信息 - # TODO: https://github.com/ossrs/srs/pull/1679/files#r400929300 - print_sip_message off; # 注册之后是否自动给设备端发送invite # on: 是 off 不是,需要通过api控制 diff --git a/trunk/src/app/srs_app_config.cpp b/trunk/src/app/srs_app_config.cpp index 28e63f2f5..e9d45c29d 100644 --- a/trunk/src/app/srs_app_config.cpp +++ b/trunk/src/app/srs_app_config.cpp @@ -4459,26 +4459,26 @@ bool SrsConfig::get_stream_caster_gb28181_audio_enable(SrsConfDirective* conf) return SRS_CONF_PERFER_FALSE(conf->arg0()); } -bool SrsConfig::get_stream_caster_gb28181_print_sip_message(SrsConfDirective* conf) -{ - static bool DEFAULT = false; +// bool SrsConfig::get_stream_caster_gb28181_print_sip_message(SrsConfDirective* conf) +// { +// static bool DEFAULT = false; - if (!conf) { - return DEFAULT; - } +// if (!conf) { +// return DEFAULT; +// } - conf = conf->get("sip"); - if (!conf) { - return DEFAULT; - } +// conf = conf->get("sip"); +// if (!conf) { +// return DEFAULT; +// } - conf = conf->get("print_sip_message"); - if (!conf || conf->arg0().empty()) { - return DEFAULT; - } +// conf = conf->get("print_sip_message"); +// if (!conf || conf->arg0().empty()) { +// return DEFAULT; +// } - return SRS_CONF_PERFER_FALSE(conf->arg0()); -} +// return SRS_CONF_PERFER_FALSE(conf->arg0()); +// } bool SrsConfig::get_stream_caster_gb28181_wait_keyframe(SrsConfDirective* conf) { diff --git a/trunk/src/app/srs_app_config.hpp b/trunk/src/app/srs_app_config.hpp index 06bdafa67..f7f0a0bb8 100644 --- a/trunk/src/app/srs_app_config.hpp +++ b/trunk/src/app/srs_app_config.hpp @@ -507,7 +507,7 @@ public: virtual std::string get_stream_caster_gb28181_host(SrsConfDirective* conf); virtual std::string get_stream_caster_gb28181_serial(SrsConfDirective* conf); virtual std::string get_stream_caster_gb28181_realm(SrsConfDirective* conf); - virtual bool get_stream_caster_gb28181_print_sip_message(SrsConfDirective* conf); + //virtual bool get_stream_caster_gb28181_print_sip_message(SrsConfDirective* conf); virtual bool get_stream_caster_gb28181_wait_keyframe(SrsConfDirective* conf); virtual bool get_stream_caster_gb28181_sip_enable(SrsConfDirective* conf); virtual bool get_stream_caster_gb28181_sip_auto_play(SrsConfDirective* conf); diff --git a/trunk/src/service/srs_service_http_conn.cpp b/trunk/src/service/srs_service_http_conn.cpp index 815fc8670..f0f7b8c74 100644 --- a/trunk/src/service/srs_service_http_conn.cpp +++ b/trunk/src/service/srs_service_http_conn.cpp @@ -120,6 +120,7 @@ srs_error_t SrsHttpParser::parse_message_imp(ISrsReader* reader) if (buffer->size() > 0) { ssize_t consumed = http_parser_execute(&parser, &settings, buffer->bytes(), buffer->size()); + // The error is set in http_errno. enum http_errno code; if ((code = HTTP_PARSER_ERRNO(&parser)) != HPE_OK) { @@ -139,6 +140,8 @@ srs_error_t SrsHttpParser::parse_message_imp(ISrsReader* reader) } } } + + size_t nparsed; srs_info("size=%d, nparsed=%d, consumed=%d", buffer->size(), (int)nparsed, consumed); // Only consume the header bytes.