mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine buffer read socket logic.
This commit is contained in:
parent
496c5ecfde
commit
25468e4ff8
1 changed files with 1 additions and 1 deletions
|
@ -62,10 +62,10 @@ int SrsBuffer::ensure_buffer_bytes(SrsSocket* skt, int required_size)
|
||||||
{
|
{
|
||||||
int ret = ERROR_SUCCESS;
|
int ret = ERROR_SUCCESS;
|
||||||
|
|
||||||
ssize_t nread;
|
|
||||||
while (size() < required_size) {
|
while (size() < required_size) {
|
||||||
char buffer[SOCKET_READ_SIZE];
|
char buffer[SOCKET_READ_SIZE];
|
||||||
|
|
||||||
|
ssize_t nread;
|
||||||
if ((ret = skt->read(buffer, SOCKET_READ_SIZE, &nread)) != ERROR_SUCCESS) {
|
if ((ret = skt->read(buffer, SOCKET_READ_SIZE, &nread)) != ERROR_SUCCESS) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue