mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
API: Use libuuid to generate uuid. v5.0.9
This commit is contained in:
parent
06f10b1894
commit
983d521987
9 changed files with 1461 additions and 18 deletions
|
@ -16,6 +16,7 @@
|
|||
#include <srs_app_http_conn.hpp>
|
||||
#include <srs_app_http_client.hpp>
|
||||
#include <srs_app_utility.hpp>
|
||||
#include <srs_app_uuid.hpp>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sstream>
|
||||
|
@ -37,7 +38,16 @@ srs_error_t SrsLatestVersion::start()
|
|||
return srs_success;
|
||||
}
|
||||
|
||||
server_id_ = srs_random_str(16);
|
||||
if (true) {
|
||||
uuid_t uuid;
|
||||
uuid_generate_time(uuid);
|
||||
|
||||
char buf[32];
|
||||
for (int i = 0; i < 16; i++) {
|
||||
snprintf(buf + i * 2, sizeof(buf), "%02x", uuid[i]);
|
||||
}
|
||||
server_id_ = string(buf, sizeof(buf));
|
||||
}
|
||||
|
||||
return trd_->start();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue