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
2014-11-13 14:31:19 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
e5c504b465cd3a5be39065b9aea7cdded66cb97b
e5c504b4
2 parents
93e5d874
0bc35e09
Merge branch 'srs.master'
显示空白字符变更
内嵌
并排对比
正在显示
6 个修改的文件
包含
42 行增加
和
26 行删除
README.md
trunk/research/st/srs.c
trunk/src/app/srs_app_rtmp_conn.cpp
trunk/src/app/srs_app_st_socket.cpp
trunk/src/core/srs_core.hpp
trunk/src/libs/srs_lib_simple_socket.cpp
README.md
查看文件 @
e5c504b
...
...
@@ -242,9 +242,10 @@ Supported operating systems and hardware:
*
2013-10-17, Created.
<br/>
## History
*
v2.0, 2014-11-08, fix
[
#194
](
https://github.com/winlinvip/simple-rtmp-server/issues/194
)
, writev multiple msgs, support 6k+ 250kbps clients. 2.0.15.
*
v2.0, 2014-11-08, fix
[
#194
](
https://github.com/winlinvip/simple-rtmp-server/issues/194
)
, optmized st for timeout recv. pulse to 500ms. 2.0.14.
*
v2.0, 2014-11-08, fix
[
#195
](
https://github.com/winlinvip/simple-rtmp-server/issues/195
)
, remove the confuse code st_usleep(0). 2.0.13.
*
v2.0, 2014-11-13, fix
[
#200
](
https://github.com/winlinvip/simple-rtmp-server/issues/200
)
, deadloop when read/write 0 and ETIME. 2.0.16.
*
v2.0, 2014-11-13, fix
[
#194
](
https://github.com/winlinvip/simple-rtmp-server/issues/194
)
, writev multiple msgs, support 6k+ 250kbps clients. 2.0.15.
*
v2.0, 2014-11-12, fix
[
#194
](
https://github.com/winlinvip/simple-rtmp-server/issues/194
)
, optmized st for timeout recv. pulse to 500ms. 2.0.14.
*
v2.0, 2014-11-11, fix
[
#195
](
https://github.com/winlinvip/simple-rtmp-server/issues/195
)
, remove the confuse code st_usleep(0). 2.0.13.
*
v2.0, 2014-11-08, fix
[
#191
](
https://github.com/winlinvip/simple-rtmp-server/issues/191
)
, configure --export-librtmp-project and --export-librtmp-single. 2.0.11.
*
v2.0, 2014-11-08, fix
[
#66
](
https://github.com/winlinvip/simple-rtmp-server/issues/66
)
, srs-librtmp support write h264 raw packet. 2.0.9.
*
v2.0, 2014-10-25, fix
[
#185
](
https://github.com/winlinvip/simple-rtmp-server/issues/185
)
, AMF0 support 0x0B the date type codec. 2.0.7.
...
...
trunk/research/st/srs.c
查看文件 @
e5c504b
...
...
@@ -101,7 +101,7 @@ int sleep2_test()
st_thread_join
(
trd1
,
NULL
);
srs_trace
(
"sleep test: end"
);
exit
(
0
);
return
0
;
}
...
...
@@ -431,6 +431,8 @@ int pipe_test()
int
main
(
int
argc
,
char
**
argv
)
{
srs_trace
(
"ETIME=%d"
,
ETIME
);
if
(
st_set_eventsys
(
ST_EVENTSYS_ALT
)
<
0
)
{
srs_trace
(
"st_set_eventsys failed"
);
return
-
1
;
...
...
trunk/src/app/srs_app_rtmp_conn.cpp
查看文件 @
e5c504b
...
...
@@ -534,10 +534,6 @@ int SrsRtmpConn::playing(SrsSource* source)
// it's ok, do nothing.
ret
=
ERROR_SUCCESS
;
srs_verbose
(
"recv timeout, ignore. ret=%d"
,
ret
);
// TODO: FIXME: the timeout may caused some dead loop.
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/161
st_usleep
(
0
);
}
else
if
(
ret
!=
ERROR_SUCCESS
)
{
if
(
!
srs_is_client_gracefully_close
(
ret
))
{
srs_error
(
"recv client control message failed. ret=%d"
,
ret
);
...
...
trunk/src/app/srs_app_st_socket.cpp
查看文件 @
e5c504b
...
...
@@ -82,8 +82,9 @@ int SrsStSocket::read(void* buf, size_t size, ssize_t* nread)
// On success a non-negative integer indicating the number of bytes actually read is returned
// (a value of 0 means the network connection is closed or end of file is reached).
// Otherwise, a value of -1 is returned and errno is set to indicate the error.
if
(
nb_read
<=
0
)
{
if
(
errno
==
ETIME
)
{
if
(
nb_read
<
0
&&
errno
==
ETIME
)
{
return
ERROR_SOCKET_TIMEOUT
;
}
...
...
@@ -110,8 +111,9 @@ int SrsStSocket::read_fully(void* buf, size_t size, ssize_t* nread)
// On success a non-negative integer indicating the number of bytes actually read is returned
// (a value less than nbyte means the network connection is closed or end of file is reached)
// Otherwise, a value of -1 is returned and errno is set to indicate the error.
if
(
nb_read
!=
(
ssize_t
)
size
)
{
if
(
errno
==
ETIME
)
{
if
(
nb_read
<
0
&&
errno
==
ETIME
)
{
return
ERROR_SOCKET_TIMEOUT
;
}
...
...
@@ -136,8 +138,10 @@ int SrsStSocket::write(void* buf, size_t size, ssize_t* nwrite)
*
nwrite
=
nb_write
;
}
// On success a non-negative integer equal to nbyte is returned.
// Otherwise, a value of -1 is returned and errno is set to indicate the error.
if
(
nb_write
<=
0
)
{
if
(
errno
==
ETIME
)
{
if
(
nb_write
<
0
&&
errno
==
ETIME
)
{
return
ERROR_SOCKET_TIMEOUT
;
}
...
...
@@ -158,8 +162,10 @@ int SrsStSocket::writev(const iovec *iov, int iov_size, ssize_t* nwrite)
*
nwrite
=
nb_write
;
}
// On success a non-negative integer equal to nbyte is returned.
// Otherwise, a value of -1 is returned and errno is set to indicate the error.
if
(
nb_write
<=
0
)
{
if
(
errno
==
ETIME
)
{
if
(
nb_write
<
0
&&
errno
==
ETIME
)
{
return
ERROR_SOCKET_TIMEOUT
;
}
...
...
trunk/src/core/srs_core.hpp
查看文件 @
e5c504b
...
...
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR 2
#define VERSION_MINOR 0
#define VERSION_REVISION 1
5
#define VERSION_REVISION 1
6
// server info.
#define RTMP_SIG_SRS_KEY "SRS"
#define RTMP_SIG_SRS_ROLE "origin/edge server"
...
...
trunk/src/libs/srs_lib_simple_socket.cpp
查看文件 @
e5c504b
...
...
@@ -82,23 +82,27 @@ int SimpleSocketStream::read(void* buf, size_t size, ssize_t* nread)
{
int
ret
=
ERROR_SUCCESS
;
*
nread
=
::
recv
(
fd
,
buf
,
size
,
0
);
ssize_t
nb_read
=
::
recv
(
fd
,
buf
,
size
,
0
);
if
(
nread
)
{
*
nread
=
nb_read
;
}
// On success a non-negative integer indicating the number of bytes actually read is returned
// (a value of 0 means the network connection is closed or end of file is reached).
if
(
*
nread
<=
0
)
{
if
(
errno
==
ETIME
)
{
if
(
nb_read
<=
0
)
{
if
(
nb_read
<
0
&&
errno
==
ETIME
)
{
return
ERROR_SOCKET_TIMEOUT
;
}
if
(
*
n
read
==
0
)
{
if
(
nb_
read
==
0
)
{
errno
=
ECONNRESET
;
}
return
ERROR_SOCKET_READ
;
}
recv_bytes
+=
*
n
read
;
recv_bytes
+=
nb_
read
;
return
ret
;
}
...
...
@@ -165,21 +169,24 @@ int SimpleSocketStream::read_fully(void* buf, size_t size, ssize_t* nread)
int
ret
=
ERROR_SUCCESS
;
size_t
left
=
size
;
*
n
read
=
0
;
ssize_t
nb_
read
=
0
;
while
(
left
>
0
)
{
char
*
this_buf
=
(
char
*
)
buf
+
*
n
read
;
char
*
this_buf
=
(
char
*
)
buf
+
nb_
read
;
ssize_t
this_nread
;
if
((
ret
=
this
->
read
(
this_buf
,
left
,
&
this_nread
))
!=
ERROR_SUCCESS
)
{
return
ret
;
}
*
n
read
+=
this_nread
;
nb_
read
+=
this_nread
;
left
-=
this_nread
;
}
recv_bytes
+=
*
nread
;
if
(
nread
)
{
*
nread
=
nb_read
;
}
recv_bytes
+=
nb_read
;
return
ret
;
}
...
...
@@ -188,17 +195,21 @@ int SimpleSocketStream::write(void* buf, size_t size, ssize_t* nwrite)
{
int
ret
=
ERROR_SUCCESS
;
*
n
write
=
::
send
(
fd
,
(
void
*
)
buf
,
size
,
0
);
ssize_t
nb_
write
=
::
send
(
fd
,
(
void
*
)
buf
,
size
,
0
);
if
(
*
nwrite
<=
0
)
{
if
(
errno
==
ETIME
)
{
if
(
nwrite
)
{
*
nwrite
=
nb_write
;
}
if
(
nb_write
<=
0
)
{
if
(
nb_write
<
0
&&
errno
==
ETIME
)
{
return
ERROR_SOCKET_TIMEOUT
;
}
return
ERROR_SOCKET_WRITE
;
}
send_bytes
+=
*
n
write
;
send_bytes
+=
nb_
write
;
return
ret
;
}
...
...
请
注册
或
登录
后发表评论