From ef7ed37e3ebc6f038e13f0157e8c46d1c2df76a8 Mon Sep 17 00:00:00 2001 From: Mathias Schnarrenberger Date: Mon, 5 Apr 2021 14:11:01 +0200 Subject: Fixes https://github.com/reo7sp/tgbot-cpp/issues/162 --- src/tools/StringTools.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/StringTools.cpp b/src/tools/StringTools.cpp index 8b8f4da..653047c 100644 --- a/src/tools/StringTools.cpp +++ b/src/tools/StringTools.cpp @@ -56,7 +56,8 @@ void split(const string& str, char delimiter, vector& dest) { } string generateRandomString(std::size_t length) { - static const string chars("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890-=[]\\;',./!@#$%^&*()_+{}|:\"<>?`~"); + static const string chars("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890-=[]\\',./!@#$%^&*()_+{}|:\"<>?`~"); + static const std::size_t charsLen = chars.length(); string result; -- cgit v1.2.3 From 20ce7578cc9b60d37fb1664fadfb561b547f8280 Mon Sep 17 00:00:00 2001 From: Mathias Schnarrenberger Date: Mon, 5 Apr 2021 14:18:17 +0200 Subject: Fixes https://github.com/reo7sp/tgbot-cpp/issues/13 for boost. Changed timeout to 20s compared to issue. Works at least for me. --- src/net/BoostHttpOnlySslClient.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src') diff --git a/src/net/BoostHttpOnlySslClient.cpp b/src/net/BoostHttpOnlySslClient.cpp index 301d0c8..6e59649 100644 --- a/src/net/BoostHttpOnlySslClient.cpp +++ b/src/net/BoostHttpOnlySslClient.cpp @@ -48,6 +48,32 @@ string BoostHttpOnlySslClient::makeRequest(const Url& url, const vector Date: Mon, 5 Apr 2021 14:19:58 +0200 Subject: Fixes https://github.com/reo7sp/tgbot-cpp/issues/13 for curl. --- src/net/CurlHttpClient.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/net/CurlHttpClient.cpp b/src/net/CurlHttpClient.cpp index 6dc43f8..13973cc 100644 --- a/src/net/CurlHttpClient.cpp +++ b/src/net/CurlHttpClient.cpp @@ -11,6 +11,9 @@ namespace TgBot { CurlHttpClient::CurlHttpClient() : _httpParser() { curlSettings = curl_easy_init(); + + curl_easy_setopt(curlSettings, CURLOPT_CONNECTTIMEOUT, 20); + curl_easy_setopt(curlSettings, CURLOPT_TIMEOUT, 25); } CurlHttpClient::~CurlHttpClient() { -- cgit v1.2.3