1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 03:41:55 +00:00

Refine name TMMS to TIMEOUT

This commit is contained in:
winlin 2019-04-18 07:47:35 +08:00
parent 5505eceeac
commit 33c66b64c5
6 changed files with 19 additions and 19 deletions

View file

@ -48,10 +48,10 @@ using namespace std;
#include <srs_app_rtmp_conn.hpp>
// when edge timeout, retry next.
#define SRS_EDGE_INGESTER_TMMS (5 * SRS_UTIME_SECONDS)
#define SRS_EDGE_INGESTER_TIMEOUT (5 * SRS_UTIME_SECONDS)
// when edge error, wait for quit
#define SRS_EDGE_FORWARDER_TMMS (150 * SRS_UTIME_MILLISECONDS)
#define SRS_EDGE_FORWARDER_TIMEOUT (150 * SRS_UTIME_MILLISECONDS)
SrsEdgeUpstream::SrsEdgeUpstream()
{
@ -114,7 +114,7 @@ srs_error_t SrsEdgeRtmpUpstream::connect(SrsRequest* r, SrsLbRoundRobin* lb)
}
srs_freep(sdk);
int64_t cto = srsu2ms(SRS_EDGE_INGESTER_TMMS);
int64_t cto = srsu2ms(SRS_EDGE_INGESTER_TIMEOUT);
int64_t sto = srsu2ms(SRS_CONSTS_RTMP_PULSE);
sdk = new SrsSimpleRtmpClient(url, cto, sto);
@ -294,7 +294,7 @@ srs_error_t SrsEdgeIngester::ingest()
SrsAutoFree(SrsPithyPrint, pprint);
// set to larger timeout to read av data from origin.
upstream->set_recv_timeout(SRS_EDGE_INGESTER_TMMS);
upstream->set_recv_timeout(SRS_EDGE_INGESTER_TIMEOUT);
while (true) {
srs_error_t err = srs_success;
@ -475,7 +475,7 @@ srs_error_t SrsEdgeForwarder::start()
// open socket.
srs_freep(sdk);
// TODO: FIXME: Should switch cto with sto?
int64_t cto = srsu2ms(SRS_EDGE_FORWARDER_TMMS);
int64_t cto = srsu2ms(SRS_EDGE_FORWARDER_TIMEOUT);
int64_t sto = srsu2ms(SRS_CONSTS_RTMP_TIMEOUT);
sdk = new SrsSimpleRtmpClient(url, cto, sto);
@ -546,7 +546,7 @@ srs_error_t SrsEdgeForwarder::do_cycle()
}
if (send_error_code != ERROR_SUCCESS) {
srs_usleep(SRS_EDGE_FORWARDER_TMMS);
srs_usleep(SRS_EDGE_FORWARDER_TIMEOUT);
continue;
}

View file

@ -1354,7 +1354,7 @@ srs_error_t SrsHttpApi::do_cycle()
// set the recv timeout, for some clients never disconnect the connection.
// @see https://github.com/ossrs/srs/issues/398
skt->set_recv_timeout(SRS_HTTP_RECV_TMMS);
skt->set_recv_timeout(SRS_HTTP_RECV_TIMEOUT);
// initialize the cors, which will proxy to mux.
bool crossdomain_enabled = _srs_config->get_http_api_crossdomain();

View file

@ -90,7 +90,7 @@ srs_error_t SrsHttpConn::do_cycle()
// set the recv timeout, for some clients never disconnect the connection.
// @see https://github.com/ossrs/srs/issues/398
skt->set_recv_timeout(SRS_HTTP_RECV_TMMS);
skt->set_recv_timeout(SRS_HTTP_RECV_TIMEOUT);
SrsRequest* last_req = NULL;
SrsAutoFree(SrsRequest, last_req);

View file

@ -64,15 +64,15 @@ using namespace std;
// the timeout in ms to wait encoder to republish
// if timeout, close the connection.
#define SRS_REPUBLISH_SEND_TMMS (3 * SRS_UTIME_MINUTES)
#define SRS_REPUBLISH_SEND_TIMEOUT (3 * SRS_UTIME_MINUTES)
// if timeout, close the connection.
#define SRS_REPUBLISH_RECV_TMMS (3 * SRS_UTIME_MINUTES)
#define SRS_REPUBLISH_RECV_TIMEOUT (3 * SRS_UTIME_MINUTES)
// the timeout in ms to wait client data, when client paused
// if timeout, close the connection.
#define SRS_PAUSED_SEND_TMMS (3 * SRS_UTIME_MINUTES)
#define SRS_PAUSED_SEND_TIMEOUT (3 * SRS_UTIME_MINUTES)
// if timeout, close the connection.
#define SRS_PAUSED_RECV_TMMS (3 * SRS_UTIME_MINUTES)
#define SRS_PAUSED_RECV_TIMEOUT (3 * SRS_UTIME_MINUTES)
// when edge timeout, retry next.
#define SRS_EDGE_TOKEN_TRAVERSE_TIMEOUT (3 * SRS_UTIME_SECONDS)
@ -410,8 +410,8 @@ srs_error_t SrsRtmpConn::service_cycle()
// for republish, continue service
if (srs_error_code(err) == ERROR_CONTROL_REPUBLISH) {
// set timeout to a larger value, wait for encoder to republish.
rtmp->set_send_timeout(SRS_REPUBLISH_RECV_TMMS);
rtmp->set_recv_timeout(SRS_REPUBLISH_SEND_TMMS);
rtmp->set_send_timeout(SRS_REPUBLISH_RECV_TIMEOUT);
rtmp->set_recv_timeout(SRS_REPUBLISH_SEND_TIMEOUT);
srs_trace("rtmp: retry for republish");
srs_freep(err);
@ -424,8 +424,8 @@ srs_error_t SrsRtmpConn::service_cycle()
// TODO: FIXME: use ping message to anti-death of socket.
// @see: https://github.com/ossrs/srs/issues/39
// set timeout to a larger value, for user paused.
rtmp->set_recv_timeout(SRS_PAUSED_RECV_TMMS);
rtmp->set_send_timeout(SRS_PAUSED_SEND_TMMS);
rtmp->set_recv_timeout(SRS_PAUSED_RECV_TIMEOUT);
rtmp->set_send_timeout(SRS_PAUSED_SEND_TIMEOUT);
srs_trace("rtmp: retry for close");
srs_freep(err);

View file

@ -221,7 +221,7 @@
#define SRS_CONSTS_HTTP_QUERY_SEP '?'
// the default recv timeout.
#define SRS_HTTP_RECV_TMMS (60 * SRS_UTIME_SECONDS)
#define SRS_HTTP_RECV_TIMEOUT (60 * SRS_UTIME_SECONDS)
// 6.1.1 Status Code and Reason Phrase
#define SRS_CONSTS_HTTP_Continue 100

View file

@ -2408,7 +2408,7 @@ srs_error_t SrsRtmpServer::response_connect_app(SrsRequest *req, const char* ser
return err;
}
#define SRS_RTMP_REDIRECT_TMMS (3 * SRS_UTIME_SECONDS)
#define SRS_RTMP_REDIRECT_TIMEOUT (3 * SRS_UTIME_SECONDS)
srs_error_t SrsRtmpServer::redirect(SrsRequest* r, string host, int port, bool& accepted)
{
srs_error_t err = srs_success;
@ -2434,7 +2434,7 @@ srs_error_t SrsRtmpServer::redirect(SrsRequest* r, string host, int port, bool&
// client must response a call message.
// or we never know whether the client is ok to redirect.
protocol->set_recv_timeout(SRS_RTMP_REDIRECT_TMMS);
protocol->set_recv_timeout(SRS_RTMP_REDIRECT_TIMEOUT);
if (true) {
SrsCommonMessage* msg = NULL;
SrsCallPacket* pkt = NULL;