mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
Merge branch '4.0release' into merge/develop
This commit is contained in:
commit
cc556fe921
8 changed files with 36 additions and 3 deletions
|
@ -134,6 +134,7 @@ We are grateful to the community for contributing bugfix and improvements, pleas
|
|||
|
||||
## Releases
|
||||
|
||||
* 2022-01-30, Release [v4.0-b5](https://github.com/ossrs/srs/releases/tag/v4.0-b5), v4.0-b5, 4.0 beta5, v4.0.236, 144416 lines.
|
||||
* 2022-01-17, Release [v4.0-b4](https://github.com/ossrs/srs/releases/tag/v4.0-b4), v4.0-b4, 4.0 beta4, v4.0.230, 144393 lines.
|
||||
* 2022-01-13, Release [v4.0-b3](https://github.com/ossrs/srs/releases/tag/v4.0-b3), v4.0-b3, 4.0 beta3, v4.0.229, 144393 lines.
|
||||
* 2022-01-03, Release [v4.0-b2](https://github.com/ossrs/srs/releases/tag/v4.0-b2), v4.0-b2, 4.0 beta2, v4.0.215, 144278 lines.
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
listen 1935;
|
||||
max_connections 1000;
|
||||
# For docker, please use docker logs to manage the logs of SRS.
|
||||
# See https://docs.docker.com/config/containers/logging/
|
||||
srs_log_tank console;
|
||||
daemon off;
|
||||
http_api {
|
||||
|
|
|
@ -32,6 +32,10 @@ The changelog for SRS.
|
|||
|
||||
## SRS 4.0 Changelog
|
||||
|
||||
* v4.0, 2022-02-03, Merge [#2888](https://github.com/ossrs/srs/pull/2888): Fix bug when the value of http header is empty. (#2888). v4.0.237
|
||||
* v4.0, 2022-01-30, Refine docker console, preview by players at the same server. v4.0.236
|
||||
* v4.0, 2022-01-30, For docker, always use the console for logging. v4.0.235
|
||||
* v4.0, 2022-01-29, Merge [#2896](https://github.com/ossrs/srs/pull/2896): SRT: Reduce the SRT bug by limit the max times for retry. (#2896). v4.0.234
|
||||
* v4.0, 2022-01-23, Merge [#2886](https://github.com/ossrs/srs/pull/2886): Fix bug when free addrinfo. (#2886). v4.0.233
|
||||
* v4.0, 2022-01-22, Merge [#2887](https://github.com/ossrs/srs/pull/2887): Fix memory leak in SrsMetaCache. (#2887). v4.0.232
|
||||
* v4.0, 2022-01-21, Support docker image for [lighthouse](https://hub.docker.com/r/ossrs/lighthouse). v4.0.231
|
||||
|
|
|
@ -570,7 +570,7 @@ scApp.filter('sc_filter_style_error', function(){
|
|||
|
||||
scApp.filter('sc_filter_preview_url', ['$sc_server', function($sc_server){
|
||||
return function(v){
|
||||
var page = $sc_server.schema + "://ossrs.net/players/srs_player.html";
|
||||
var page = $sc_server.schema + `://${$sc_server.host}:${$sc_server.http}/players/srs_player.html`;
|
||||
var http = $sc_server.http[$sc_server.http.length - 1];
|
||||
var query = "vhost=" + v.owner.name + "&app=" + v.app + "&stream=" + v.name + ".flv";
|
||||
query += "&server=" + $sc_server.host +"&port=" + http + "&autostart=true&schema=" + $sc_server.schema;
|
||||
|
@ -685,6 +685,10 @@ scApp.provider("$sc_server", [function(){
|
|||
} else {
|
||||
self.port = $location.port();
|
||||
}
|
||||
|
||||
if ($location.search().http) {
|
||||
self.http = [$location.search().http];
|
||||
}
|
||||
}
|
||||
};
|
||||
return self;
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
|
||||
#define VERSION_MAJOR 4
|
||||
#define VERSION_MINOR 0
|
||||
#define VERSION_REVISION 233
|
||||
#define VERSION_REVISION 237
|
||||
|
||||
#endif
|
||||
|
|
|
@ -122,7 +122,8 @@ bool get_streamid_info(const std::string& streamid, int& mode, std::string& url_
|
|||
}
|
||||
|
||||
srt_conn::srt_conn(SRTSOCKET conn_fd, const std::string& streamid):_conn_fd(conn_fd),
|
||||
_streamid(streamid) {
|
||||
_streamid(streamid),
|
||||
write_fail_cnt_(0) {
|
||||
get_streamid_info(streamid, _mode, _url_subpath);
|
||||
|
||||
_update_timestamp = now_ms();
|
||||
|
@ -195,7 +196,13 @@ int srt_conn::write(unsigned char* data, int len) {
|
|||
ret = srt_send(_conn_fd, (char*)data, len);
|
||||
if (ret <= 0) {
|
||||
srt_log_error("srt write error:%d, socket fd:%d", ret, _conn_fd);
|
||||
write_fail_cnt_++;
|
||||
return ret;
|
||||
}
|
||||
write_fail_cnt_ = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int srt_conn::get_write_fail_count() {
|
||||
return write_fail_cnt_;
|
||||
}
|
|
@ -44,6 +44,7 @@ public:
|
|||
|
||||
void update_timestamp(long long now_ts);
|
||||
long long get_last_ts();
|
||||
int get_write_fail_count();
|
||||
|
||||
private:
|
||||
SRTSOCKET _conn_fd;
|
||||
|
@ -52,6 +53,7 @@ private:
|
|||
std::string _vhost;
|
||||
int _mode;
|
||||
long long _update_timestamp;
|
||||
int write_fail_cnt_;
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<srt_conn> SRT_CONN_PTR;
|
||||
|
|
|
@ -26,6 +26,7 @@ static long long MONITOR_TIMEOUT = 5000;
|
|||
const unsigned int DEF_DATA_SIZE = 188*7;
|
||||
const long long CHECK_ALIVE_INTERVAL = 5*1000;
|
||||
const long long CHECK_ALIVE_TIMEOUT = 5*1000;
|
||||
static const int SRT_WRTIE_FAIL_MAX = 10;
|
||||
|
||||
long long srt_now_ms = 0;
|
||||
|
||||
|
@ -215,6 +216,7 @@ void srt_handle::handle_push_data(SRT_SOCKSTATUS status, const std::string& subp
|
|||
srt_log_info("receive data size(%d) from pusher(%d) to pullers, count:%d",
|
||||
ret, conn_fd, streamid_iter->second.size());
|
||||
|
||||
std::vector<SRTSOCKET> remove_vec;
|
||||
for (auto puller_iter = streamid_iter->second.begin();
|
||||
puller_iter != streamid_iter->second.end();
|
||||
puller_iter++) {
|
||||
|
@ -227,6 +229,17 @@ void srt_handle::handle_push_data(SRT_SOCKSTATUS status, const std::string& subp
|
|||
srt_log_info("send data size(%d) to puller fd:%d", write_ret, puller_iter->first);
|
||||
if (write_ret > 0) {
|
||||
puller_iter->second->update_timestamp(srt_now_ms);
|
||||
} else {
|
||||
if (player_conn->get_write_fail_count() > SRT_WRTIE_FAIL_MAX) {
|
||||
remove_vec.push_back(puller_iter->first);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (auto item : remove_vec) {
|
||||
streamid_iter->second.erase(item);
|
||||
if (streamid_iter->second.empty()) {
|
||||
_streamid_map.erase(streamid_iter);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue