wrap read in io.ReadFull so that it actually reads everything over latency between TCP packets
This commit is contained in:
parent
6274e7a679
commit
d0c3bffd3b
1 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
package rtmp
|
package rtmp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"io"
|
||||||
"net"
|
"net"
|
||||||
"time"
|
"time"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
|
@ -225,7 +226,7 @@ func read_chunk_data(conn net.Conn, msg_ptr *Message, chnk_size uint32) (uint32,
|
||||||
} else {
|
} else {
|
||||||
buffer_end = chnk_size + msg_ptr.curr_bytes_read
|
buffer_end = chnk_size + msg_ptr.curr_bytes_read
|
||||||
}
|
}
|
||||||
n, err := conn.Read(msg_ptr.data[msg_ptr.curr_bytes_read:buffer_end])
|
n, err := io.ReadFull(conn, msg_ptr.data[msg_ptr.curr_bytes_read:buffer_end])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue