diff options
author | Robert Pösel <robyer@seznam.cz> | 2015-02-15 10:24:20 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2015-02-15 10:24:20 +0000 |
commit | 60b391e2a55749c0cf9e96f53515673a0898a0d5 (patch) | |
tree | 6c750dc8e278a30773a0a60cf4a6e6235a63931d /protocols/FacebookRM/src/utils.h | |
parent | 39492f39ace0b10ff2ee6c9d61c22f2ac7d4a839 (diff) |
Facebook: Fix for infinite channel "starting"; Version bump
This fixes it by better using of random number generator. Now we use rand_s() instead of rand() because of thread safety and also we have random "seed" per each facebook_client with much better initial random seed.
Previously when user logged off and then logged in again, it used same randomgly generated clientid which resulted in confusion on Facebook server and "infinite" repeated requests for channel every second from Miranda... This bug was here probably for many months and affected all stable and development versions.
git-svn-id: http://svn.miranda-ng.org/main/trunk@12119 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/utils.h')
-rw-r--r-- | protocols/FacebookRM/src/utils.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/protocols/FacebookRM/src/utils.h b/protocols/FacebookRM/src/utils.h index 3768cc9415..af9cf3ceed 100644 --- a/protocols/FacebookRM/src/utils.h +++ b/protocols/FacebookRM/src/utils.h @@ -48,7 +48,7 @@ namespace utils namespace number
{
- int random(int min, int max);
+ int random(int min, int max, unsigned int *value = NULL);
};
namespace text
@@ -64,7 +64,7 @@ namespace utils std::string source_get_value(std::string* data, unsigned int argument_count, ...);
std::string source_get_value2(std::string* data, const char *term, const char *endings, bool wholeString = false);
std::string source_get_form_data(std::string* data);
- std::string rand_string(int len, const char *chars = "0123456789" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz");
+ std::string rand_string(int len, const char *chars = "0123456789" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz", unsigned int *number = NULL);
void explode(std::string str, const std::string &separator, std::vector<std::string>* results);
void append_ordinal(unsigned long value, std::string* data);
};
|