mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
remove the dead code for bug #180
This commit is contained in:
parent
fca500fae6
commit
2be014e4f5
1 changed files with 0 additions and 23 deletions
|
@ -1263,17 +1263,12 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs
|
||||||
{
|
{
|
||||||
int ret = ERROR_SUCCESS;
|
int ret = ERROR_SUCCESS;
|
||||||
|
|
||||||
// TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180
|
|
||||||
SrsHandshakeBytes* ptr = hs_bytes;
|
|
||||||
|
|
||||||
ssize_t nsize;
|
ssize_t nsize;
|
||||||
|
|
||||||
// complex handshake
|
// complex handshake
|
||||||
if ((ret = hs_bytes->create_c0c1()) != ERROR_SUCCESS) {
|
if ((ret = hs_bytes->create_c0c1()) != ERROR_SUCCESS) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
// TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180
|
|
||||||
srs_assert(ptr == hs_bytes);
|
|
||||||
|
|
||||||
// sign c1
|
// sign c1
|
||||||
c1s1 c1;
|
c1s1 c1;
|
||||||
|
@ -1282,8 +1277,6 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
c1.dump(hs_bytes->c0c1 + 1);
|
c1.dump(hs_bytes->c0c1 + 1);
|
||||||
// TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180
|
|
||||||
srs_assert(ptr == hs_bytes);
|
|
||||||
|
|
||||||
// verify c1
|
// verify c1
|
||||||
bool is_valid;
|
bool is_valid;
|
||||||
|
@ -1291,23 +1284,17 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs
|
||||||
ret = ERROR_RTMP_TRY_SIMPLE_HS;
|
ret = ERROR_RTMP_TRY_SIMPLE_HS;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
// TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180
|
|
||||||
srs_assert(ptr == hs_bytes);
|
|
||||||
|
|
||||||
if ((ret = io->write(hs_bytes->c0c1, 1537, &nsize)) != ERROR_SUCCESS) {
|
if ((ret = io->write(hs_bytes->c0c1, 1537, &nsize)) != ERROR_SUCCESS) {
|
||||||
srs_warn("write c0c1 failed. ret=%d", ret);
|
srs_warn("write c0c1 failed. ret=%d", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
srs_verbose("write c0c1 success.");
|
srs_verbose("write c0c1 success.");
|
||||||
// TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180
|
|
||||||
srs_assert(ptr == hs_bytes);
|
|
||||||
|
|
||||||
// s0s1s2
|
// s0s1s2
|
||||||
if ((ret = hs_bytes->read_s0s1s2(io)) != ERROR_SUCCESS) {
|
if ((ret = hs_bytes->read_s0s1s2(io)) != ERROR_SUCCESS) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
// TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180
|
|
||||||
srs_assert(ptr == hs_bytes);
|
|
||||||
|
|
||||||
// plain text required.
|
// plain text required.
|
||||||
if (hs_bytes->s0s1s2[0] != 0x03) {
|
if (hs_bytes->s0s1s2[0] != 0x03) {
|
||||||
|
@ -1315,16 +1302,12 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs
|
||||||
srs_warn("handshake failed, plain text required. ret=%d", ret);
|
srs_warn("handshake failed, plain text required. ret=%d", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
// TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180
|
|
||||||
srs_assert(ptr == hs_bytes);
|
|
||||||
|
|
||||||
// verify s1s2
|
// verify s1s2
|
||||||
c1s1 s1;
|
c1s1 s1;
|
||||||
if ((ret = s1.parse(hs_bytes->s0s1s2 + 1, c1.schema)) != ERROR_SUCCESS) {
|
if ((ret = s1.parse(hs_bytes->s0s1s2 + 1, c1.schema)) != ERROR_SUCCESS) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
// TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180
|
|
||||||
srs_assert(ptr == hs_bytes);
|
|
||||||
|
|
||||||
// never verify the s1,
|
// never verify the s1,
|
||||||
// for if forward to nginx-rtmp, verify s1 will failed,
|
// for if forward to nginx-rtmp, verify s1 will failed,
|
||||||
|
@ -1334,15 +1317,11 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs
|
||||||
if ((ret = hs_bytes->create_c2()) != ERROR_SUCCESS) {
|
if ((ret = hs_bytes->create_c2()) != ERROR_SUCCESS) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
// TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180
|
|
||||||
srs_assert(ptr == hs_bytes);
|
|
||||||
|
|
||||||
c2s2 c2;
|
c2s2 c2;
|
||||||
if ((ret = c2.c2_create(&s1)) != ERROR_SUCCESS) {
|
if ((ret = c2.c2_create(&s1)) != ERROR_SUCCESS) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
// TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180
|
|
||||||
srs_assert(ptr == hs_bytes);
|
|
||||||
|
|
||||||
c2.dump(hs_bytes->c2);
|
c2.dump(hs_bytes->c2);
|
||||||
if ((ret = io->write(hs_bytes->c2, 1536, &nsize)) != ERROR_SUCCESS) {
|
if ((ret = io->write(hs_bytes->c2, 1536, &nsize)) != ERROR_SUCCESS) {
|
||||||
|
@ -1350,8 +1329,6 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
srs_verbose("complex handshake write c2 success.");
|
srs_verbose("complex handshake write c2 success.");
|
||||||
// TODO: FIXME: check memory corrupt, for https://github.com/winlinvip/simple-rtmp-server/issues/180
|
|
||||||
srs_assert(ptr == hs_bytes);
|
|
||||||
|
|
||||||
srs_trace("complex handshake success.");
|
srs_trace("complex handshake success.");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue