From ffc38dac7b29c09dd0b3eb4f07870a4fefc6b30e Mon Sep 17 00:00:00 2001 From: GMagician <3684609+GMagician@users.noreply.github.com> Date: Thu, 4 Jun 2026 20:38:24 +0000 Subject: [PATCH] Fix hang Sometime telebot hangs in a curl perform call. It seems that some failure in connection/communication lead to an infinite wait. add curl option to activate a timeout --- src/telebot-core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/telebot-core.c b/src/telebot-core.c index 29d7eac..9f57c40 100644 --- a/src/telebot-core.c +++ b/src/telebot-core.c @@ -295,6 +295,7 @@ telebot_core_curl_perform(telebot_core_handler_t core_h, const char *method, tel curl_easy_setopt(curl_h, CURLOPT_URL, URL); curl_easy_setopt(curl_h, CURLOPT_WRITEFUNCTION, write_data_cb); curl_easy_setopt(curl_h, CURLOPT_WRITEDATA, resp); + curl_easy_setopt(curl_h, CURLOPT_TIMEOUT, 10); if (core_h->proxy_addr != NULL) {