mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
API: Use libuuid to generate uuid. v4.0.147
This commit is contained in:
parent
529b89a29e
commit
48ef3dcd83
6 changed files with 1446 additions and 4 deletions
|
@ -33,6 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#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>
|
||||
|
@ -54,7 +55,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