1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 04:16:38 +02:00

Compare commits

...

12 Commits

Author SHA1 Message Date
Sébastien Helleu a41a96a3c1 Version 4.7.2 2025-11-23 11:34:17 +01:00
Sébastien Helleu c74627c01d irc: fix reset of color when multiple modes are set with command /mode 2025-11-22 12:33:14 +01:00
Sébastien Helleu 5297c4345c irc: fix colors in MODE message (issue #2286) 2025-11-22 10:33:33 +01:00
Sébastien Helleu 63022f3482 tests: add colors in username for tests of messages 367 and 728 2025-11-22 10:33:06 +01:00
Sébastien Helleu c447013caf irc: fix colors in ban mask (message 367) and quiet mask (message 728) (issue #2286) 2025-11-22 10:06:48 +01:00
Sébastien Helleu 2b59a8e888 doc/api: add "error_code" and "error_code_pthread" in hook_url output hashtable (issue #2284) 2025-11-15 20:15:16 +01:00
Sébastien Helleu 3a629e08fa api: fix file descriptor leak in hook_url (closes #2284)
This can happen after a timeout or if the hook is removed during the transfer.
2025-11-15 20:15:16 +01:00
Sébastien Helleu 1c73310dd1 core: set max version for Curl symbol CURLOPT_KRBLEVEL 2025-11-15 17:47:18 +01:00
Sébastien Helleu a9b83dc58a Version 4.7.2-dev 2025-08-16 21:51:51 +02:00
Sébastien Helleu bc1f9784f8 Version 4.7.1 2025-08-16 21:49:19 +02:00
Sébastien Helleu a797e2bf70 relay/api: fix crash when an invalid HTTP request is received from a client
When invalid data is received (not an HTTP request), client->http_req->method
is NULL, so we have to check it's not NULL before comparing it to the supported
methods.

This fixes a regression introduced in commit
93ec10b563.
2025-08-16 21:21:14 +02:00
Sébastien Helleu 594e607764 Version 4.7.1-dev 2025-08-16 21:18:28 +02:00
32 changed files with 549 additions and 184 deletions
+14
View File
@@ -6,6 +6,20 @@ SPDX-License-Identifier: GPL-3.0-or-later
# WeeChat ChangeLog # WeeChat ChangeLog
## Version 4.7.2 (2025-11-23)
### Fixed
- api: fix file descriptor leak in hook_url when a timeout occurs or if the hook is removed during the transfer ([#2284](https://github.com/weechat/weechat/issues/2284))
- irc: fix colors in messages 367 (ban mask), 728 (quiet mask) and MODE ([#2286](https://github.com/weechat/weechat/issues/2286))
- irc: fix reset of color when multiple modes are set with command `/mode`
## Version 4.7.1 (2025-08-16)
### Fixed
- relay/api: fix crash when an invalid HTTP request is received from a client
## Version 4.7.0 (2025-07-19) ## Version 4.7.0 (2025-07-19)
### Changed ### Changed
+10
View File
@@ -11064,6 +11064,16 @@ Arguments:
*** _headers_: HTTP headers in response *** _headers_: HTTP headers in response
*** _output_: standard output (set only if _file_out_ was not set in options) *** _output_: standard output (set only if _file_out_ was not set in options)
*** _error_: error message (set only in case of error) *** _error_: error message (set only in case of error)
*** _error_code_: error code (integer, set only in case of error):
**** `1`: invalid URL
**** `2`: transfer error (Curl error)
**** `3`: not enough memory
**** `4`: file error
**** `5`: transfer stopped (hook removed during the transfer)
**** `6`: transfer timeout
**** `100`: thread creation error
*** _error_code_pthread_: return code of function _pthread_create_
(integer, set only if _error_code_ is `100`)
** return value: ** return value:
*** _WEECHAT_RC_OK_ *** _WEECHAT_RC_OK_
*** _WEECHAT_RC_ERROR_ *** _WEECHAT_RC_ERROR_
+10
View File
@@ -11270,6 +11270,16 @@ Paramètres :
*** _output_ : sortie standard (défini seulement si _file_out_ n'était pas défini *** _output_ : sortie standard (défini seulement si _file_out_ n'était pas défini
dans les options) dans les options)
*** _error_ : message d'erreur (défini seulement en cas d'erreur) *** _error_ : message d'erreur (défini seulement en cas d'erreur)
*** _error_code_: code d'erreur (entier, défini seulement en cas d'erreur):
**** `1`: URL invalide
**** `2`: erreur de transfert (erreur Curl)
**** `3`: mémoire insuffisante
**** `4`: erreur de fichier
**** `5`: transfert stoppé (hook supprimé durant le transfert)
**** `6`: délai d'attente dépassé pour le transfert ("timeout")
**** `100`: erreur de création du thread
*** _error_code_pthread_: code retour de la fonction _pthread_create_
(entier, défini seulement si _error_code_ vaut `100`)
** valeur de retour : ** valeur de retour :
*** _WEECHAT_RC_OK_ *** _WEECHAT_RC_OK_
*** _WEECHAT_RC_ERROR_ *** _WEECHAT_RC_ERROR_
+10
View File
@@ -11475,6 +11475,16 @@ Argomenti:
*** _headers_: HTTP headers in response *** _headers_: HTTP headers in response
*** _output_: standard output (set only if _file_out_ was not set in options) *** _output_: standard output (set only if _file_out_ was not set in options)
*** _error_: error message (set only in case of error) *** _error_: error message (set only in case of error)
*** _error_code_: error code (integer, set only in case of error):
**** `1`: invalid URL
**** `2`: transfer error (Curl error)
**** `3`: not enough memory
**** `4`: file error
**** `5`: transfer stopped (hook removed during the transfer)
**** `6`: transfer timeout
**** `100`: thread creation error
*** _error_code_pthread_: return code of function _pthread_create_
(integer, set only if _error_code_ is `100`)
** return value: ** return value:
*** _WEECHAT_RC_OK_ *** _WEECHAT_RC_OK_
*** _WEECHAT_RC_ERROR_ *** _WEECHAT_RC_ERROR_
+10
View File
@@ -11209,6 +11209,16 @@ struct t_hook *weechat_hook_url (const char *url,
*** _headers_: HTTP headers in response *** _headers_: HTTP headers in response
*** _output_: standard output (set only if _file_out_ was not set in options) *** _output_: standard output (set only if _file_out_ was not set in options)
*** _error_: error message (set only in case of error) *** _error_: error message (set only in case of error)
*** _error_code_: error code (integer, set only in case of error):
**** `1`: invalid URL
**** `2`: transfer error (Curl error)
**** `3`: not enough memory
**** `4`: file error
**** `5`: transfer stopped (hook removed during the transfer)
**** `6`: transfer timeout
**** `100`: thread creation error
*** _error_code_pthread_: return code of function _pthread_create_
(integer, set only if _error_code_ is `100`)
** return value: ** return value:
*** _WEECHAT_RC_OK_ *** _WEECHAT_RC_OK_
*** _WEECHAT_RC_ERROR_ *** _WEECHAT_RC_ERROR_
+10
View File
@@ -10781,6 +10781,16 @@ struct t_hook *weechat_hook_url (const char *url,
*** _headers_: HTTP заглавља у одзиву *** _headers_: HTTP заглавља у одзиву
*** _output_: стандардни излаз (поставља се само ако у опцијама није постављено _file_out_) *** _output_: стандардни излаз (поставља се само ако у опцијама није постављено _file_out_)
*** _error_: порука о грешки (поставља се само у случају грешке) *** _error_: порука о грешки (поставља се само у случају грешке)
*** _error_code_: error code (integer, set only in case of error):
**** `1`: invalid URL
**** `2`: transfer error (Curl error)
**** `3`: not enough memory
**** `4`: file error
**** `5`: transfer stopped (hook removed during the transfer)
**** `6`: transfer timeout
**** `100`: thread creation error
*** _error_code_pthread_: return code of function _pthread_create_
(integer, set only if _error_code_ is `100`)
** повратна вредност: ** повратна вредност:
*** _WEECHAT_RC_OK_ *** _WEECHAT_RC_OK_
*** _WEECHAT_RC_ERROR_ *** _WEECHAT_RC_ERROR_
+5 -1
View File
@@ -23,7 +23,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-06-30 09:32+0200\n" "POT-Creation-Date: 2025-08-16 19:26+0200\n"
"PO-Revision-Date: 2025-05-04 09:24+0200\n" "PO-Revision-Date: 2025-05-04 09:24+0200\n"
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n" "Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -14025,6 +14025,10 @@ msgstr ""
msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s" msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s"
msgstr "%s%s: selhalo parsování příkazu \"%s\" (prosím oznamte to vývojárům):" msgstr "%s%s: selhalo parsování příkazu \"%s\" (prosím oznamte to vývojárům):"
#, fuzzy, c-format
msgid "%s%s: invalid data received from client %s%s%s"
msgstr "%s%s: TLS handshake selhal"
#, fuzzy, c-format #, fuzzy, c-format
#| msgid "%s%s: unable to create socket" #| msgid "%s%s: unable to create socket"
msgid "%sremote[%s]: unable to send data, disconnecting" msgid "%sremote[%s]: unable to send data, disconnecting"
+6 -1
View File
@@ -28,7 +28,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-06-30 09:32+0200\n" "POT-Creation-Date: 2025-08-16 19:26+0200\n"
"PO-Revision-Date: 2025-05-05 09:24+0200\n" "PO-Revision-Date: 2025-05-05 09:24+0200\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n" "Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n" "Language-Team: German <kde-i18n-de@kde.org>\n"
@@ -15419,6 +15419,11 @@ msgstr ""
msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s" msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s"
msgstr "%s%s: Route „%s %s“ für Client %s%s%s konnte nicht ausgeführt werden" msgstr "%s%s: Route „%s %s“ für Client %s%s%s konnte nicht ausgeführt werden"
#, fuzzy, c-format
#| msgid "%s%s: invalid websocket handshake received for client %s%s%s"
msgid "%s%s: invalid data received from client %s%s%s"
msgstr "%s%s: ungültigen WebSocket Handshake für Client %s%s%s empfangen"
#, c-format #, c-format
msgid "%sremote[%s]: unable to send data, disconnecting" msgid "%sremote[%s]: unable to send data, disconnecting"
msgstr "" msgstr ""
+5 -1
View File
@@ -24,7 +24,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-06-30 09:32+0200\n" "POT-Creation-Date: 2025-08-16 19:26+0200\n"
"PO-Revision-Date: 2025-05-04 09:25+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n"
"Last-Translator: Santiago Forero <santiago@forero.xyz>\n" "Last-Translator: Santiago Forero <santiago@forero.xyz>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -14359,6 +14359,10 @@ msgstr ""
msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s" msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s"
msgstr "%s%s: falló la ejecución del comando \"%s\" por el cliente %s%s%s" msgstr "%s%s: falló la ejecución del comando \"%s\" por el cliente %s%s%s"
#, fuzzy, c-format
msgid "%s%s: invalid data received from client %s%s%s"
msgstr "%s%s: agotado el tiempo de espera del saludo TLS del cliente %s%s%s"
#, fuzzy, c-format #, fuzzy, c-format
#| msgid "%s%s: unable to create socket" #| msgid "%s%s: unable to create socket"
msgid "%sremote[%s]: unable to send data, disconnecting" msgid "%sremote[%s]: unable to send data, disconnecting"
+6 -2
View File
@@ -23,8 +23,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-06-30 09:32+0200\n" "POT-Creation-Date: 2025-08-16 19:26+0200\n"
"PO-Revision-Date: 2025-06-30 09:34+0200\n" "PO-Revision-Date: 2025-08-16 19:27+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n" "Language: fr\n"
@@ -15116,6 +15116,10 @@ msgstr ""
msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s" msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s"
msgstr "%s%s : échec d'exécution de la route \"%s %s\" pour le client %s%s%s" msgstr "%s%s : échec d'exécution de la route \"%s %s\" pour le client %s%s%s"
#, c-format
msgid "%s%s: invalid data received from client %s%s%s"
msgstr "%s%s : données invalides reçues du client %s%s%s"
#, c-format #, c-format
msgid "%sremote[%s]: unable to send data, disconnecting" msgid "%sremote[%s]: unable to send data, disconnecting"
msgstr "%sremote[%s] : impossible d'envoyer des données, déconnexion" msgstr "%sremote[%s] : impossible d'envoyer des données, déconnexion"
+5 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-06-30 09:32+0200\n" "POT-Creation-Date: 2025-08-16 19:26+0200\n"
"PO-Revision-Date: 2025-05-04 09:25+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -13424,6 +13424,10 @@ msgstr ""
msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s" msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s"
msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n"
#, fuzzy, c-format
msgid "%s%s: invalid data received from client %s%s%s"
msgstr "%s gnutls kézfogás sikertelen\n"
#, fuzzy, c-format #, fuzzy, c-format
msgid "%sremote[%s]: unable to send data, disconnecting" msgid "%sremote[%s]: unable to send data, disconnecting"
msgstr "%s nem sikerült a szervert létrehozni\n" msgstr "%s nem sikerült a szervert létrehozni\n"
+5 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-06-30 09:32+0200\n" "POT-Creation-Date: 2025-08-16 19:26+0200\n"
"PO-Revision-Date: 2025-05-04 09:25+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n" "Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -14361,6 +14361,10 @@ msgstr ""
msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s" msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s"
msgstr "%s%s: impossibile eseguire il comando \"%s\" per il client %s%s%s" msgstr "%s%s: impossibile eseguire il comando \"%s\" per il client %s%s%s"
#, fuzzy, c-format
msgid "%s%s: invalid data received from client %s%s%s"
msgstr "%s%s: set di caratter invalido: \"%s\""
#, fuzzy, c-format #, fuzzy, c-format
#| msgid "%s%s: unable to create socket" #| msgid "%s%s: unable to create socket"
msgid "%sremote[%s]: unable to send data, disconnecting" msgid "%sremote[%s]: unable to send data, disconnecting"
+7 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-06-30 09:32+0200\n" "POT-Creation-Date: 2025-08-16 19:26+0200\n"
"PO-Revision-Date: 2025-05-04 09:25+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n" "Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/" "Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
@@ -14849,6 +14849,12 @@ msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s"
msgstr "" msgstr ""
"%1$s%2$s: クライアント %4$s%5$s%6$s に対するコマンド \"%3$s\" の実行に失敗" "%1$s%2$s: クライアント %4$s%5$s%6$s に対するコマンド \"%3$s\" の実行に失敗"
#, fuzzy, c-format
#| msgid "%s%s: invalid websocket handshake received for client %s%s%s"
msgid "%s%s: invalid data received from client %s%s%s"
msgstr ""
"%s%s: クライアント %s%s%s から受け取った不正なウェブソケットハンドシェイク"
#, fuzzy, c-format #, fuzzy, c-format
#| msgid "%s%s: unable to create socket" #| msgid "%s%s: unable to create socket"
msgid "%sremote[%s]: unable to send data, disconnecting" msgid "%sremote[%s]: unable to send data, disconnecting"
+7 -1
View File
@@ -24,7 +24,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-06-30 09:32+0200\n" "POT-Creation-Date: 2025-08-16 19:26+0200\n"
"PO-Revision-Date: 2025-05-04 09:25+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n" "Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -15045,6 +15045,12 @@ msgstr ""
msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s" msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s"
msgstr "%s%s: nie udało się wykonać trasy „%s %s” dla klienta %s%s%s" msgstr "%s%s: nie udało się wykonać trasy „%s %s” dla klienta %s%s%s"
#, fuzzy, c-format
#| msgid "%s%s: invalid websocket handshake received for client %s%s%s"
msgid "%s%s: invalid data received from client %s%s%s"
msgstr ""
"%s%s: otrzymano niepoprawny pakiet dla gniazda webowego od klienta %s%s%s"
#, fuzzy, c-format #, fuzzy, c-format
#| msgid "%sremote[%s]: unable to create socket" #| msgid "%sremote[%s]: unable to create socket"
msgid "%sremote[%s]: unable to send data, disconnecting" msgid "%sremote[%s]: unable to send data, disconnecting"
+6 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-06-30 09:32+0200\n" "POT-Creation-Date: 2025-08-16 19:26+0200\n"
"PO-Revision-Date: 2025-05-04 09:25+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n"
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n" "Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
"Language-Team: Portuguese <>\n" "Language-Team: Portuguese <>\n"
@@ -14734,6 +14734,11 @@ msgstr ""
msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s" msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s"
msgstr "%s%s: falha ao executar o comando \"%s\" do cliente %s%s%s" msgstr "%s%s: falha ao executar o comando \"%s\" do cliente %s%s%s"
#, fuzzy, c-format
#| msgid "%s%s: invalid websocket handshake received for client %s%s%s"
msgid "%s%s: invalid data received from client %s%s%s"
msgstr "%s%s: websocket handshake inválido recebido do cliente %s%s%s"
#, fuzzy, c-format #, fuzzy, c-format
#| msgid "%s%s: unable to create socket" #| msgid "%s%s: unable to create socket"
msgid "%sremote[%s]: unable to send data, disconnecting" msgid "%sremote[%s]: unable to send data, disconnecting"
+5 -1
View File
@@ -23,7 +23,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-06-30 09:32+0200\n" "POT-Creation-Date: 2025-08-16 19:26+0200\n"
"PO-Revision-Date: 2025-05-04 09:25+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n"
"Last-Translator: Érico Nogueira <ericonr@disroot.org>\n" "Last-Translator: Érico Nogueira <ericonr@disroot.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -13857,6 +13857,10 @@ msgstr ""
msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s" msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s"
msgstr "%s%s: falha ao executar comando \"%s\" para cliente %d" msgstr "%s%s: falha ao executar comando \"%s\" para cliente %d"
#, fuzzy, c-format
msgid "%s%s: invalid data received from client %s%s%s"
msgstr "%s%s: handshake TLS falhou"
#, fuzzy, c-format #, fuzzy, c-format
msgid "%sremote[%s]: unable to send data, disconnecting" msgid "%sremote[%s]: unable to send data, disconnecting"
msgstr "%s%s: não foi possível criar pipe" msgstr "%s%s: não foi possível criar pipe"
+5 -1
View File
@@ -23,7 +23,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-06-30 09:32+0200\n" "POT-Creation-Date: 2025-08-16 19:26+0200\n"
"PO-Revision-Date: 2025-05-04 09:25+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n" "Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -13476,6 +13476,10 @@ msgstr ""
msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s" msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s"
msgstr "Не могу записать лог-файл \"%s\"\n" msgstr "Не могу записать лог-файл \"%s\"\n"
#, fuzzy, c-format
msgid "%s%s: invalid data received from client %s%s%s"
msgstr "%s инициализация gnutls не удалось\n"
#, fuzzy, c-format #, fuzzy, c-format
msgid "%sremote[%s]: unable to send data, disconnecting" msgid "%sremote[%s]: unable to send data, disconnecting"
msgstr "%s не могу создать сервер\n" msgstr "%s не могу создать сервер\n"
+6 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-06-30 09:32+0200\n" "POT-Creation-Date: 2025-08-16 19:26+0200\n"
"PO-Revision-Date: 2025-07-09 15:48+0400\n" "PO-Revision-Date: 2025-07-09 15:48+0400\n"
"Last-Translator: Ivan Pešić <ivan.pesic@gmail.com>\n" "Last-Translator: Ivan Pešić <ivan.pesic@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -14669,6 +14669,11 @@ msgstr ""
msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s" msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s"
msgstr "%s%s: није успело извршавање руте „%s %s” за клијента %s%s%s" msgstr "%s%s: није успело извршавање руте „%s %s” за клијента %s%s%s"
#, fuzzy, c-format
#| msgid "%s%s: invalid websocket handshake received for client %s%s%s"
msgid "%s%s: invalid data received from client %s%s%s"
msgstr "%s%s: примљено је неважеће вебсокет руковање од клијента %s%s%s"
#, c-format #, c-format
msgid "%sremote[%s]: unable to send data, disconnecting" msgid "%sremote[%s]: unable to send data, disconnecting"
msgstr "%sудаљени[%s]: није могао да пошаље податке, веза се прекида" msgstr "%sудаљени[%s]: није могао да пошаље податке, веза се прекида"
+58 -47
View File
@@ -23,7 +23,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-06-30 09:32+0200\n" "POT-Creation-Date: 2025-08-16 19:26+0200\n"
"PO-Revision-Date: 2025-07-06 09:25+0200\n" "PO-Revision-Date: 2025-07-06 09:25+0200\n"
"Last-Translator: Emir SARI <emir_sari@icloud.com>\n" "Last-Translator: Emir SARI <emir_sari@icloud.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1466,10 +1466,11 @@ msgid ""
"term|url|windows || callbacks <duration>[<unit>] || mouse|cursor [verbose] " "term|url|windows || callbacks <duration>[<unit>] || mouse|cursor [verbose] "
"|| hdata [free] || time <command> || unicode <string> || whitespace" "|| hdata [free] || time <command> || unicode <string> || whitespace"
msgstr "" msgstr ""
"list || set <eklenti> <düzey> || dump [<eklenti>] || hooks [<eklenti_maskesi> " "list || set <eklenti> <düzey> || dump [<eklenti>] || hooks "
"[<kanca_türü>...]] || buffer|certs|color|dirs|infolists|key|libs|memory|tags|" "[<eklenti_maskesi> [<kanca_türü>...]] || buffer|certs|color|dirs|infolists|"
"term|url|windows || callbacks <süre>[<birim>] || mouse|cursor [verbose] " "key|libs|memory|tags|term|url|windows || callbacks <süre>[<birim>] || mouse|"
"|| hdata [free] || time <komut> || unicode <dizi> || whitespace" "cursor [verbose] || hdata [free] || time <komut> || unicode <dizi> || "
"whitespace"
msgid "raw[list]: list plugins with debug levels" msgid "raw[list]: list plugins with debug levels"
msgstr "raw[list]: Eklentileri hata ayıklama düzeyleriyle listele" msgstr "raw[list]: Eklentileri hata ayıklama düzeyleriyle listele"
@@ -1577,8 +1578,9 @@ msgid "raw[term]: display infos about terminal"
msgstr "raw[term]: Uçbirim hakkında bilgi görüntüle" msgstr "raw[term]: Uçbirim hakkında bilgi görüntüle"
msgid "raw[url]: toggle debug for calls to hook_url (display output hashtable)" msgid "raw[url]: toggle debug for calls to hook_url (display output hashtable)"
msgstr "raw[url]: hook_url'sine olan çağrılar için hata ayıklamayı aç/kapat " msgstr ""
"(çıktı sağlama tablosunu görüntüle)" "raw[url]: hook_url'sine olan çağrılar için hata ayıklamayı aç/kapat (çıktı "
"sağlama tablosunu görüntüle)"
msgid "raw[windows]: display windows tree" msgid "raw[windows]: display windows tree"
msgstr "raw[windows]: Pencere ağacını görüntüle" msgstr "raw[windows]: Pencere ağacını görüntüle"
@@ -1586,8 +1588,9 @@ msgstr "raw[windows]: Pencere ağacını görüntüle"
msgid "" msgid ""
"raw[time]: measure time to execute a command or to send text to the current " "raw[time]: measure time to execute a command or to send text to the current "
"buffer" "buffer"
msgstr "raw[time]: Geçerli arabelleğe metin göndermek veya üzerinde komut " msgstr ""
"yürütmek için gereken zamanı ölç" "raw[time]: Geçerli arabelleğe metin göndermek veya üzerinde komut yürütmek "
"için gereken zamanı ölç"
msgid "" msgid ""
"raw[unicode]: display information about string and unicode chars (evaluated, " "raw[unicode]: display information about string and unicode chars (evaluated, "
@@ -1621,15 +1624,15 @@ msgid ""
"raw[-s]: split expression before evaluating it (many commands can be " "raw[-s]: split expression before evaluating it (many commands can be "
"separated by semicolons)" "separated by semicolons)"
msgstr "" msgstr ""
"raw[-s]: İfadeyi değerlendirmeden önce böl (birden çok komut noktalı virgülle " "raw[-s]: İfadeyi değerlendirmeden önce böl (birden çok komut noktalı "
"ayrılabilir)" "virgülle ayrılabilir)"
msgid "" msgid ""
"raw[-d]: display debug output after evaluation (with two -d: more verbose " "raw[-d]: display debug output after evaluation (with two -d: more verbose "
"debug)" "debug)"
msgstr "" msgstr ""
"raw[-d]: Değerlendirme sonrası hata ayıklama çıktısını görüntüle (iki -d ile: " "raw[-d]: Değerlendirme sonrası hata ayıklama çıktısını görüntüle (iki -d "
"Daha ayrıntılı hata ayıklama bilgisi)" "ile: Daha ayrıntılı hata ayıklama bilgisi)"
msgid "" msgid ""
"raw[-c]: evaluate as condition: use operators and parentheses, return a " "raw[-c]: evaluate as condition: use operators and parentheses, return a "
@@ -1641,7 +1644,8 @@ msgstr ""
msgid "" msgid ""
"expression: expression to evaluate, variables with format ${variable} are " "expression: expression to evaluate, variables with format ${variable} are "
"replaced (see below)" "replaced (see below)"
msgstr "ifade: Değerlendirilecek ifade, ${variable} biçimindeki değişkenler " msgstr ""
"ifade: Değerlendirilecek ifade, ${variable} biçimindeki değişkenler "
"değerlendirilir (aşağıya bakın)" "değerlendirilir (aşağıya bakın)"
msgid "operator: a logical or comparison operator (see below)" msgid "operator: a logical or comparison operator (see below)"
@@ -1650,7 +1654,8 @@ msgstr "işleç: bir mantıksal veya karşılaştırma işleci (aşağıya bakı
msgid "" msgid ""
"An expression is considered as \"true\" if it is not NULL, not empty, and " "An expression is considered as \"true\" if it is not NULL, not empty, and "
"different from \"0\"." "different from \"0\"."
msgstr "Bir ifade; NULL veya boş değilse ve \"0\"dan farklıysa \"true\" olarak " msgstr ""
"Bir ifade; NULL veya boş değilse ve \"0\"dan farklıysa \"true\" olarak "
"değerlendirilir." "değerlendirilir."
msgid "" msgid ""
@@ -1928,16 +1933,17 @@ msgid " !~ is NOT matching POSIX extended regex"
msgstr " !~ eşleşen POSIX genişletilmiş düzenli ifadesi DEĞİL" msgstr " !~ eşleşen POSIX genişletilmiş düzenli ifadesi DEĞİL"
msgid " ==* is matching mask, case-sensitive (wildcard \"*\" is allowed)" msgid " ==* is matching mask, case-sensitive (wildcard \"*\" is allowed)"
msgstr " ==* eşleşen maske, BÜYÜK/küçük harf duyarlı (\"*\" jokerine izin " msgstr ""
"verilir)" " ==* eşleşen maske, BÜYÜK/küçük harf duyarlı (\"*\" jokerine izin verilir)"
msgid " !!* is NOT matching mask, case-sensitive (wildcard \"*\" is allowed)" msgid " !!* is NOT matching mask, case-sensitive (wildcard \"*\" is allowed)"
msgstr " !!* eşleşen maske DEĞİL, BÜYÜK/küçük harf duyarlı (\"*\" jokerine " msgstr ""
"izin verilir)" " !!* eşleşen maske DEĞİL, BÜYÜK/küçük harf duyarlı (\"*\" jokerine izin "
"verilir)"
msgid " =* is matching mask, case-insensitive (wildcard \"*\" is allowed)" msgid " =* is matching mask, case-insensitive (wildcard \"*\" is allowed)"
msgstr " =* eşleşen maske, BÜYÜK/küçük harf duyarsız (\"*\" jokerine izin " msgstr ""
"verilir)" " =* eşleşen maske, BÜYÜK/küçük harf duyarsız (\"*\" jokerine izin verilir)"
msgid "" msgid ""
" !* is NOT matching mask, case-insensitive (wildcard \"*\" is allowed)" " !* is NOT matching mask, case-insensitive (wildcard \"*\" is allowed)"
@@ -2389,9 +2395,8 @@ msgid ""
"<name> <new_name> || refresh <name>|<mask>... || recreate <name> || del " "<name> <new_name> || refresh <name>|<mask>... || recreate <name> || del "
"<name>|<mask>..." "<name>|<mask>..."
msgstr "" msgstr ""
"list || add|addreplace <ad> \"<koşullar>\" \"<içerik>\" || rename " "list || add|addreplace <ad> \"<koşullar>\" \"<içerik>\" || rename <ad> "
"<ad> <yeni_ad> || refresh <ad>|<maske>... || recreate <ad> || del " "<yeni_ad> || refresh <ad>|<maske>... || recreate <ad> || del <ad>|<maske>..."
"<ad>|<maske>..."
msgid "raw[list]: list all custom bar items" msgid "raw[list]: list all custom bar items"
msgstr "raw[list]: Tüm özel çubuk ögelerini listele" msgstr "raw[list]: Tüm özel çubuk ögelerini listele"
@@ -2408,7 +2413,8 @@ msgstr "ad: Özel çubuk ögesi adı"
msgid "" msgid ""
"conditions: evaluated conditions to display the bar item (for example to " "conditions: evaluated conditions to display the bar item (for example to "
"display the bar item only in specific buffers)" "display the bar item only in specific buffers)"
msgstr "koşullar: Çubuk ögesini görüntülemek için değerlendirilmiş koşullar " msgstr ""
"koşullar: Çubuk ögesini görüntülemek için değerlendirilmiş koşullar "
"(örneğin, çubuk ögesini yalnızca belirli arabelleklerde görüntülemek için)" "(örneğin, çubuk ögesini yalnızca belirli arabelleklerde görüntülemek için)"
msgid "content: content (evaluated, see /help eval)" msgid "content: content (evaluated, see /help eval)"
@@ -2467,9 +2473,9 @@ msgid ""
msgstr "" msgstr ""
"[list|listdefault|listdiff] [<içerik>] || bind <düğme> [<komut> " "[list|listdefault|listdiff] [<içerik>] || bind <düğme> [<komut> "
"[<argümanlar>]] || bindctxt <içerik> <düğme> [<komut> [<argümanlar>]] || " "[<argümanlar>]] || bindctxt <içerik> <düğme> [<komut> [<argümanlar>]] || "
"unbind <düğme> || unbindctxt <içerik> <düğme> || reset <düğme> || " "unbind <düğme> || unbindctxt <içerik> <düğme> || reset <düğme> || resetctxt "
"resetctxt <içerik> <düğme> || resetall -yes [<içerik>] || missing [<içerik>] " "<içerik> <düğme> || resetall -yes [<içerik>] || missing [<içerik>] || legacy "
"|| legacy <düğme>..." "<düğme>..."
msgid "raw[list]: list all current keys" msgid "raw[list]: list all current keys"
msgstr "" msgstr ""
@@ -4714,12 +4720,12 @@ msgid ""
"messages from nick \"FlashCode\", \"irc_notice+nick_toto*\" for notices from " "messages from nick \"FlashCode\", \"irc_notice+nick_toto*\" for notices from "
"a nick starting with \"toto\"" "a nick starting with \"toto\""
msgstr "" msgstr ""
"vurgulanacak künyelerin virgülle ayrılmış listesi; BÜYÜK/küçük harf " "vurgulanacak künyelerin virgülle ayrılmış listesi; BÜYÜK/küçük harf duyarsız "
"duyarsız karşılaştırma; her bir künyede \"*\" jokerine izin verilir; " "karşılaştırma; her bir künyede \"*\" jokerine izin verilir; künyeler "
"künyeler arasında mantıksal \"and\" yapmak için künyeleri \"+\" ile " "arasında mantıksal \"and\" yapmak için künyeleri \"+\" ile ayırabilirsiniz; "
"ayırabilirsiniz; örnekler: \"GazMan\" takma adından iletiler için " "örnekler: \"GazMan\" takma adından iletiler için \"nick_gazman\", \"toto\" "
"\"nick_gazman\", \"toto\" ile başlayan bir takma addan gelecek bildirimler " "ile başlayan bir takma addan gelecek bildirimler için "
"için \"irc_notice+nick_toto\"" "\"irc_notice+nick_toto\""
msgid "" msgid ""
"conditions to add a buffer in hotlist (if notify level is OK for the " "conditions to add a buffer in hotlist (if notify level is OK for the "
@@ -11969,8 +11975,8 @@ msgid ""
"allowed in tags; an empty value allows highlight on any tag" "allowed in tags; an empty value allows highlight on any tag"
msgstr "" msgstr ""
"vurgulamayı irc arabelleklerindeki bu künyelere sınırla (kullanıcı " "vurgulamayı irc arabelleklerindeki bu künyelere sınırla (kullanıcı "
"iletilerinde vurgulama olup sunucu iletilerinde olmaması için); künyeler " "iletilerinde vurgulama olup sunucu iletilerinde olmaması için); künyeler bir "
"bir virgülle ayrılmalıdır ve \"+\" künyeler arasında mantıksal bir \"and\" " "virgülle ayrılmalıdır ve \"+\" künyeler arasında mantıksal bir \"and\" "
"yapmak için kullanılabilir; künyelerde \"*\" jokerine izin verilir; boş bir " "yapmak için kullanılabilir; künyelerde \"*\" jokerine izin verilir; boş bir "
"değer herhangi bir künyede vurgulamaya izin verir" "değer herhangi bir künyede vurgulamaya izin verir"
@@ -12701,17 +12707,17 @@ msgid ""
"\"channel\" was not found), \"pos_text\": index of \"text\" message (\"-1\" " "\"channel\" was not found), \"pos_text\": index of \"text\" message (\"-1\" "
"if \"text\" was not found)" "if \"text\" was not found)"
msgstr "" msgstr ""
"\"tags\": künyeler, \"tag_xxx\": künyenin kaçırılmamış değeri \"xxx\" " "\"tags\": künyeler, \"tag_xxx\": künyenin kaçırılmamış değeri \"xxx\" (künye "
"(künye başına bir anahtar), \"message_without_tags\": künyesiz ileti, " "başına bir anahtar), \"message_without_tags\": künyesiz ileti, \"nick\": "
"\"nick\": takma ad, \"user\": kullanıcı adı, \"host\": makine, \"command\": " "takma ad, \"user\": kullanıcı adı, \"host\": makine, \"command\": komut, "
"komut, \"channel\": kanal, \"arguments\": argümanlar (kanalı içerir), " "\"channel\": kanal, \"arguments\": argümanlar (kanalı içerir), \"text\": "
"\"text\": metin (örneğin: kullanıcı iletisi), \"param1\" ... \"paramN\": " "metin (örneğin: kullanıcı iletisi), \"param1\" ... \"paramN\": ayrıştırılmış "
"ayrıştırılmış komut parametreleri, \"num_params\": ayrıştırılmış komut " "komut parametreleri, \"num_params\": ayrıştırılmış komut parametrelerinin "
"parametrelerinin sayısı, \"pos_command\": \"command\" iletisinin indeksi " "sayısı, \"pos_command\": \"command\" iletisinin indeksi (komut bulunamazsa "
"(komut bulunamazsa \"-1\"), \"pos_arguments\": \"arguments\" iletisinin " "\"-1\"), \"pos_arguments\": \"arguments\" iletisinin indeksi (\"arguments\" "
"indeksi (\"arguments\" bulunamazsa \"-1\"), \"pos_channel\": \"channel\" " "bulunamazsa \"-1\"), \"pos_channel\": \"channel\" iletisinin indeksi "
"iletisinin indeksi (\"channel\" bulunamazsa \"-1\"), \"pos_text\": \"text\" " "(\"channel\" bulunamazsa \"-1\"), \"pos_text\": \"text\" iletisinin indeksi "
"iletisinin indeksi (\"text\" bulunamazsa \"-1\")" "(\"text\" bulunamazsa \"-1\")"
msgid "split an IRC message (to fit in 512 bytes by default)" msgid "split an IRC message (to fit in 512 bytes by default)"
msgstr "bir IRC iletisini böl (öntanımlı olarak 512 bayt'a sığması için)" msgstr "bir IRC iletisini böl (öntanımlı olarak 512 bayt'a sığması için)"
@@ -14938,6 +14944,11 @@ msgstr ""
msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s" msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s"
msgstr "%s%s: \"%s\" komutu yürütülemedi, %s%s%s istemcisi için" msgstr "%s%s: \"%s\" komutu yürütülemedi, %s%s%s istemcisi için"
#, fuzzy, c-format
#| msgid "%s%s: invalid websocket handshake received for client %s%s%s"
msgid "%s%s: invalid data received from client %s%s%s"
msgstr "%s%s: %s%s%s istemcisi için geçersiz web soketi el sıkışması alındı"
#, fuzzy, c-format #, fuzzy, c-format
#| msgid "%s%s: unable to create socket" #| msgid "%s%s: unable to create socket"
msgid "%sremote[%s]: unable to send data, disconnecting" msgid "%sremote[%s]: unable to send data, disconnecting"
+5 -1
View File
@@ -23,7 +23,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-06-30 09:32+0200\n" "POT-Creation-Date: 2025-08-16 19:26+0200\n"
"PO-Revision-Date: 2014-08-16 10:27+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -12259,6 +12259,10 @@ msgstr ""
msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s" msgid "%s%s: failed to execute route \"%s %s\" for client %s%s%s"
msgstr "" msgstr ""
#, c-format
msgid "%s%s: invalid data received from client %s%s%s"
msgstr ""
#, c-format #, c-format
msgid "%sremote[%s]: unable to send data, disconnecting" msgid "%sremote[%s]: unable to send data, disconnecting"
msgstr "" msgstr ""
+123 -29
View File
@@ -37,6 +37,7 @@
#include "core-infolist.h" #include "core-infolist.h"
#include "core-proxy.h" #include "core-proxy.h"
#include "core-string.h" #include "core-string.h"
#include "core-util.h"
#include "../plugins/plugin.h" #include "../plugins/plugin.h"
@@ -653,7 +654,9 @@ struct t_url_option url_options[] =
URL_DEF_OPTION(SSLENGINE_DEFAULT, LONG, NULL), URL_DEF_OPTION(SSLENGINE_DEFAULT, LONG, NULL),
URL_DEF_OPTION(CAPATH, STRING, NULL), URL_DEF_OPTION(CAPATH, STRING, NULL),
URL_DEF_OPTION(SSL_SESSIONID_CACHE, LONG, NULL), URL_DEF_OPTION(SSL_SESSIONID_CACHE, LONG, NULL),
#if LIBCURL_VERSION_NUM < 0x081100 /* < 8.17.0 */
URL_DEF_OPTION(KRBLEVEL, STRING, NULL), URL_DEF_OPTION(KRBLEVEL, STRING, NULL),
#endif
URL_DEF_OPTION(KEYPASSWD, STRING, NULL), URL_DEF_OPTION(KEYPASSWD, STRING, NULL),
URL_DEF_OPTION(ISSUERCERT, STRING, NULL), URL_DEF_OPTION(ISSUERCERT, STRING, NULL),
URL_DEF_OPTION(CRLFILE, STRING, NULL), URL_DEF_OPTION(CRLFILE, STRING, NULL),
@@ -1046,31 +1049,46 @@ weeurl_set_proxy (CURL *curl, struct t_proxy *proxy)
* output | stdout (set only if "file_out" was not set in options) * output | stdout (set only if "file_out" was not set in options)
* error | error message (set only in case of error) * error | error message (set only in case of error)
* *
* If timeout is 0, the function blocks until the end of the transfer.
* If timeout (in milliseconds) is > 0, the function returns an error in the
* output hashtable if the timeout is reached while the transfer is still
* active.
*
* If stop_download is not NULL, it is checked regularly, and as soon as the
* pointed integer becomes different from 0 (set by the caller of this function),
* the download is immediately stopped with an error.
*
* Returns: * Returns:
* 0: OK * 0: OK
* 1: invalid URL * 1: invalid URL
* 2: error downloading URL * 2: error downloading URL
* 3: not enough memory * 3: not enough memory
* 4: file error * 4: file error
* 5: transfer stopped by the caller
* 6: transfer timeout
*/ */
int int
weeurl_download (const char *url, struct t_hashtable *options, weeurl_download (const char *url, struct t_hashtable *options,
struct t_hashtable *output) long timeout, struct t_hashtable *output,
int *stop_transfer)
{ {
CURL *curl; CURL *curl;
CURLM *multi;
CURLMcode curl_mc;
struct t_url_file url_file[2]; struct t_url_file url_file[2];
char *url_file_option[2] = { "file_in", "file_out" }; char *url_file_option[2] = { "file_in", "file_out" };
char *url_file_mode[2] = { "rb", "wb" }; char *url_file_mode[2] = { "rb", "wb" };
char url_error[CURL_ERROR_SIZE + 1], url_error_code[12]; char url_error[4096], url_error_code[12];
char **string_headers, **string_output; char **string_headers, **string_output;
char str_response_code[32]; char str_response_code[32];
CURLoption url_file_opt_func[2] = { CURLOPT_READFUNCTION, CURLOPT_WRITEFUNCTION }; CURLoption url_file_opt_func[2] = { CURLOPT_READFUNCTION, CURLOPT_WRITEFUNCTION };
CURLoption url_file_opt_data[2] = { CURLOPT_READDATA, CURLOPT_WRITEDATA }; CURLoption url_file_opt_data[2] = { CURLOPT_READDATA, CURLOPT_WRITEDATA };
void *url_file_opt_cb[2] = { &weeurl_read_stream, &weeurl_write_stream }; void *url_file_opt_cb[2] = { &weeurl_read_stream, &weeurl_write_stream };
struct t_proxy *ptr_proxy; struct t_proxy *ptr_proxy;
int rc, curl_rc, i, output_to_file; int rc, i, output_to_file, still_running;
long response_code; long response_code;
struct timeval tv_now, tv_end;
rc = 0; rc = 0;
@@ -1169,44 +1187,120 @@ weeurl_download (const char *url, struct t_hashtable *options,
/* set error buffer */ /* set error buffer */
curl_easy_setopt (curl, CURLOPT_ERRORBUFFER, url_error); curl_easy_setopt (curl, CURLOPT_ERRORBUFFER, url_error);
/* perform action! */ /* compute end time for transfer, according to the timeout */
curl_rc = curl_easy_perform (curl); if (timeout > 0)
if (curl_rc == CURLE_OK)
{ {
if (output) gettimeofday (&tv_end, NULL);
{ util_timeval_add (&tv_end, ((long long)timeout) * 1000);
curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, &response_code);
snprintf (str_response_code, sizeof (str_response_code),
"%ld", response_code);
hashtable_set (output, "response_code", str_response_code);
}
} }
else else
{ {
if (output) tv_end.tv_sec = 0;
tv_end.tv_usec = 0;
}
/* start the transfer */
multi = curl_multi_init ();
curl_multi_add_handle (multi, curl);
while (1)
{
curl_mc = curl_multi_perform (multi, &still_running);
if ((curl_mc == CURLM_OK) && still_running)
curl_mc = curl_multi_poll (multi, NULL, 0, 5, NULL);
if (curl_mc != CURLM_OK)
{ {
snprintf (url_error_code, sizeof (url_error_code), "%d", curl_rc); if (output)
if (!url_error[0])
{ {
snprintf (url_error, sizeof (url_error), snprintf (url_error_code, sizeof (url_error_code), "%d", curl_mc);
"%s", _("transfer error")); if (!url_error[0])
{
snprintf (url_error, sizeof (url_error),
"%s", _("transfer error"));
}
}
else
{
/*
* URL transfer done in a forked process: display error on stderr,
* which will be sent to the hook_process callback
*/
fprintf (stderr,
_("curl error %d (%s) (URL: \"%s\")\n"),
curl_mc, url_error, url);
}
rc = 2;
break;
}
if (!still_running)
{
/* transfer OK */
if (output)
{
curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, &response_code);
snprintf (str_response_code, sizeof (str_response_code),
"%ld", response_code);
hashtable_set (output, "response_code", str_response_code);
}
break;
}
if (stop_transfer && *stop_transfer)
{
/* transfer stopped by the caller */
if (output)
{
if (!url_error[0])
snprintf (url_error, sizeof (url_error), "transfer stopped");
}
else
{
/*
* URL transfer done in a forked process: display error on stderr,
* which will be sent to the hook_process callback
*/
fprintf (stderr,
_("transfer stopped (URL: \"%s\")\n"),
url);
}
rc = 5;
break;
}
if (tv_end.tv_sec > 0)
{
/* timeout reached? */
gettimeofday (&tv_now, NULL);
if (util_timeval_cmp (&tv_now, &tv_end) >= 0)
{
if (output)
{
if (!url_error[0])
{
snprintf (url_error, sizeof (url_error),
URL_ERROR_TIMEOUT " (%.3fs)",
((float)timeout) / 1000);
}
}
else
{
/*
* URL transfer done in a forked process: display error on stderr,
* which will be sent to the hook_process callback
*/
fprintf (stderr,
_("transfer timeout reached (%.3fs) (URL: \"%s\")\n"),
((float)timeout) / 1000, url);
}
rc = 6;
break;
} }
} }
else
{
/*
* URL transfer done in a forked process: display error on stderr,
* which will be sent to the hook_process callback
*/
fprintf (stderr,
_("curl error %d (%s) (URL: \"%s\")\n"),
curl_rc, url_error, url);
}
rc = 2;
} }
/* cleanup */ /* cleanup */
curl_multi_remove_handle (multi, curl);
curl_easy_cleanup (curl); curl_easy_cleanup (curl);
curl_multi_cleanup (multi);
end: end:
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
+4 -1
View File
@@ -24,6 +24,8 @@
#include <stdio.h> #include <stdio.h>
#define URL_ERROR_TIMEOUT "transfer timeout reached"
struct t_hashtable; struct t_hashtable;
struct t_infolist; struct t_infolist;
@@ -61,7 +63,8 @@ extern char *url_type_string[];
extern struct t_url_option url_options[]; extern struct t_url_option url_options[];
extern int weeurl_download (const char *url, struct t_hashtable *options, extern int weeurl_download (const char *url, struct t_hashtable *options,
struct t_hashtable *output); long timeout, struct t_hashtable *output,
int *stop_transfer);
extern int weeurl_option_add_to_infolist (struct t_infolist *infolist, extern int weeurl_option_add_to_infolist (struct t_infolist *infolist,
struct t_url_option *option); struct t_url_option *option);
extern void weeurl_init (void); extern void weeurl_init (void);
+3 -1
View File
@@ -279,7 +279,9 @@ hook_process_child (struct t_hook *hook_process)
} }
rc = weeurl_download (ptr_url, rc = weeurl_download (ptr_url,
HOOK_PROCESS(hook_process, options), HOOK_PROCESS(hook_process, options),
NULL); /* output */ 0, /* timeout */
NULL, /* output */
NULL); /* stop_download */
} }
else if (strncmp (HOOK_PROCESS(hook_process, command), "func:", 5) == 0) else if (strncmp (HOOK_PROCESS(hook_process, command), "func:", 5) == 0)
{ {
+34 -9
View File
@@ -137,7 +137,9 @@ hook_url_transfer_thread (void *hook_pointer)
url_rc = weeurl_download (HOOK_URL(hook, url), url_rc = weeurl_download (HOOK_URL(hook, url),
HOOK_URL(hook, options), HOOK_URL(hook, options),
HOOK_URL(hook, output)); HOOK_URL(hook, timeout),
HOOK_URL(hook, output),
&(HOOK_URL(hook, stop_transfer)));
if (url_rc != 0) if (url_rc != 0)
{ {
@@ -159,7 +161,7 @@ hook_url_timer_cb (const void *pointer, void *data, int remaining_calls)
{ {
struct t_hook *hook; struct t_hook *hook;
const char *ptr_error; const char *ptr_error;
char str_error[1024], str_error_code[12]; char str_error[1024];
/* make C compiler happy */ /* make C compiler happy */
(void) data; (void) data;
@@ -192,11 +194,10 @@ hook_url_timer_cb (const void *pointer, void *data, int remaining_calls)
if (!hashtable_has_key (HOOK_URL(hook, output), "error_code")) if (!hashtable_has_key (HOOK_URL(hook, output), "error_code"))
{ {
snprintf (str_error, sizeof (str_error), snprintf (str_error, sizeof (str_error),
"transfer timeout reached (%.3fs)", URL_ERROR_TIMEOUT " (%.3fs)",
((float)HOOK_URL(hook, timeout)) / 1000); ((float)HOOK_URL(hook, timeout)) / 1000);
snprintf (str_error_code, sizeof (str_error_code), "6");
hashtable_set (HOOK_URL(hook, output), "error", str_error); hashtable_set (HOOK_URL(hook, output), "error", str_error);
hashtable_set (HOOK_URL(hook, output), "error_code", str_error_code); hashtable_set (HOOK_URL(hook, output), "error_code", "6");
} }
hook_url_run_callback (hook); hook_url_run_callback (hook);
if (weechat_debug_core >= 1) if (weechat_debug_core >= 1)
@@ -224,7 +225,7 @@ hook_url_transfer (struct t_hook *hook)
{ {
int rc, timeout, max_calls; int rc, timeout, max_calls;
long interval; long interval;
char str_error[1024], str_error_code[12], str_error_code_pthread[12]; char str_error[1024], str_error_code_pthread[12];
HOOK_URL(hook, thread_running) = 1; HOOK_URL(hook, thread_running) = 1;
@@ -235,11 +236,10 @@ hook_url_transfer (struct t_hook *hook)
{ {
snprintf (str_error, sizeof (str_error), snprintf (str_error, sizeof (str_error),
"error calling pthread_create (%d)", rc); "error calling pthread_create (%d)", rc);
snprintf (str_error_code, sizeof (str_error_code), "5");
snprintf (str_error_code_pthread, sizeof (str_error_code_pthread), snprintf (str_error_code_pthread, sizeof (str_error_code_pthread),
"%d", rc); "%d", rc);
hashtable_set (HOOK_URL(hook, output), "error", str_error); hashtable_set (HOOK_URL(hook, output), "error", str_error);
hashtable_set (HOOK_URL(hook, output), "error_code", str_error_code); hashtable_set (HOOK_URL(hook, output), "error_code", "100");
hashtable_set (HOOK_URL(hook, output), "error_code_pthread", hashtable_set (HOOK_URL(hook, output), "error_code_pthread",
str_error_code_pthread); str_error_code_pthread);
hook_url_run_callback (hook); hook_url_run_callback (hook);
@@ -265,7 +265,7 @@ hook_url_transfer (struct t_hook *hook)
{ {
if (timeout <= 100) if (timeout <= 100)
{ {
interval = timeout; interval = timeout + 50;
max_calls = 1; max_calls = 1;
} }
else else
@@ -274,6 +274,7 @@ hook_url_transfer (struct t_hook *hook)
max_calls = timeout / 100; max_calls = timeout / 100;
if (timeout % 100 == 0) if (timeout % 100 == 0)
max_calls++; max_calls++;
max_calls++;
} }
} }
HOOK_URL(hook, hook_timer) = hook_timer (hook->plugin, HOOK_URL(hook, hook_timer) = hook_timer (hook->plugin,
@@ -323,6 +324,7 @@ hook_url (struct t_weechat_plugin *plugin,
new_hook_url->url = strdup (url); new_hook_url->url = strdup (url);
new_hook_url->options = (options) ? hashtable_dup (options) : NULL; new_hook_url->options = (options) ? hashtable_dup (options) : NULL;
new_hook_url->timeout = timeout; new_hook_url->timeout = timeout;
new_hook_url->stop_transfer = 0;
new_hook_url->thread_id = 0; new_hook_url->thread_id = 0;
new_hook_url->thread_created = 0; new_hook_url->thread_created = 0;
new_hook_url->thread_running = 0; new_hook_url->thread_running = 0;
@@ -366,6 +368,26 @@ hook_url_free_data (struct t_hook *hook)
if (!hook || !hook->hook_data) if (!hook || !hook->hook_data)
return; return;
/* stop transfer if it's still active */
if (HOOK_URL(hook, thread_created) && HOOK_URL(hook, thread_running))
{
HOOK_URL(hook, stop_transfer) = 1;
usleep (10000);
if (!hashtable_has_key (HOOK_URL(hook, output), "error_code"))
{
hashtable_set (HOOK_URL(hook, output), "error", "transfer stopped");
hashtable_set (HOOK_URL(hook, output), "error_code", "5");
}
hook_url_run_callback (hook);
if (weechat_debug_core >= 1)
{
gui_chat_printf (
NULL,
_("End of URL transfer '%s', transfer stopped"),
HOOK_URL(hook, url));
}
}
if (HOOK_URL(hook, url)) if (HOOK_URL(hook, url))
{ {
free (HOOK_URL(hook, url)); free (HOOK_URL(hook, url));
@@ -421,6 +443,8 @@ hook_url_add_to_infolist (struct t_infolist_item *item,
return 0; return 0;
if (!infolist_new_var_integer (item, "timeout", (int)(HOOK_URL(hook, timeout)))) if (!infolist_new_var_integer (item, "timeout", (int)(HOOK_URL(hook, timeout))))
return 0; return 0;
if (!infolist_new_var_integer (item, "stop_transfer", HOOK_URL(hook, stop_transfer)))
return 0;
if (!infolist_new_var_integer (item, "thread_created", (int)(HOOK_URL(hook, thread_created)))) if (!infolist_new_var_integer (item, "thread_created", (int)(HOOK_URL(hook, thread_created))))
return 0; return 0;
if (!infolist_new_var_integer (item, "thread_running", (int)(HOOK_URL(hook, thread_running)))) if (!infolist_new_var_integer (item, "thread_running", (int)(HOOK_URL(hook, thread_running))))
@@ -451,6 +475,7 @@ hook_url_print_log (struct t_hook *hook)
hashtable_get_string (HOOK_URL(hook, options), hashtable_get_string (HOOK_URL(hook, options),
"keys_values")); "keys_values"));
log_printf (" timeout . . . . . . . : %ld", HOOK_URL(hook, timeout)); log_printf (" timeout . . . . . . . : %ld", HOOK_URL(hook, timeout));
log_printf (" stop_transfer . . . . : %d", HOOK_URL(hook, stop_transfer));
log_printf (" thread_created. . . . : %d", (int)HOOK_URL(hook, thread_created)); log_printf (" thread_created. . . . : %d", (int)HOOK_URL(hook, thread_created));
log_printf (" thread_running. . . . : %d", (int)HOOK_URL(hook, thread_running)); log_printf (" thread_running. . . . : %d", (int)HOOK_URL(hook, thread_running));
log_printf (" hook_timer. . . . . . : %p", HOOK_URL(hook, hook_timer)); log_printf (" hook_timer. . . . . . : %p", HOOK_URL(hook, hook_timer));
+1
View File
@@ -41,6 +41,7 @@ struct t_hook_url
char *url; /* URL */ char *url; /* URL */
struct t_hashtable *options; /* URL options (see doc) */ struct t_hashtable *options; /* URL options (see doc) */
long timeout; /* timeout (ms) (0 = no timeout) */ long timeout; /* timeout (ms) (0 = no timeout) */
int stop_transfer; /* 1 is used to stop transfer now */
pthread_t thread_id; /* thread id */ pthread_t thread_id; /* thread id */
int thread_created; /* thread created */ int thread_created; /* thread created */
int thread_running; /* 1 if thread is running */ int thread_running; /* 1 if thread is running */
+18 -17
View File
@@ -28,6 +28,7 @@
#include "../weechat-plugin.h" #include "../weechat-plugin.h"
#include "irc.h" #include "irc.h"
#include "irc-color.h"
#include "irc-mode.h" #include "irc-mode.h"
#include "irc-config.h" #include "irc-config.h"
#include "irc-server.h" #include "irc-server.h"
@@ -37,18 +38,24 @@
/* /*
* Gets mode arguments: skip colons before arguments. * Gets mode arguments: skips colons before arguments and converts IRC color
* codes into WeeChat color codes, so that the result can be displayed in a
* buffer.
*/ */
char * char *
irc_mode_get_arguments (const char *arguments) irc_mode_get_arguments_colors (const char *arguments)
{ {
char **argv, **argv2, *new_arguments; char **argv, **new_arguments;
int argc, i; int argc, i;
if (!arguments || !arguments[0]) if (!arguments || !arguments[0])
return strdup (""); return strdup ("");
new_arguments = weechat_string_dyn_alloc (1024);
if (!new_arguments)
return NULL;
argv = weechat_string_split (arguments, " ", NULL, argv = weechat_string_split (arguments, " ", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT | WEECHAT_STRING_SPLIT_STRIP_RIGHT
@@ -57,26 +64,20 @@ irc_mode_get_arguments (const char *arguments)
if (!argv) if (!argv)
return strdup (""); return strdup ("");
argv2 = malloc (sizeof (*argv) * (argc + 1));
if (!argv2)
{
weechat_string_free_split (argv);
return strdup ("");;
}
for (i = 0; i < argc; i++) for (i = 0; i < argc; i++)
{ {
argv2[i] = (argv[i][0] == ':') ? argv[i] + 1 : argv[i]; if ((*new_arguments)[0])
weechat_string_dyn_concat (new_arguments, " ", -1);
weechat_string_dyn_concat (
new_arguments,
(argv[i][0] == ':') ? IRC_COLOR_MSG(argv[i] + 1) : IRC_COLOR_MSG(argv[i]),
-1);
weechat_string_dyn_concat (new_arguments, IRC_COLOR_RESET, -1);
} }
argv2[argc] = NULL;
new_arguments = weechat_string_rebuild_split_string (
(const char **)argv2, " ", 0, -1);
weechat_string_free_split (argv); weechat_string_free_split (argv);
free (argv2);
return new_arguments; return weechat_string_dyn_free (new_arguments, 0);
} }
/* /*
+1 -1
View File
@@ -25,7 +25,7 @@
struct t_irc_server; struct t_irc_server;
struct t_irc_channel; struct t_irc_channel;
extern char *irc_mode_get_arguments (const char *arguments); extern char *irc_mode_get_arguments_colors (const char *arguments);
extern char irc_mode_get_chanmode_type (struct t_irc_server *server, extern char irc_mode_get_chanmode_type (struct t_irc_server *server,
char chanmode); char chanmode);
extern int irc_mode_channel_set (struct t_irc_server *server, extern int irc_mode_channel_set (struct t_irc_server *server,
+7 -7
View File
@@ -2178,7 +2178,7 @@ IRC_PROTOCOL_CALLBACK(mode)
} }
ptr_nick = irc_nick_search (ctxt->server, ptr_channel, ctxt->nick); ptr_nick = irc_nick_search (ctxt->server, ptr_channel, ctxt->nick);
ptr_buffer = (ptr_channel) ? ptr_channel->buffer : ctxt->server->buffer; ptr_buffer = (ptr_channel) ? ptr_channel->buffer : ctxt->server->buffer;
modes_args = irc_mode_get_arguments (msg_modes_args); modes_args = irc_mode_get_arguments_colors (msg_modes_args);
weechat_printf_datetime_tags ( weechat_printf_datetime_tags (
irc_msgbuffer_get_target_buffer (ctxt->server, NULL, ctxt->command, NULL, irc_msgbuffer_get_target_buffer (ctxt->server, NULL, ctxt->command, NULL,
ptr_buffer), ptr_buffer),
@@ -6811,7 +6811,7 @@ IRC_PROTOCOL_CALLBACK(367)
IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_DELIMITERS,
str_number, str_number,
IRC_COLOR_CHAT_HOST, IRC_COLOR_CHAT_HOST,
ctxt->params[2], /* banmask */ IRC_COLOR_MSG(ctxt->params[2]), /* banmask */
IRC_COLOR_RESET, IRC_COLOR_RESET,
(nick_address[0]) ? nick_address : "?", (nick_address[0]) ? nick_address : "?",
weechat_util_get_time_string (&datetime)); weechat_util_get_time_string (&datetime));
@@ -6834,7 +6834,7 @@ IRC_PROTOCOL_CALLBACK(367)
IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_DELIMITERS,
str_number, str_number,
IRC_COLOR_CHAT_HOST, IRC_COLOR_CHAT_HOST,
ctxt->params[2], /* banmask */ IRC_COLOR_MSG(ctxt->params[2]), /* banmask */
IRC_COLOR_RESET, IRC_COLOR_RESET,
(nick_address[0]) ? nick_address : "?"); (nick_address[0]) ? nick_address : "?");
} }
@@ -6857,7 +6857,7 @@ IRC_PROTOCOL_CALLBACK(367)
IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_DELIMITERS,
str_number, str_number,
IRC_COLOR_CHAT_HOST, IRC_COLOR_CHAT_HOST,
ctxt->params[2], /* banmask */ IRC_COLOR_MSG(ctxt->params[2]), /* banmask */
IRC_COLOR_RESET); IRC_COLOR_RESET);
} }
@@ -7386,7 +7386,7 @@ IRC_PROTOCOL_CALLBACK(728)
IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_DELIMITERS,
str_number, str_number,
IRC_COLOR_CHAT_HOST, IRC_COLOR_CHAT_HOST,
ctxt->params[3], /* quietmask */ IRC_COLOR_MSG(ctxt->params[3]), /* quietmask */
IRC_COLOR_RESET, IRC_COLOR_RESET,
(nick_address[0]) ? nick_address : "?", (nick_address[0]) ? nick_address : "?",
weechat_util_get_time_string (&datetime)); weechat_util_get_time_string (&datetime));
@@ -7409,7 +7409,7 @@ IRC_PROTOCOL_CALLBACK(728)
IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_DELIMITERS,
str_number, str_number,
IRC_COLOR_CHAT_HOST, IRC_COLOR_CHAT_HOST,
ctxt->params[3], /* quietmask */ IRC_COLOR_MSG(ctxt->params[3]), /* quietmask */
IRC_COLOR_RESET, IRC_COLOR_RESET,
(nick_address[0]) ? nick_address : "?"); (nick_address[0]) ? nick_address : "?");
} }
@@ -7432,7 +7432,7 @@ IRC_PROTOCOL_CALLBACK(728)
IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_DELIMITERS,
str_number, str_number,
IRC_COLOR_CHAT_HOST, IRC_COLOR_CHAT_HOST,
ctxt->params[3], /* quietmask */ IRC_COLOR_MSG(ctxt->params[3]), /* quietmask */
IRC_COLOR_RESET); IRC_COLOR_RESET);
} }
+28 -14
View File
@@ -1356,10 +1356,11 @@ relay_api_protocol_recv_http (struct t_relay_client *client)
} }
resource_not_found: resource_not_found:
if ((strcmp (client->http_req->method, "GET") != 0) if (!client->http_req->method
&& (strcmp (client->http_req->method, "POST") != 0) || ((strcmp (client->http_req->method, "GET") != 0)
&& (strcmp (client->http_req->method, "PUT") != 0) && (strcmp (client->http_req->method, "POST") != 0)
&& (strcmp (client->http_req->method, "DELETE") != 0)) && (strcmp (client->http_req->method, "PUT") != 0)
&& (strcmp (client->http_req->method, "DELETE") != 0)))
{ {
goto error_method_not_allowed; goto error_method_not_allowed;
} }
@@ -1392,15 +1393,28 @@ error_memory:
error: error:
if (weechat_relay_plugin->debug >= 1) if (weechat_relay_plugin->debug >= 1)
{ {
weechat_printf (NULL, if (client->http_req->method && client->http_req->path)
_("%s%s: failed to execute route \"%s %s\" " {
"for client %s%s%s"), weechat_printf (NULL,
weechat_prefix ("error"), _("%s%s: failed to execute route \"%s %s\" "
RELAY_PLUGIN_NAME, "for client %s%s%s"),
client->http_req->method, weechat_prefix ("error"),
client->http_req->path, RELAY_PLUGIN_NAME,
RELAY_COLOR_CHAT_CLIENT, client->http_req->method,
client->desc, client->http_req->path,
RELAY_COLOR_CHAT); RELAY_COLOR_CHAT_CLIENT,
client->desc,
RELAY_COLOR_CHAT);
}
else
{
weechat_printf (NULL,
_("%s%s: invalid data received from client %s%s%s"),
weechat_prefix ("error"),
RELAY_PLUGIN_NAME,
RELAY_COLOR_CHAT_CLIENT,
client->desc,
RELAY_COLOR_CHAT);
}
} }
} }
+86 -14
View File
@@ -25,11 +25,13 @@
extern "C" extern "C"
{ {
#include "src/gui/gui-color.h"
#include "src/plugins/irc/irc-color.h"
#include "src/plugins/irc/irc-mode.h" #include "src/plugins/irc/irc-mode.h"
} }
#define WEE_CHECK_GET_ARGS(__result, __arguments) \ #define WEE_CHECK_GET_ARGS(__result, __arguments) \
str = irc_mode_get_arguments (__arguments); \ str = irc_mode_get_arguments_colors (__arguments); \
STRCMP_EQUAL(__result, str); \ STRCMP_EQUAL(__result, str); \
free (str); free (str);
@@ -44,23 +46,93 @@ TEST_GROUP(IrcMode)
TEST(IrcMode, GetArguments) TEST(IrcMode, GetArguments)
{ {
char *str; char *str, string[1024], expected[1024];
/* invalid arguments */ /* invalid arguments */
WEE_CHECK_GET_ARGS("", irc_mode_get_arguments (NULL)); WEE_CHECK_GET_ARGS("", NULL);
WEE_CHECK_GET_ARGS("", irc_mode_get_arguments ("")); WEE_CHECK_GET_ARGS("", "");
WEE_CHECK_GET_ARGS("", irc_mode_get_arguments (" ")); WEE_CHECK_GET_ARGS("", " ");
/* simple arguments */ /* simple arguments */
WEE_CHECK_GET_ARGS("abc", irc_mode_get_arguments ("abc")); snprintf (string, sizeof (string), "abc%c02_blue", IRC_COLOR_COLOR_CHAR);
WEE_CHECK_GET_ARGS("abc def", irc_mode_get_arguments ("abc def")); snprintf (expected, sizeof (expected),
WEE_CHECK_GET_ARGS("abc def ghi", irc_mode_get_arguments ("abc def ghi")); "abc%s_blue%s",
gui_color_get_custom ("|blue"),
gui_color_get_custom ("reset"));
WEE_CHECK_GET_ARGS(expected, string);
snprintf (string, sizeof (string),
"abc%c02_blue def%c02_blue",
IRC_COLOR_COLOR_CHAR,
IRC_COLOR_COLOR_CHAR);
snprintf (expected, sizeof (expected),
"abc%s_blue%s def%s_blue%s",
gui_color_get_custom ("|blue"),
gui_color_get_custom ("reset"),
gui_color_get_custom ("|blue"),
gui_color_get_custom ("reset"));
WEE_CHECK_GET_ARGS(expected, string);
snprintf (string, sizeof (string),
"abc%c02_blue def%c02_blue ghi%c02_blue",
IRC_COLOR_COLOR_CHAR,
IRC_COLOR_COLOR_CHAR,
IRC_COLOR_COLOR_CHAR);
snprintf (expected, sizeof (expected),
"abc%s_blue%s def%s_blue%s ghi%s_blue%s",
gui_color_get_custom ("|blue"),
gui_color_get_custom ("reset"),
gui_color_get_custom ("|blue"),
gui_color_get_custom ("reset"),
gui_color_get_custom ("|blue"),
gui_color_get_custom ("reset"));
WEE_CHECK_GET_ARGS(expected, string);
/* some arguments starting with a colon */ /* some arguments starting with a colon */
WEE_CHECK_GET_ARGS("abc", irc_mode_get_arguments (":abc")); snprintf (string, sizeof (string), ":abc%c02_blue", IRC_COLOR_COLOR_CHAR);
WEE_CHECK_GET_ARGS("abc def", irc_mode_get_arguments (":abc def")); snprintf (expected, sizeof (expected),
WEE_CHECK_GET_ARGS("abc def", irc_mode_get_arguments ("abc :def")); "abc%s_blue%s",
WEE_CHECK_GET_ARGS("abc def ghi", irc_mode_get_arguments ("abc :def ghi")); gui_color_get_custom ("|blue"),
WEE_CHECK_GET_ARGS("abc def ghi", irc_mode_get_arguments ("abc :def :ghi")); gui_color_get_custom ("reset"));
WEE_CHECK_GET_ARGS("abc def ghi", irc_mode_get_arguments (":abc :def :ghi")); WEE_CHECK_GET_ARGS(expected, string);
snprintf (string, sizeof (string),
":abc%c02_blue def%c02_blue",
IRC_COLOR_COLOR_CHAR,
IRC_COLOR_COLOR_CHAR);
snprintf (expected, sizeof (expected),
"abc%s_blue%s def%s_blue%s",
gui_color_get_custom ("|blue"),
gui_color_get_custom ("reset"),
gui_color_get_custom ("|blue"),
gui_color_get_custom ("reset"));
WEE_CHECK_GET_ARGS(expected, string);
snprintf (string, sizeof (string),
"abc%c02_blue :def%c02_blue",
IRC_COLOR_COLOR_CHAR,
IRC_COLOR_COLOR_CHAR);
WEE_CHECK_GET_ARGS(expected, string);
snprintf (string, sizeof (string),
"abc%c02_blue :def%c02_blue ghi%c02_blue",
IRC_COLOR_COLOR_CHAR,
IRC_COLOR_COLOR_CHAR,
IRC_COLOR_COLOR_CHAR);
snprintf (expected, sizeof (expected),
"abc%s_blue%s def%s_blue%s ghi%s_blue%s",
gui_color_get_custom ("|blue"),
gui_color_get_custom ("reset"),
gui_color_get_custom ("|blue"),
gui_color_get_custom ("reset"),
gui_color_get_custom ("|blue"),
gui_color_get_custom ("reset"));
WEE_CHECK_GET_ARGS(expected, string);
snprintf (string, sizeof (string),
"abc%c02_blue :def%c02_blue :ghi%c02_blue",
IRC_COLOR_COLOR_CHAR,
IRC_COLOR_COLOR_CHAR,
IRC_COLOR_COLOR_CHAR);
WEE_CHECK_GET_ARGS(expected, string);
snprintf (string, sizeof (string),
":abc%c02_blue :def%c02_blue :ghi%c02_blue",
IRC_COLOR_COLOR_CHAR,
IRC_COLOR_COLOR_CHAR,
IRC_COLOR_COLOR_CHAR);
WEE_CHECK_GET_ARGS(expected, string);
} }
+47 -28
View File
@@ -2316,6 +2316,22 @@ TEST(IrcProtocolWithServer, mode)
"irc_mode,nick_admin,host_user@host,log3"); "irc_mode,nick_admin,host_user@host,log3");
STRCMP_EQUAL(NULL, ptr_channel->modes); STRCMP_EQUAL(NULL, ptr_channel->modes);
/* bans added on channel */
RECV(":admin!user@host MODE #test +bb "
"bob!user_\00304red@host_\00304red "
"carol!user_\00304red@host_\00304red");
CHECK_CHAN("--", "Mode #test [+bb bob!user_red@host_red "
"carol!user_red@host_red] by admin",
"irc_mode,nick_admin,host_user@host,log3");
/* bans removed from channel */
RECV(":admin!user@host MODE #test -bb "
"bob!user_\00304red@host_\00304red "
"carol!user_\00304red@host_\00304red");
CHECK_CHAN("--", "Mode #test [-bb bob!user_red@host_red "
"carol!user_red@host_red] by admin",
"irc_mode,nick_admin,host_user@host,log3");
/* nick mode '@' on channel #test */ /* nick mode '@' on channel #test */
RECV(":admin!user@host MODE #test +o alice "); RECV(":admin!user@host MODE #test +o alice ");
CHECK_CHAN("--", "Mode #test [+o alice] by admin", CHECK_CHAN("--", "Mode #test [+o alice] by admin",
@@ -5600,30 +5616,32 @@ TEST(IrcProtocolWithServer, 367)
RECV(":server 367 alice #test"); RECV(":server 367 alice #test");
CHECK_ERROR_PARAMS("367", 2, 3); CHECK_ERROR_PARAMS("367", 2, 3);
RECV(":server 367 alice #test nick1!user1@host1"); RECV(":server 367 alice #test nick1!user1@host1_\00304red");
CHECK_CHAN("--", "[#test] [1] nick1!user1@host1 banned", CHECK_CHAN("--", "[#test] [1] nick1!user1@host1_red banned",
"irc_367,irc_numeric,nick_server,log3"); "irc_367,irc_numeric,nick_server,log3");
RECV(":server 367 alice #test nick1!user1@host1 nick2!user2@host2 "); RECV(":server 367 alice #test nick1!user1_\00304red@host1_\00304red "
"nick2!user2_\00304red@host2_\00304red ");
CHECK_CHAN("--", CHECK_CHAN("--",
"[#test] [2] nick1!user1@host1 banned by nick2 (user2@host2)", "[#test] [2] nick1!user1_red@host1_red banned by nick2 (user2_red@host2_red)",
"irc_367,irc_numeric,nick_server,log3"); "irc_367,irc_numeric,nick_server,log3");
RECV(":server 367 alice #test nick1!user1@host1 nick2!user2@host2 " RECV(":server 367 alice #test nick1!user1_\00304red@host1_\00304red "
"1205585109 "); "nick2!user2_\00304red@host2_\00304red 1205585109 ");
CHECK_CHAN("--", CHECK_CHAN("--",
"[#test] [3] nick1!user1@host1 banned " "[#test] [3] nick1!user1_red@host1_red banned "
"by nick2 (user2@host2) on Sat, 15 Mar 2008 12:45:09", "by nick2 (user2_red@host2_red) on Sat, 15 Mar 2008 12:45:09",
"irc_367,irc_numeric,nick_server,log3"); "irc_367,irc_numeric,nick_server,log3");
/* channel not found */ /* channel not found */
RECV(":server 367 alice #xyz nick1!user1@host1"); RECV(":server 367 alice #xyz nick1!user1_\00304red@host1_\00304red");
CHECK_SRV("--", "[#xyz] nick1!user1@host1 banned", CHECK_SRV("--", "[#xyz] nick1!user1_red@host1_red banned",
"irc_367,irc_numeric,nick_server,log3"); "irc_367,irc_numeric,nick_server,log3");
RECV(":server 367 alice #xyz nick1!user1@host1 nick2!user2@host2"); RECV(":server 367 alice #xyz nick1!user1_\00304red@host1_\00304red "
CHECK_SRV("--", "[#xyz] nick1!user1@host1 banned by nick2 (user2@host2)", "nick2!user2_\00304red@host2_\00304red");
CHECK_SRV("--", "[#xyz] nick1!user1_red@host1_red banned by nick2 (user2_red@host2_red)",
"irc_367,irc_numeric,nick_server,log3"); "irc_367,irc_numeric,nick_server,log3");
RECV(":server 367 alice #xyz nick1!user1@host1 nick2!user2@host2 " RECV(":server 367 alice #xyz nick1!user1_\00304red@host1_\00304red "
"1205585109"); "nick2!user2_\00304red@host2_\00304red 1205585109");
CHECK_SRV("--", "[#xyz] nick1!user1@host1 banned by nick2 (user2@host2) " CHECK_SRV("--", "[#xyz] nick1!user1_red@host1_red banned by nick2 (user2_red@host2_red) "
"on Sat, 15 Mar 2008 12:45:09", "on Sat, 15 Mar 2008 12:45:09",
"irc_367,irc_numeric,nick_server,log3"); "irc_367,irc_numeric,nick_server,log3");
} }
@@ -7208,29 +7226,30 @@ TEST(IrcProtocolWithServer, 728)
RECV(":server 728 alice #test q"); RECV(":server 728 alice #test q");
CHECK_ERROR_PARAMS("728", 3, 4); CHECK_ERROR_PARAMS("728", 3, 4);
RECV(":server 728 alice #test q nick1!user1@host1"); RECV(":server 728 alice #test q nick1!user1_\00304red@host1_\00304red");
CHECK_CHAN("--", "[#test] nick1!user1@host1 quieted", CHECK_CHAN("--", "[#test] nick1!user1_red@host1_red quieted",
"irc_728,irc_numeric,nick_server,log3"); "irc_728,irc_numeric,nick_server,log3");
RECV(":server 728 alice #test q nick1!user1@host1 alice!user@host"); RECV(":server 728 alice #test q nick1!user1_\00304red@host1_\00304red "
CHECK_CHAN("--", "[#test] nick1!user1@host1 quieted by alice (user@host)", "alice!user_\00304red@host_\00304red");
CHECK_CHAN("--", "[#test] nick1!user1_red@host1_red quieted by alice (user_red@host_red)",
"irc_728,irc_numeric,nick_server,log3"); "irc_728,irc_numeric,nick_server,log3");
RECV(":server 728 alice #test q nick1!user1@host1 alice!user@host " RECV(":server 728 alice #test q nick1!user1_\00304red@host1_\00304red "
"1351350090 "); "alice!user_\00304red@host_\00304red 1351350090 ");
CHECK_CHAN("--", CHECK_CHAN("--",
"[#test] nick1!user1@host1 quieted by alice (user@host) " "[#test] nick1!user1_red@host1_red quieted by alice (user_red@host_red) "
"on Sat, 27 Oct 2012 15:01:30", "on Sat, 27 Oct 2012 15:01:30",
"irc_728,irc_numeric,nick_server,log3"); "irc_728,irc_numeric,nick_server,log3");
/* channel not found */ /* channel not found */
RECV(":server 728 alice #xyz q nick1!user1@host1"); RECV(":server 728 alice #xyz q nick1!user1_\00304red@host1_\00304red");
CHECK_SRV("--", "[#xyz] nick1!user1@host1 quieted", CHECK_SRV("--", "[#xyz] nick1!user1_red@host1_red quieted",
"irc_728,irc_numeric,nick_server,log3"); "irc_728,irc_numeric,nick_server,log3");
RECV(":server 728 alice #xyz q nick1!user1@host1 alice!user@host"); RECV(":server 728 alice #xyz q nick1!user1_\00304red@host1_\00304red alice!user_\00304red@host_\00304red");
CHECK_SRV("--", "[#xyz] nick1!user1@host1 quieted by alice (user@host)", CHECK_SRV("--", "[#xyz] nick1!user1_red@host1_red quieted by alice (user_red@host_red)",
"irc_728,irc_numeric,nick_server,log3"); "irc_728,irc_numeric,nick_server,log3");
RECV(":server 728 alice #xyz q nick1!user1@host1 alice!user@host " RECV(":server 728 alice #xyz q nick1!user1_\00304red@host1_\00304red alice!user_\00304red@host_\00304red "
"1351350090 "); "1351350090 ");
CHECK_SRV("--", "[#xyz] nick1!user1@host1 quieted by alice (user@host) " CHECK_SRV("--", "[#xyz] nick1!user1_red@host1_red quieted by alice (user_red@host_red) "
"on Sat, 27 Oct 2012 15:01:30", "on Sat, 27 Oct 2012 15:01:30",
"irc_728,irc_numeric,nick_server,log3"); "irc_728,irc_numeric,nick_server,log3");
} }
+2 -2
View File
@@ -41,8 +41,8 @@
# devel-number the devel version as hex number ("0x04010000" for "4.1.0-dev") # devel-number the devel version as hex number ("0x04010000" for "4.1.0-dev")
# #
weechat_stable="4.7.0" weechat_stable="4.7.2"
weechat_devel="4.7.0" weechat_devel="4.7.2"
stable_major=$(echo "${weechat_stable}" | cut -d"." -f1) stable_major=$(echo "${weechat_stable}" | cut -d"." -f1)
stable_minor=$(echo "${weechat_stable}" | cut -d"." -f2) stable_minor=$(echo "${weechat_stable}" | cut -d"." -f2)