diff --git a/trunk/src/app/srs_app_edge.cpp b/trunk/src/app/srs_app_edge.cpp index 3f07fd449..6ecd4409d 100644 --- a/trunk/src/app/srs_app_edge.cpp +++ b/trunk/src/app/srs_app_edge.cpp @@ -48,10 +48,10 @@ using namespace std; #include // 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; } diff --git a/trunk/src/app/srs_app_http_api.cpp b/trunk/src/app/srs_app_http_api.cpp index 86a3698ac..b31702ef2 100644 --- a/trunk/src/app/srs_app_http_api.cpp +++ b/trunk/src/app/srs_app_http_api.cpp @@ -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(); diff --git a/trunk/src/app/srs_app_http_conn.cpp b/trunk/src/app/srs_app_http_conn.cpp index 722a013b7..f1289dfbd 100644 --- a/trunk/src/app/srs_app_http_conn.cpp +++ b/trunk/src/app/srs_app_http_conn.cpp @@ -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); diff --git a/trunk/src/app/srs_app_rtmp_conn.cpp b/trunk/src/app/srs_app_rtmp_conn.cpp index c4c48b7b7..275f32ebe 100644 --- a/trunk/src/app/srs_app_rtmp_conn.cpp +++ b/trunk/src/app/srs_app_rtmp_conn.cpp @@ -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); diff --git a/trunk/src/kernel/srs_kernel_consts.hpp b/trunk/src/kernel/srs_kernel_consts.hpp index 4f22a581e..692f89624 100644 --- a/trunk/src/kernel/srs_kernel_consts.hpp +++ b/trunk/src/kernel/srs_kernel_consts.hpp @@ -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 diff --git a/trunk/src/protocol/srs_rtmp_stack.cpp b/trunk/src/protocol/srs_rtmp_stack.cpp index bcdda9d5e..fed7d98bd 100644 --- a/trunk/src/protocol/srs_rtmp_stack.cpp +++ b/trunk/src/protocol/srs_rtmp_stack.cpp @@ -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;