1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Cover protocol stack RTMP. 3.0.63

This commit is contained in:
winlin 2019-11-20 14:08:53 +08:00
parent 40e60aff4d
commit 2731afc161
2 changed files with 175 additions and 9 deletions

View file

@ -979,18 +979,18 @@ srs_error_t SrsProtocol::read_basic_header(char& fmt, int& cid)
// 2-63, 1B chunk header
if (cid > 1) {
return err;
}
// 64-319, 2B chunk header
if (cid == 0) {
} else if (cid == 0) {
if ((err = in_buffer->grow(skt, 1)) != srs_success) {
return srs_error_wrap(err, "basic header requires 2 bytes");
}
cid = 64;
cid += (uint8_t)in_buffer->read_1byte();
// 64-65599, 3B chunk header
} else if (cid == 1) {
// 64-65599, 3B chunk header
} else {
srs_assert(cid == 1);
if ((err = in_buffer->grow(skt, 2)) != srs_success) {
return srs_error_wrap(err, "basic header requires 3 bytes");
}
@ -998,9 +998,6 @@ srs_error_t SrsProtocol::read_basic_header(char& fmt, int& cid)
cid = 64;
cid += (uint8_t)in_buffer->read_1byte();
cid += ((uint8_t)in_buffer->read_1byte()) * 256;
} else {
srs_error("invalid path, impossible basic header.");
srs_assert(false);
}
return err;