about summary refs log tree commit diff stats
path: root/src/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.c')
-rw-r--r--src/common.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/common.c b/src/common.c
index a3893c06..0e9585d6 100644
--- a/src/common.c
+++ b/src/common.c
@@ -56,6 +56,7 @@
 #include "log.h"
 #include "common.h"
 #include "tools/p_sha1.h"
+#include "xmpp/xmpp.h"
 
 struct curl_data_t
 {
@@ -63,8 +64,6 @@ struct curl_data_t
     size_t size;
 };
 
-static unsigned long unique_id = 0;
-
 static size_t _data_callback(void *ptr, size_t size, size_t nmemb, void *data);
 
 gboolean
@@ -337,25 +336,22 @@ create_unique_id(char *prefix)
 {
     char *result = NULL;
     GString *result_str = g_string_new("");
+    char *uuid = connection_create_uuid();
 
-    unique_id++;
     if (prefix) {
-        g_string_printf(result_str, "prof_%s_%lu", prefix, unique_id);
+        g_string_printf(result_str, "prof_%s_%s", prefix, uuid);
     } else {
-        g_string_printf(result_str, "prof_%lu", unique_id);
+        g_string_printf(result_str, "prof_%s", uuid);
     }
+
+    connection_free_uuid(uuid);
+
     result = result_str->str;
     g_string_free(result_str, FALSE);
 
     return result;
 }
 
-void
-reset_unique_id(void)
-{
-    unique_id = 0;
-}
-
 char*
 p_sha1_hash(char *str)
 {