mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
Refine name TMMS to TIMEOUT
This commit is contained in:
parent
5505eceeac
commit
33c66b64c5
6 changed files with 19 additions and 19 deletions
|
@ -48,10 +48,10 @@ using namespace std;
|
||||||
#include <srs_app_rtmp_conn.hpp>
|
#include <srs_app_rtmp_conn.hpp>
|
||||||
|
|
||||||
// when edge timeout, retry next.
|
// 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
|
// 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()
|
SrsEdgeUpstream::SrsEdgeUpstream()
|
||||||
{
|
{
|
||||||
|
@ -114,7 +114,7 @@ srs_error_t SrsEdgeRtmpUpstream::connect(SrsRequest* r, SrsLbRoundRobin* lb)
|
||||||
}
|
}
|
||||||
|
|
||||||
srs_freep(sdk);
|
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);
|
int64_t sto = srsu2ms(SRS_CONSTS_RTMP_PULSE);
|
||||||
sdk = new SrsSimpleRtmpClient(url, cto, sto);
|
sdk = new SrsSimpleRtmpClient(url, cto, sto);
|
||||||
|
|
||||||
|
@ -294,7 +294,7 @@ srs_error_t SrsEdgeIngester::ingest()
|
||||||
SrsAutoFree(SrsPithyPrint, pprint);
|
SrsAutoFree(SrsPithyPrint, pprint);
|
||||||
|
|
||||||
// set to larger timeout to read av data from origin.
|
// 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) {
|
while (true) {
|
||||||
srs_error_t err = srs_success;
|
srs_error_t err = srs_success;
|
||||||
|
@ -475,7 +475,7 @@ srs_error_t SrsEdgeForwarder::start()
|
||||||
// open socket.
|
// open socket.
|
||||||
srs_freep(sdk);
|
srs_freep(sdk);
|
||||||
// TODO: FIXME: Should switch cto with sto?
|
// 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);
|
int64_t sto = srsu2ms(SRS_CONSTS_RTMP_TIMEOUT);
|
||||||
sdk = new SrsSimpleRtmpClient(url, cto, sto);
|
sdk = new SrsSimpleRtmpClient(url, cto, sto);
|
||||||
|
|
||||||
|
@ -546,7 +546,7 @@ srs_error_t SrsEdgeForwarder::do_cycle()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (send_error_code != ERROR_SUCCESS) {
|
if (send_error_code != ERROR_SUCCESS) {
|
||||||
srs_usleep(SRS_EDGE_FORWARDER_TMMS);
|
srs_usleep(SRS_EDGE_FORWARDER_TIMEOUT);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1354,7 +1354,7 @@ srs_error_t SrsHttpApi::do_cycle()
|
||||||
|
|
||||||
// set the recv timeout, for some clients never disconnect the connection.
|
// set the recv timeout, for some clients never disconnect the connection.
|
||||||
// @see https://github.com/ossrs/srs/issues/398
|
// @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.
|
// initialize the cors, which will proxy to mux.
|
||||||
bool crossdomain_enabled = _srs_config->get_http_api_crossdomain();
|
bool crossdomain_enabled = _srs_config->get_http_api_crossdomain();
|
||||||
|
|
|
@ -90,7 +90,7 @@ srs_error_t SrsHttpConn::do_cycle()
|
||||||
|
|
||||||
// set the recv timeout, for some clients never disconnect the connection.
|
// set the recv timeout, for some clients never disconnect the connection.
|
||||||
// @see https://github.com/ossrs/srs/issues/398
|
// @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;
|
SrsRequest* last_req = NULL;
|
||||||
SrsAutoFree(SrsRequest, last_req);
|
SrsAutoFree(SrsRequest, last_req);
|
||||||
|
|
|
@ -64,15 +64,15 @@ using namespace std;
|
||||||
|
|
||||||
// the timeout in ms to wait encoder to republish
|
// the timeout in ms to wait encoder to republish
|
||||||
// if timeout, close the connection.
|
// 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.
|
// 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
|
// the timeout in ms to wait client data, when client paused
|
||||||
// if timeout, close the connection.
|
// 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.
|
// 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.
|
// when edge timeout, retry next.
|
||||||
#define SRS_EDGE_TOKEN_TRAVERSE_TIMEOUT (3 * SRS_UTIME_SECONDS)
|
#define SRS_EDGE_TOKEN_TRAVERSE_TIMEOUT (3 * SRS_UTIME_SECONDS)
|
||||||
|
@ -410,8 +410,8 @@ srs_error_t SrsRtmpConn::service_cycle()
|
||||||
// for republish, continue service
|
// for republish, continue service
|
||||||
if (srs_error_code(err) == ERROR_CONTROL_REPUBLISH) {
|
if (srs_error_code(err) == ERROR_CONTROL_REPUBLISH) {
|
||||||
// set timeout to a larger value, wait for encoder to republish.
|
// set timeout to a larger value, wait for encoder to republish.
|
||||||
rtmp->set_send_timeout(SRS_REPUBLISH_RECV_TMMS);
|
rtmp->set_send_timeout(SRS_REPUBLISH_RECV_TIMEOUT);
|
||||||
rtmp->set_recv_timeout(SRS_REPUBLISH_SEND_TMMS);
|
rtmp->set_recv_timeout(SRS_REPUBLISH_SEND_TIMEOUT);
|
||||||
|
|
||||||
srs_trace("rtmp: retry for republish");
|
srs_trace("rtmp: retry for republish");
|
||||||
srs_freep(err);
|
srs_freep(err);
|
||||||
|
@ -424,8 +424,8 @@ srs_error_t SrsRtmpConn::service_cycle()
|
||||||
// TODO: FIXME: use ping message to anti-death of socket.
|
// TODO: FIXME: use ping message to anti-death of socket.
|
||||||
// @see: https://github.com/ossrs/srs/issues/39
|
// @see: https://github.com/ossrs/srs/issues/39
|
||||||
// set timeout to a larger value, for user paused.
|
// set timeout to a larger value, for user paused.
|
||||||
rtmp->set_recv_timeout(SRS_PAUSED_RECV_TMMS);
|
rtmp->set_recv_timeout(SRS_PAUSED_RECV_TIMEOUT);
|
||||||
rtmp->set_send_timeout(SRS_PAUSED_SEND_TMMS);
|
rtmp->set_send_timeout(SRS_PAUSED_SEND_TIMEOUT);
|
||||||
|
|
||||||
srs_trace("rtmp: retry for close");
|
srs_trace("rtmp: retry for close");
|
||||||
srs_freep(err);
|
srs_freep(err);
|
||||||
|
|
|
@ -221,7 +221,7 @@
|
||||||
#define SRS_CONSTS_HTTP_QUERY_SEP '?'
|
#define SRS_CONSTS_HTTP_QUERY_SEP '?'
|
||||||
|
|
||||||
// the default recv timeout.
|
// 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
|
// 6.1.1 Status Code and Reason Phrase
|
||||||
#define SRS_CONSTS_HTTP_Continue 100
|
#define SRS_CONSTS_HTTP_Continue 100
|
||||||
|
|
|
@ -2408,7 +2408,7 @@ srs_error_t SrsRtmpServer::response_connect_app(SrsRequest *req, const char* ser
|
||||||
return err;
|
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 SrsRtmpServer::redirect(SrsRequest* r, string host, int port, bool& accepted)
|
||||||
{
|
{
|
||||||
srs_error_t err = srs_success;
|
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.
|
// client must response a call message.
|
||||||
// or we never know whether the client is ok to redirect.
|
// 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) {
|
if (true) {
|
||||||
SrsCommonMessage* msg = NULL;
|
SrsCommonMessage* msg = NULL;
|
||||||
SrsCallPacket* pkt = NULL;
|
SrsCallPacket* pkt = NULL;
|
||||||
|
|
Loading…
Reference in a new issue