srs_error_t SrsRtmpServer::handshake() The logic inside here is problematic. #1057
Closed
Description
srs_error_t SrsRtmpServer::handshake()
{
srs_error_t err = srs_success;
srs_assert(hs_bytes);
SrsComplexHandshake complex_hs;
if ((err = complex_hs.handshake_with_client(hs_bytes, io)) != srs_success) {
if (srs_error_code(err) == ERROR_RTMP_TRY_SIMPLE_HS) {
srs_freep(err);
SrsSimpleHandshake simple_hs;
if ((err = simple_hs.handshake_with_client(hs_bytes, io)) != srs_success) {
return srs_error_wrap(err, "simple handshake");
}
}
return srs_error_wrap(err, "complex handshake");
}
srs_freep(hs_bytes);
return err;
}
If I go for a simple handshake and it succeeds, will I still execute return srs_error_wrap(err, "complex handshake");
? In that case, err
will not be srs_success
. Please confirm.
TRANS_BY_GPT3