refine code, refine the handshake, refine the log of source_id
正在显示
3 个修改的文件
包含
8 行增加
和
9 行删除
| @@ -365,8 +365,9 @@ int SrsRtmpConn::stream_service_cycle() | @@ -365,8 +365,9 @@ int SrsRtmpConn::stream_service_cycle() | ||
| 365 | } | 365 | } |
| 366 | 366 | ||
| 367 | bool enabled_cache = _srs_config->get_gop_cache(req->vhost); | 367 | bool enabled_cache = _srs_config->get_gop_cache(req->vhost); |
| 368 | - srs_trace("source url=%s, ip=%s, cache=%d, is_edge=%d, id=%d", | ||
| 369 | - req->get_stream_url().c_str(), ip.c_str(), enabled_cache, vhost_is_edge, source->source_id()); | 368 | + srs_trace("source url=%s, ip=%s, cache=%d, is_edge=%d, source_id=%d[%d]", |
| 369 | + req->get_stream_url().c_str(), ip.c_str(), enabled_cache, vhost_is_edge, | ||
| 370 | + source->source_id(), source->source_id()); | ||
| 370 | source->set_cache(enabled_cache); | 371 | source->set_cache(enabled_cache); |
| 371 | 372 | ||
| 372 | switch (type) { | 373 | switch (type) { |
| @@ -338,7 +338,7 @@ int SrsConsumer::dump_packets(int max_count, SrsSharedPtrMessage** pmsgs, int& c | @@ -338,7 +338,7 @@ int SrsConsumer::dump_packets(int max_count, SrsSharedPtrMessage** pmsgs, int& c | ||
| 338 | srs_assert(max_count > 0); | 338 | srs_assert(max_count > 0); |
| 339 | 339 | ||
| 340 | if (should_update_source_id) { | 340 | if (should_update_source_id) { |
| 341 | - srs_trace("update source_id=%d", source->source_id()); | 341 | + srs_trace("update source_id=%d[%d]", source->source_id(), source->source_id()); |
| 342 | should_update_source_id = false; | 342 | should_update_source_id = false; |
| 343 | } | 343 | } |
| 344 | 344 |
| @@ -866,17 +866,15 @@ namespace _srs_internal | @@ -866,17 +866,15 @@ namespace _srs_internal | ||
| 866 | if (schema == srs_schema0) { | 866 | if (schema == srs_schema0) { |
| 867 | srs_key_block_init(&block0.key); | 867 | srs_key_block_init(&block0.key); |
| 868 | srs_digest_block_init(&block1.digest); | 868 | srs_digest_block_init(&block1.digest); |
| 869 | - } else { | ||
| 870 | - srs_digest_block_init(&block0.digest); | ||
| 871 | - srs_key_block_init(&block1.key); | ||
| 872 | - } | ||
| 873 | - | ||
| 874 | - if (schema == srs_schema0) { | 869 | + |
| 875 | if ((ret = openssl_generate_key(c1->block0.key.key, block0.key.key, 128)) != ERROR_SUCCESS) { | 870 | if ((ret = openssl_generate_key(c1->block0.key.key, block0.key.key, 128)) != ERROR_SUCCESS) { |
| 876 | srs_error("calc s1 key failed. ret=%d", ret); | 871 | srs_error("calc s1 key failed. ret=%d", ret); |
| 877 | return ret; | 872 | return ret; |
| 878 | } | 873 | } |
| 879 | } else { | 874 | } else { |
| 875 | + srs_digest_block_init(&block0.digest); | ||
| 876 | + srs_key_block_init(&block1.key); | ||
| 877 | + | ||
| 880 | if ((ret = openssl_generate_key(c1->block1.key.key, block1.key.key, 128)) != ERROR_SUCCESS) { | 878 | if ((ret = openssl_generate_key(c1->block1.key.key, block1.key.key, 128)) != ERROR_SUCCESS) { |
| 881 | srs_error("calc s1 key failed. ret=%d", ret); | 879 | srs_error("calc s1 key failed. ret=%d", ret); |
| 882 | return ret; | 880 | return ret; |
-
请 注册 或 登录 后发表评论