Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2015-05-22 13:57:04 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
46a81372e7bc133f58607fbf077d431fad17a131
46a81372
1 parent
6f8c076b
fix #398, set recv timeout for http connection.
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
13 行增加
和
1 行删除
trunk/src/app/srs_app_http_api.cpp
trunk/src/app/srs_app_http_conn.cpp
trunk/src/kernel/srs_kernel_consts.hpp
trunk/src/kernel/srs_kernel_error.cpp
trunk/src/app/srs_app_http_api.cpp
查看文件 @
46a8137
...
...
@@ -523,6 +523,10 @@ int SrsHttpApi::do_cycle()
// underlayer socket
SrsStSocket
skt
(
stfd
);
// set the recv timeout, for some clients never disconnect the connection.
// @see https://github.com/simple-rtmp-server/srs/issues/398
skt
.
set_recv_timeout
(
SRS_HTTP_RECV_TIMEOUT_US
);
// process http messages.
for
(;;)
{
SrsHttpMessage
*
req
=
NULL
;
...
...
trunk/src/app/srs_app_http_conn.cpp
查看文件 @
46a8137
...
...
@@ -1383,6 +1383,10 @@ int SrsHttpConn::do_cycle()
// underlayer socket
SrsStSocket
skt
(
stfd
);
// set the recv timeout, for some clients never disconnect the connection.
// @see https://github.com/simple-rtmp-server/srs/issues/398
skt
.
set_recv_timeout
(
SRS_HTTP_RECV_TIMEOUT_US
);
// process http messages.
for
(;;)
{
SrsHttpMessage
*
req
=
NULL
;
...
...
trunk/src/kernel/srs_kernel_consts.hpp
查看文件 @
46a8137
...
...
@@ -201,6 +201,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// query string seprator
#define SRS_CONSTS_HTTP_QUERY_SEP '?'
// the default recv timeout.
#define SRS_HTTP_RECV_TIMEOUT_US 60 * 1000 * 1000
// 6.1.1 Status Code and Reason Phrase
#define SRS_CONSTS_HTTP_Continue 100
#define SRS_CONSTS_HTTP_SwitchingProtocols 101
...
...
trunk/src/kernel/srs_kernel_error.cpp
查看文件 @
46a8137
...
...
@@ -33,6 +33,7 @@ bool srs_is_client_gracefully_close(int error_code)
{
return
error_code
==
ERROR_SOCKET_READ
||
error_code
==
ERROR_SOCKET_READ_FULLY
||
error_code
==
ERROR_SOCKET_WRITE
;
||
error_code
==
ERROR_SOCKET_WRITE
||
error_code
==
ERROR_SOCKET_TIMEOUT
;
}
...
...
请
注册
或
登录
后发表评论