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

Squash: Fix bugs

This commit is contained in:
winlin 2022-02-03 15:16:52 +08:00
parent b94ce1485a
commit 32bb96a5c2
8 changed files with 36 additions and 3 deletions

View file

@ -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_;
}