正在显示
2 个修改的文件
包含
27 行增加
和
1 行删除
| @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 31 | // current release version | 31 | // current release version |
| 32 | #define VERSION_MAJOR "0" | 32 | #define VERSION_MAJOR "0" |
| 33 | #define VERSION_MINOR "9" | 33 | #define VERSION_MINOR "9" |
| 34 | -#define VERSION_REVISION "217" | 34 | +#define VERSION_REVISION "218" |
| 35 | #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION | 35 | #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION |
| 36 | // server info. | 36 | // server info. |
| 37 | #define RTMP_SIG_SRS_KEY "SRS" | 37 | #define RTMP_SIG_SRS_KEY "SRS" |
| @@ -1263,12 +1263,17 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs | @@ -1263,12 +1263,17 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs | ||
| 1263 | { | 1263 | { |
| 1264 | int ret = ERROR_SUCCESS; | 1264 | int ret = ERROR_SUCCESS; |
| 1265 | 1265 | ||
| 1266 | + // TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180 | ||
| 1267 | + SrsHandshakeBytes* ptr = hs_bytes; | ||
| 1268 | + | ||
| 1266 | ssize_t nsize; | 1269 | ssize_t nsize; |
| 1267 | 1270 | ||
| 1268 | // complex handshake | 1271 | // complex handshake |
| 1269 | if ((ret = hs_bytes->create_c0c1()) != ERROR_SUCCESS) { | 1272 | if ((ret = hs_bytes->create_c0c1()) != ERROR_SUCCESS) { |
| 1270 | return ret; | 1273 | return ret; |
| 1271 | } | 1274 | } |
| 1275 | + // TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180 | ||
| 1276 | + srs_assert(ptr == hs_bytes); | ||
| 1272 | 1277 | ||
| 1273 | // sign c1 | 1278 | // sign c1 |
| 1274 | c1s1 c1; | 1279 | c1s1 c1; |
| @@ -1277,23 +1282,32 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs | @@ -1277,23 +1282,32 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs | ||
| 1277 | return ret; | 1282 | return ret; |
| 1278 | } | 1283 | } |
| 1279 | c1.dump(hs_bytes->c0c1 + 1); | 1284 | c1.dump(hs_bytes->c0c1 + 1); |
| 1285 | + // TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180 | ||
| 1286 | + srs_assert(ptr == hs_bytes); | ||
| 1287 | + | ||
| 1280 | // verify c1 | 1288 | // verify c1 |
| 1281 | bool is_valid; | 1289 | bool is_valid; |
| 1282 | if ((ret = c1.c1_validate_digest(is_valid)) != ERROR_SUCCESS || !is_valid) { | 1290 | if ((ret = c1.c1_validate_digest(is_valid)) != ERROR_SUCCESS || !is_valid) { |
| 1283 | ret = ERROR_RTMP_TRY_SIMPLE_HS; | 1291 | ret = ERROR_RTMP_TRY_SIMPLE_HS; |
| 1284 | return ret; | 1292 | return ret; |
| 1285 | } | 1293 | } |
| 1294 | + // TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180 | ||
| 1295 | + srs_assert(ptr == hs_bytes); | ||
| 1286 | 1296 | ||
| 1287 | if ((ret = io->write(hs_bytes->c0c1, 1537, &nsize)) != ERROR_SUCCESS) { | 1297 | if ((ret = io->write(hs_bytes->c0c1, 1537, &nsize)) != ERROR_SUCCESS) { |
| 1288 | srs_warn("write c0c1 failed. ret=%d", ret); | 1298 | srs_warn("write c0c1 failed. ret=%d", ret); |
| 1289 | return ret; | 1299 | return ret; |
| 1290 | } | 1300 | } |
| 1291 | srs_verbose("write c0c1 success."); | 1301 | srs_verbose("write c0c1 success."); |
| 1302 | + // TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180 | ||
| 1303 | + srs_assert(ptr == hs_bytes); | ||
| 1292 | 1304 | ||
| 1293 | // s0s1s2 | 1305 | // s0s1s2 |
| 1294 | if ((ret = hs_bytes->read_s0s1s2(io)) != ERROR_SUCCESS) { | 1306 | if ((ret = hs_bytes->read_s0s1s2(io)) != ERROR_SUCCESS) { |
| 1295 | return ret; | 1307 | return ret; |
| 1296 | } | 1308 | } |
| 1309 | + // TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180 | ||
| 1310 | + srs_assert(ptr == hs_bytes); | ||
| 1297 | 1311 | ||
| 1298 | // plain text required. | 1312 | // plain text required. |
| 1299 | if (hs_bytes->s0s1s2[0] != 0x03) { | 1313 | if (hs_bytes->s0s1s2[0] != 0x03) { |
| @@ -1301,12 +1315,16 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs | @@ -1301,12 +1315,16 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs | ||
| 1301 | srs_warn("handshake failed, plain text required. ret=%d", ret); | 1315 | srs_warn("handshake failed, plain text required. ret=%d", ret); |
| 1302 | return ret; | 1316 | return ret; |
| 1303 | } | 1317 | } |
| 1318 | + // TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180 | ||
| 1319 | + srs_assert(ptr == hs_bytes); | ||
| 1304 | 1320 | ||
| 1305 | // verify s1s2 | 1321 | // verify s1s2 |
| 1306 | c1s1 s1; | 1322 | c1s1 s1; |
| 1307 | if ((ret = s1.parse(hs_bytes->s0s1s2 + 1, c1.schema)) != ERROR_SUCCESS) { | 1323 | if ((ret = s1.parse(hs_bytes->s0s1s2 + 1, c1.schema)) != ERROR_SUCCESS) { |
| 1308 | return ret; | 1324 | return ret; |
| 1309 | } | 1325 | } |
| 1326 | + // TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180 | ||
| 1327 | + srs_assert(ptr == hs_bytes); | ||
| 1310 | 1328 | ||
| 1311 | // never verify the s1, | 1329 | // never verify the s1, |
| 1312 | // for if forward to nginx-rtmp, verify s1 will failed, | 1330 | // for if forward to nginx-rtmp, verify s1 will failed, |
| @@ -1316,16 +1334,24 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs | @@ -1316,16 +1334,24 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs | ||
| 1316 | if ((ret = hs_bytes->create_c2()) != ERROR_SUCCESS) { | 1334 | if ((ret = hs_bytes->create_c2()) != ERROR_SUCCESS) { |
| 1317 | return ret; | 1335 | return ret; |
| 1318 | } | 1336 | } |
| 1337 | + // TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180 | ||
| 1338 | + srs_assert(ptr == hs_bytes); | ||
| 1339 | + | ||
| 1319 | c2s2 c2; | 1340 | c2s2 c2; |
| 1320 | if ((ret = c2.c2_create(&s1)) != ERROR_SUCCESS) { | 1341 | if ((ret = c2.c2_create(&s1)) != ERROR_SUCCESS) { |
| 1321 | return ret; | 1342 | return ret; |
| 1322 | } | 1343 | } |
| 1344 | + // TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180 | ||
| 1345 | + srs_assert(ptr == hs_bytes); | ||
| 1346 | + | ||
| 1323 | c2.dump(hs_bytes->c2); | 1347 | c2.dump(hs_bytes->c2); |
| 1324 | if ((ret = io->write(hs_bytes->c2, 1536, &nsize)) != ERROR_SUCCESS) { | 1348 | if ((ret = io->write(hs_bytes->c2, 1536, &nsize)) != ERROR_SUCCESS) { |
| 1325 | srs_warn("complex handshake write c2 failed. ret=%d", ret); | 1349 | srs_warn("complex handshake write c2 failed. ret=%d", ret); |
| 1326 | return ret; | 1350 | return ret; |
| 1327 | } | 1351 | } |
| 1328 | srs_verbose("complex handshake write c2 success."); | 1352 | srs_verbose("complex handshake write c2 success."); |
| 1353 | + // TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180 | ||
| 1354 | + srs_assert(ptr == hs_bytes); | ||
| 1329 | 1355 | ||
| 1330 | srs_trace("complex handshake success."); | 1356 | srs_trace("complex handshake success."); |
| 1331 | 1357 |
-
请 注册 或 登录 后发表评论