diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index aec33fbba..eb04b70e6 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -15,6 +15,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] == Version 1.0 (under dev) +* core: display curl error after a failed download * core: do not display content of passphrase on /secure buffer * core: add option "env" in command /set (manage environment variables) * core: fix potential memory leak with infolists not freed in plugins diff --git a/po/cs.po b/po/cs.po index 3c43a8a31..f76ae6401 100644 --- a/po/cs.po +++ b/po/cs.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-06-29 11:41+0200\n" +"POT-Creation-Date: 2014-07-05 22:14+0200\n" "PO-Revision-Date: 2014-06-28 13:18+0200\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -3972,6 +3972,10 @@ msgstr "" "čtení - špatný podpis (formát aktualizačního souboru se mohl změnit od " "poslední verze)" +#, c-format +msgid "curl error %d (%s) (URL: \"%s\")\n" +msgstr "" + #, c-format msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)" msgstr "" diff --git a/po/de.po b/po/de.po index 9f519a8af..5c54485b6 100644 --- a/po/de.po +++ b/po/de.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-06-29 11:41+0200\n" +"POT-Creation-Date: 2014-07-05 22:14+0200\n" "PO-Revision-Date: 2014-06-29 12:38+0100\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -4645,6 +4645,10 @@ msgstr "" "lese - falsche Signatur (das Dateiformat wurde vermutlich seit der letzten " "Version verändern)" +#, c-format +msgid "curl error %d (%s) (URL: \"%s\")\n" +msgstr "" + #, c-format msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)" msgstr "" diff --git a/po/es.po b/po/es.po index 59921c4fc..a13f3a3f2 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-06-29 11:41+0200\n" +"POT-Creation-Date: 2014-07-05 22:14+0200\n" "PO-Revision-Date: 2014-06-28 13:18+0200\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -4183,6 +4183,10 @@ msgstr "" "lectura - firma incorrecta (el formato del archivo de actualización puede " "haber cambiado desde la última versión)" +#, c-format +msgid "curl error %d (%s) (URL: \"%s\")\n" +msgstr "" + #, c-format msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)" msgstr "%sError: límite inválido para el recurso \"%s\": %s (debe ser >= -1)" diff --git a/po/fr.po b/po/fr.po index 931fa09db..4058bb1d8 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-06-29 11:41+0200\n" -"PO-Revision-Date: 2014-06-29 11:44+0200\n" +"POT-Creation-Date: 2014-07-05 22:14+0200\n" +"PO-Revision-Date: 2014-07-05 22:15+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -4542,6 +4542,10 @@ msgstr "" "lecture - mauvaise signature (le format de fichier upgrade a peut-être " "changé depuis la dernière version)" +#, c-format +msgid "curl error %d (%s) (URL: \"%s\")\n" +msgstr "erreur curl %d (%s) (URL : \"%s\")\n" + #, c-format msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)" msgstr "%sErreur : limite de ressource \"%s\" invalide : %s (doit être >= 1)" diff --git a/po/hu.po b/po/hu.po index 9553d61a4..0b294d40e 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-06-29 11:41+0200\n" +"POT-Creation-Date: 2014-07-05 22:14+0200\n" "PO-Revision-Date: 2014-06-28 13:18+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -3599,6 +3599,10 @@ msgid "" "version)" msgstr "" +#, c-format +msgid "curl error %d (%s) (URL: \"%s\")\n" +msgstr "" + #, c-format msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)" msgstr "" diff --git a/po/it.po b/po/it.po index 1d17a1803..5a25edc18 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-06-29 11:41+0200\n" +"POT-Creation-Date: 2014-07-05 22:14+0200\n" "PO-Revision-Date: 2014-06-28 14:49+0200\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -4306,6 +4306,10 @@ msgstr "" "lettura - firma errata (l'aggiornamento del formato del file potrebbe essere " "cambiato dall'ultima versione)" +#, c-format +msgid "curl error %d (%s) (URL: \"%s\")\n" +msgstr "" + #, c-format msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)" msgstr "" diff --git a/po/ja.po b/po/ja.po index 8360d2d99..7ad4f9359 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-06-29 11:41+0200\n" +"POT-Creation-Date: 2014-07-05 22:14+0200\n" "PO-Revision-Date: 2014-06-28 14:49+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" @@ -4353,6 +4353,10 @@ msgstr "" "読み込み - 不正な署名 (ファイルフォーマットのアップグレードが最新バージョンか" "ら変更された可能性があります)" +#, c-format +msgid "curl error %d (%s) (URL: \"%s\")\n" +msgstr "" + #, c-format msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)" msgstr "" diff --git a/po/pl.po b/po/pl.po index 92778987d..92bc4d0f0 100644 --- a/po/pl.po +++ b/po/pl.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-06-29 11:41+0200\n" +"POT-Creation-Date: 2014-07-05 22:14+0200\n" "PO-Revision-Date: 2014-06-28 14:49+0200\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: weechat-dev \n" @@ -4427,6 +4427,10 @@ msgid "" msgstr "" "odczyt - zła sygnatura (format pliku mógł ulec zmianie od poprzedniej wersji)" +#, c-format +msgid "curl error %d (%s) (URL: \"%s\")\n" +msgstr "" + #, c-format msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)" msgstr "%sBłąd: zły limit dla zasobu \"%s\": %s (musi być >= -1)" diff --git a/po/pt_BR.po b/po/pt_BR.po index db92033b4..d5c3a2572 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-06-29 11:41+0200\n" +"POT-Creation-Date: 2014-07-05 22:14+0200\n" "PO-Revision-Date: 2014-06-28 13:18+0200\n" "Last-Translator: Sergio Durigan Junior \n" "Language-Team: weechat-dev \n" @@ -4070,6 +4070,10 @@ msgid "" "version)" msgstr "" +#, c-format +msgid "curl error %d (%s) (URL: \"%s\")\n" +msgstr "" + #, c-format msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)" msgstr "" diff --git a/po/ru.po b/po/ru.po index 5cfc8f75f..90dde9447 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-06-29 11:41+0200\n" +"POT-Creation-Date: 2014-07-05 22:14+0200\n" "PO-Revision-Date: 2014-06-28 13:18+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -3628,6 +3628,10 @@ msgid "" "version)" msgstr "" +#, c-format +msgid "curl error %d (%s) (URL: \"%s\")\n" +msgstr "" + #, c-format msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)" msgstr "" diff --git a/po/tr.po b/po/tr.po index 1c065625b..dd3e9e631 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-06-29 11:41+0200\n" +"POT-Creation-Date: 2014-07-05 22:14+0200\n" "PO-Revision-Date: 2014-06-28 13:18+0200\n" "Last-Translator: Hasan Kiran \n" "Language-Team: weechat-dev \n" @@ -3234,6 +3234,10 @@ msgid "" "version)" msgstr "" +#, c-format +msgid "curl error %d (%s) (URL: \"%s\")\n" +msgstr "" + #, c-format msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)" msgstr "" diff --git a/po/weechat.pot b/po/weechat.pot index eb2ff610f..928d539b6 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-06-29 11:41+0200\n" +"POT-Creation-Date: 2014-07-05 22:14+0200\n" "PO-Revision-Date: 2013-02-14 18:20+0100\n" "Last-Translator: FULL NAME \n" "Language-Team: weechat-dev \n" @@ -3234,6 +3234,10 @@ msgid "" "version)" msgstr "" +#, c-format +msgid "curl error %d (%s) (URL: \"%s\")\n" +msgstr "" + #, c-format msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)" msgstr "" diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c index 5a12ec8f2..a72324833 100644 --- a/src/core/wee-hook.c +++ b/src/core/wee-hook.c @@ -1528,8 +1528,6 @@ hook_process_child (struct t_hook *hook_process) ptr_url++; } rc = weeurl_download (ptr_url, HOOK_PROCESS(hook_process, options)); - if (rc != 0) - fprintf (stderr, "Error with URL '%s'\n", ptr_url); } else { diff --git a/src/core/wee-url.c b/src/core/wee-url.c index 8b75ec43c..88df5a105 100644 --- a/src/core/wee-url.c +++ b/src/core/wee-url.c @@ -885,6 +885,8 @@ struct t_url_option url_options[] = { NULL, 0, 0, NULL }, }; +char url_error[CURL_ERROR_SIZE + 1]; + /* * Searches for a constant in array of constants. @@ -1160,7 +1162,7 @@ weeurl_download (const char *url, struct t_hashtable *options) CURLoption url_file_opt_data[2] = { CURLOPT_READDATA, CURLOPT_WRITEDATA }; void *url_file_opt_cb[2] = { &weeurl_read, &weeurl_write }; struct t_proxy *ptr_proxy; - int rc, i; + int rc, curl_rc, i; rc = 0; @@ -1219,9 +1221,18 @@ weeurl_download (const char *url, struct t_hashtable *options) /* set other options in hashtable */ hashtable_map (options, &weeurl_option_map_cb, curl); + /* set error buffer */ + curl_easy_setopt (curl, CURLOPT_ERRORBUFFER, url_error); + /* perform action! */ - if (curl_easy_perform (curl) != CURLE_OK) + curl_rc = curl_easy_perform (curl); + if (curl_rc != CURLE_OK) + { + fprintf (stderr, + _("curl error %d (%s) (URL: \"%s\")\n"), + curl_rc, url_error, url); rc = 2; + } /* cleanup */ curl_easy_cleanup (curl);