mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
complete the normal kernel flv utest. 0.9.147
This commit is contained in:
parent
010eb09a30
commit
d219a7b67e
11 changed files with 691 additions and 172 deletions
|
@ -557,31 +557,6 @@ namespace srs
|
|||
return bytes;
|
||||
}
|
||||
|
||||
/**
|
||||
* compare the memory in bytes.
|
||||
*/
|
||||
bool srs_bytes_equals(void* pa, void* pb, int size)
|
||||
{
|
||||
u_int8_t* a = (u_int8_t*)pa;
|
||||
u_int8_t* b = (u_int8_t*)pb;
|
||||
|
||||
if (!a && !b) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!a || !b) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for(int i = 0; i < size; i++){
|
||||
if(a[i] != b[i]){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
c2s2::c2s2()
|
||||
{
|
||||
srs_random_generate(random, 1504);
|
||||
|
|
|
@ -167,11 +167,6 @@ namespace srs
|
|||
*/
|
||||
char* srs_bytes_join_schema1(int32_t time, int32_t version, digest_block* digest, key_block* key);
|
||||
|
||||
/**
|
||||
* compare the memory in bytes.
|
||||
*/
|
||||
bool srs_bytes_equals(void* pa, void* pb, int size);
|
||||
|
||||
/**
|
||||
* c1s1 schema0
|
||||
* time: 4bytes
|
||||
|
|
|
@ -126,3 +126,28 @@ string srs_generate_tc_url(string ip, string vhost, string app, string port)
|
|||
|
||||
return tcUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* compare the memory in bytes.
|
||||
*/
|
||||
bool srs_bytes_equals(void* pa, void* pb, int size)
|
||||
{
|
||||
u_int8_t* a = (u_int8_t*)pa;
|
||||
u_int8_t* b = (u_int8_t*)pb;
|
||||
|
||||
if (!a && !b) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!a || !b) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for(int i = 0; i < size; i++){
|
||||
if(a[i] != b[i]){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -58,4 +58,9 @@ extern void srs_random_generate(char* bytes, int size);
|
|||
// generate the tcUrl.
|
||||
extern std::string srs_generate_tc_url(std::string ip, std::string vhost, std::string app, std::string port);
|
||||
|
||||
/**
|
||||
* compare the memory in bytes.
|
||||
*/
|
||||
extern bool srs_bytes_equals(void* pa, void* pb, int size);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue