正在显示
5 个修改的文件
包含
21 行增加
和
21 行删除
| @@ -122,8 +122,8 @@ int SrsEdgeIngester::cycle() | @@ -122,8 +122,8 @@ int SrsEdgeIngester::cycle() | ||
| 122 | } | 122 | } |
| 123 | srs_assert(client); | 123 | srs_assert(client); |
| 124 | 124 | ||
| 125 | - client->set_recv_timeout(SRS_RECV_TIMEOUT_US); | ||
| 126 | - client->set_send_timeout(SRS_SEND_TIMEOUT_US); | 125 | + client->set_recv_timeout(SRS_CONSTS_RTMP_RECV_TIMEOUT_US); |
| 126 | + client->set_send_timeout(SRS_CONSTS_RTMP_SEND_TIMEOUT_US); | ||
| 127 | 127 | ||
| 128 | SrsRequest* req = _req; | 128 | SrsRequest* req = _req; |
| 129 | 129 | ||
| @@ -368,8 +368,8 @@ int SrsEdgeForwarder::start() | @@ -368,8 +368,8 @@ int SrsEdgeForwarder::start() | ||
| 368 | } | 368 | } |
| 369 | srs_assert(client); | 369 | srs_assert(client); |
| 370 | 370 | ||
| 371 | - client->set_recv_timeout(SRS_RECV_TIMEOUT_US); | ||
| 372 | - client->set_send_timeout(SRS_SEND_TIMEOUT_US); | 371 | + client->set_recv_timeout(SRS_CONSTS_RTMP_RECV_TIMEOUT_US); |
| 372 | + client->set_send_timeout(SRS_CONSTS_RTMP_SEND_TIMEOUT_US); | ||
| 373 | 373 | ||
| 374 | SrsRequest* req = _req; | 374 | SrsRequest* req = _req; |
| 375 | 375 | ||
| @@ -411,7 +411,7 @@ int SrsEdgeForwarder::cycle() | @@ -411,7 +411,7 @@ int SrsEdgeForwarder::cycle() | ||
| 411 | { | 411 | { |
| 412 | int ret = ERROR_SUCCESS; | 412 | int ret = ERROR_SUCCESS; |
| 413 | 413 | ||
| 414 | - client->set_recv_timeout(SRS_PULSE_TIMEOUT_US); | 414 | + client->set_recv_timeout(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US); |
| 415 | 415 | ||
| 416 | SrsPithyPrint pithy_print(SRS_STAGE_EDGE); | 416 | SrsPithyPrint pithy_print(SRS_STAGE_EDGE); |
| 417 | 417 |
| @@ -208,8 +208,8 @@ int SrsForwarder::cycle() | @@ -208,8 +208,8 @@ int SrsForwarder::cycle() | ||
| 208 | } | 208 | } |
| 209 | srs_assert(client); | 209 | srs_assert(client); |
| 210 | 210 | ||
| 211 | - client->set_recv_timeout(SRS_RECV_TIMEOUT_US); | ||
| 212 | - client->set_send_timeout(SRS_SEND_TIMEOUT_US); | 211 | + client->set_recv_timeout(SRS_CONSTS_RTMP_RECV_TIMEOUT_US); |
| 212 | + client->set_send_timeout(SRS_CONSTS_RTMP_SEND_TIMEOUT_US); | ||
| 213 | 213 | ||
| 214 | if ((ret = client->handshake()) != ERROR_SUCCESS) { | 214 | if ((ret = client->handshake()) != ERROR_SUCCESS) { |
| 215 | srs_error("handshake with server failed. ret=%d", ret); | 215 | srs_error("handshake with server failed. ret=%d", ret); |
| @@ -282,7 +282,7 @@ int SrsForwarder::forward() | @@ -282,7 +282,7 @@ int SrsForwarder::forward() | ||
| 282 | { | 282 | { |
| 283 | int ret = ERROR_SUCCESS; | 283 | int ret = ERROR_SUCCESS; |
| 284 | 284 | ||
| 285 | - client->set_recv_timeout(SRS_PULSE_TIMEOUT_US); | 285 | + client->set_recv_timeout(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US); |
| 286 | 286 | ||
| 287 | SrsPithyPrint pithy_print(SRS_STAGE_FORWARDER); | 287 | SrsPithyPrint pithy_print(SRS_STAGE_FORWARDER); |
| 288 | 288 |
| @@ -115,8 +115,8 @@ int SrsRtmpConn::do_cycle() | @@ -115,8 +115,8 @@ int SrsRtmpConn::do_cycle() | ||
| 115 | 115 | ||
| 116 | srs_trace("RTMP client ip=%s", ip.c_str()); | 116 | srs_trace("RTMP client ip=%s", ip.c_str()); |
| 117 | 117 | ||
| 118 | - rtmp->set_recv_timeout(SRS_RECV_TIMEOUT_US); | ||
| 119 | - rtmp->set_send_timeout(SRS_SEND_TIMEOUT_US); | 118 | + rtmp->set_recv_timeout(SRS_CONSTS_RTMP_RECV_TIMEOUT_US); |
| 119 | + rtmp->set_send_timeout(SRS_CONSTS_RTMP_SEND_TIMEOUT_US); | ||
| 120 | 120 | ||
| 121 | if ((ret = rtmp->handshake()) != ERROR_SUCCESS) { | 121 | if ((ret = rtmp->handshake()) != ERROR_SUCCESS) { |
| 122 | srs_error("rtmp handshake failed. ret=%d", ret); | 122 | srs_error("rtmp handshake failed. ret=%d", ret); |
| @@ -290,8 +290,8 @@ int SrsRtmpConn::stream_service_cycle() | @@ -290,8 +290,8 @@ int SrsRtmpConn::stream_service_cycle() | ||
| 290 | srs_client_type_string(type).c_str(), req->stream.c_str(), req->duration); | 290 | srs_client_type_string(type).c_str(), req->stream.c_str(), req->duration); |
| 291 | 291 | ||
| 292 | // client is identified, set the timeout to service timeout. | 292 | // client is identified, set the timeout to service timeout. |
| 293 | - rtmp->set_recv_timeout(SRS_RECV_TIMEOUT_US); | ||
| 294 | - rtmp->set_send_timeout(SRS_SEND_TIMEOUT_US); | 293 | + rtmp->set_recv_timeout(SRS_CONSTS_RTMP_RECV_TIMEOUT_US); |
| 294 | + rtmp->set_send_timeout(SRS_CONSTS_RTMP_SEND_TIMEOUT_US); | ||
| 295 | 295 | ||
| 296 | // set chunk size to larger. | 296 | // set chunk size to larger. |
| 297 | int chunk_size = _srs_config->get_chunk_size(req->vhost); | 297 | int chunk_size = _srs_config->get_chunk_size(req->vhost); |
| @@ -501,7 +501,7 @@ int SrsRtmpConn::playing(SrsSource* source) | @@ -501,7 +501,7 @@ int SrsRtmpConn::playing(SrsSource* source) | ||
| 501 | SrsAutoFree(SrsConsumer, consumer); | 501 | SrsAutoFree(SrsConsumer, consumer); |
| 502 | srs_verbose("consumer created success."); | 502 | srs_verbose("consumer created success."); |
| 503 | 503 | ||
| 504 | - rtmp->set_recv_timeout(SRS_PULSE_TIMEOUT_US); | 504 | + rtmp->set_recv_timeout(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US); |
| 505 | 505 | ||
| 506 | SrsPithyPrint pithy_print(SRS_STAGE_PLAY_USER); | 506 | SrsPithyPrint pithy_print(SRS_STAGE_PLAY_USER); |
| 507 | 507 | ||
| @@ -962,8 +962,8 @@ int SrsRtmpConn::do_token_traverse_auth(SrsSocket* io, SrsRtmpClient* client) | @@ -962,8 +962,8 @@ int SrsRtmpConn::do_token_traverse_auth(SrsSocket* io, SrsRtmpClient* client) | ||
| 962 | 962 | ||
| 963 | srs_assert(client); | 963 | srs_assert(client); |
| 964 | 964 | ||
| 965 | - client->set_recv_timeout(SRS_RECV_TIMEOUT_US); | ||
| 966 | - client->set_send_timeout(SRS_SEND_TIMEOUT_US); | 965 | + client->set_recv_timeout(SRS_CONSTS_RTMP_RECV_TIMEOUT_US); |
| 966 | + client->set_send_timeout(SRS_CONSTS_RTMP_SEND_TIMEOUT_US); | ||
| 967 | 967 | ||
| 968 | if ((ret = client->handshake()) != ERROR_SUCCESS) { | 968 | if ((ret = client->handshake()) != ERROR_SUCCESS) { |
| 969 | srs_error("handshake with server failed. ret=%d", ret); | 969 | srs_error("handshake with server failed. ret=%d", ret); |
| @@ -55,16 +55,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -55,16 +55,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 55 | 55 | ||
| 56 | // the timeout to wait client data, | 56 | // the timeout to wait client data, |
| 57 | // if timeout, close the connection. | 57 | // if timeout, close the connection. |
| 58 | -#define SRS_SEND_TIMEOUT_US (int64_t)(30*1000*1000LL) | 58 | +#define SRS_CONSTS_RTMP_SEND_TIMEOUT_US (int64_t)(30*1000*1000LL) |
| 59 | 59 | ||
| 60 | // the timeout to send data to client, | 60 | // the timeout to send data to client, |
| 61 | // if timeout, close the connection. | 61 | // if timeout, close the connection. |
| 62 | -#define SRS_RECV_TIMEOUT_US (int64_t)(30*1000*1000LL) | 62 | +#define SRS_CONSTS_RTMP_RECV_TIMEOUT_US (int64_t)(30*1000*1000LL) |
| 63 | 63 | ||
| 64 | // the timeout to wait for client control message, | 64 | // the timeout to wait for client control message, |
| 65 | // if timeout, we generally ignore and send the data to client, | 65 | // if timeout, we generally ignore and send the data to client, |
| 66 | // generally, it's the pulse time for data seding. | 66 | // generally, it's the pulse time for data seding. |
| 67 | -#define SRS_PULSE_TIMEOUT_US (int64_t)(200*1000LL) | 67 | +#define SRS_CONSTS_RTMP_PULSE_TIMEOUT_US (int64_t)(200*1000LL) |
| 68 | 68 | ||
| 69 | /** | 69 | /** |
| 70 | * max rtmp header size: | 70 | * max rtmp header size: |
| @@ -73,7 +73,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -73,7 +73,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 73 | * 4bytes timestamp header, | 73 | * 4bytes timestamp header, |
| 74 | * that is, 1+11+4=16bytes. | 74 | * that is, 1+11+4=16bytes. |
| 75 | */ | 75 | */ |
| 76 | -#define RTMP_MAX_FMT0_HEADER_SIZE 16 | 76 | +#define SRS_CONSTS_RTMP_MAX_FMT0_HEADER_SIZE 16 |
| 77 | /** | 77 | /** |
| 78 | * max rtmp header size: | 78 | * max rtmp header size: |
| 79 | * 1bytes basic header, | 79 | * 1bytes basic header, |
| @@ -81,7 +81,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -81,7 +81,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 81 | * that is, 1+4=5bytes. | 81 | * that is, 1+4=5bytes. |
| 82 | */ | 82 | */ |
| 83 | // always use fmt0 as cache. | 83 | // always use fmt0 as cache. |
| 84 | -//#define RTMP_MAX_FMT3_HEADER_SIZE 5 | 84 | +//#define SRS_CONSTS_RTMP_MAX_FMT3_HEADER_SIZE 5 |
| 85 | 85 | ||
| 86 | /////////////////////////////////////////////////////////// | 86 | /////////////////////////////////////////////////////////// |
| 87 | /////////////////////////////////////////////////////////// | 87 | /////////////////////////////////////////////////////////// |
| @@ -100,7 +100,7 @@ private: | @@ -100,7 +100,7 @@ private: | ||
| 100 | * used for type0, 11bytes(or 15bytes with extended timestamp) header. | 100 | * used for type0, 11bytes(or 15bytes with extended timestamp) header. |
| 101 | * or for type3, 1bytes(or 5bytes with extended timestamp) header. | 101 | * or for type3, 1bytes(or 5bytes with extended timestamp) header. |
| 102 | */ | 102 | */ |
| 103 | - char out_header_cache[RTMP_MAX_FMT0_HEADER_SIZE]; | 103 | + char out_header_cache[SRS_CONSTS_RTMP_MAX_FMT0_HEADER_SIZE]; |
| 104 | /** | 104 | /** |
| 105 | * output chunk size, default to 128, set by config. | 105 | * output chunk size, default to 128, set by config. |
| 106 | */ | 106 | */ |
-
请 注册 或 登录 后发表评论