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

For #2424, use srandom/random to generate. 4.0.139

This commit is contained in:
winlin 2021-07-04 13:10:42 +08:00
parent e802fe5bd6
commit 642359a50e
14 changed files with 28 additions and 34 deletions

View file

@ -468,7 +468,7 @@ void SrsIngester::show_ingest_log_message()
}
// random choose one ingester to report.
int index = rand() % (int)ingesters.size();
int index = srs_random() % (int)ingesters.size();
SrsIngesterFFMPEG* ingester = ingesters.at(index);
// reportable

View file

@ -54,7 +54,7 @@ srs_error_t SrsLatestVersion::start()
return srs_success;
}
server_id_ = srs_random_str(10);
server_id_ = srs_random_str(16);
return trd_->start();
}

View file

@ -19,6 +19,7 @@ using namespace std;
#include <srs_kernel_rtc_rtp.hpp>
#include <srs_app_log.hpp>
#include <srs_kernel_utility.hpp>
#include <srs_protocol_utility.hpp>
#include <srtp2/srtp.h>
#include <openssl/ssl.h>
@ -297,7 +298,7 @@ srs_error_t SrsDtlsCertificate::initialize()
X509_NAME* subject = X509_NAME_new();
srs_assert(subject);
int serial = rand();
int serial = (int)srs_random();
ASN1_INTEGER_set(X509_get_serialNumber(dtls_cert), serial);
const std::string& aor = RTMP_SIG_SRS_DOMAIN;