1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

remove the increase timeout for read, for there is no small timeout.

This commit is contained in:
winlin 2014-12-04 21:39:42 +08:00
parent 279b4ff4c9
commit 09101b8d5e

View file

@ -1113,20 +1113,6 @@ int SrsProtocol::recv_interlaced_message(SrsMessage** pmsg)
// the cid must not negative. // the cid must not negative.
srs_assert(cid >= 0); srs_assert(cid >= 0);
// once we got the chunk message header,
// that is there is a real message in cache,
// increase the timeout to got it.
// For example, in the play loop, we set timeout to 100ms,
// when we got a chunk header, we should increase the timeout,
// or we maybe timeout and disconnect the client.
int64_t timeout_us = skt->get_recv_timeout();
if (!skt->is_never_timeout(timeout_us)) {
int64_t pkt_timeout_us = srs_max(timeout_us, SRS_MIN_RECV_TIMEOUT_US);
skt->set_recv_timeout(pkt_timeout_us);
srs_verbose("change recv timeout_us "
"from %"PRId64" to %"PRId64"", timeout_us, pkt_timeout_us);
}
// get the cached chunk stream. // get the cached chunk stream.
SrsChunkStream* chunk = NULL; SrsChunkStream* chunk = NULL;
@ -1177,12 +1163,6 @@ int SrsProtocol::recv_interlaced_message(SrsMessage** pmsg)
return ret; return ret;
} }
// reset the recv timeout
if (!skt->is_never_timeout(timeout_us)) {
skt->set_recv_timeout(timeout_us);
srs_verbose("reset recv timeout_us to %"PRId64"", timeout_us);
}
// not got an entire RTMP message, try next chunk. // not got an entire RTMP message, try next chunk.
if (!msg) { if (!msg) {
srs_verbose("get partial message success. chunk_payload_size=%d, size=%d, message(type=%d, size=%d, time=%"PRId64", sid=%d)", srs_verbose("get partial message success. chunk_payload_size=%d, size=%d, message(type=%d, size=%d, time=%"PRId64", sid=%d)",