|
|
|
@ -84,6 +84,7 @@ int SrsStSocket::read(void* buf, size_t size, ssize_t* nread)
|
|
|
|
|
// (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) {
|
|
|
|
|
// @see https://github.com/winlinvip/simple-rtmp-server/issues/200
|
|
|
|
|
if (nb_read < 0 && errno == ETIME) {
|
|
|
|
|
return ERROR_SOCKET_TIMEOUT;
|
|
|
|
|
}
|
|
|
|
@ -113,6 +114,7 @@ int SrsStSocket::read_fully(void* buf, size_t size, ssize_t* nread)
|
|
|
|
|
// (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) {
|
|
|
|
|
// @see https://github.com/winlinvip/simple-rtmp-server/issues/200
|
|
|
|
|
if (nb_read < 0 && errno == ETIME) {
|
|
|
|
|
return ERROR_SOCKET_TIMEOUT;
|
|
|
|
|
}
|
|
|
|
@ -141,6 +143,7 @@ int SrsStSocket::write(void* buf, size_t size, ssize_t* nwrite)
|
|
|
|
|
// 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) {
|
|
|
|
|
// @see https://github.com/winlinvip/simple-rtmp-server/issues/200
|
|
|
|
|
if (nb_write < 0 && errno == ETIME) {
|
|
|
|
|
return ERROR_SOCKET_TIMEOUT;
|
|
|
|
|
}
|
|
|
|
@ -165,6 +168,7 @@ int SrsStSocket::writev(const iovec *iov, int iov_size, ssize_t* nwrite)
|
|
|
|
|
// 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) {
|
|
|
|
|
// @see https://github.com/winlinvip/simple-rtmp-server/issues/200
|
|
|
|
|
if (nb_write < 0 && errno == ETIME) {
|
|
|
|
|
return ERROR_SOCKET_TIMEOUT;
|
|
|
|
|
}
|
|
|
|
|