diff --git a/Makefile b/Makefile index a278652..1d80ab5 100644 --- a/Makefile +++ b/Makefile @@ -75,6 +75,12 @@ ifeq ($(strip $(NOGIT)),) VERSION_MINOR := $(shell echo $(VERSION) | cut -c2- | cut -f1 -d- | cut -f2 -d.) VERSION_BUILD := $(shell echo $(VERSION) | cut -c2- | cut -f1 -d- | cut -f3 -d.) + ifeq ($(strip $(VERSION_MAJOR)),) + VERSION_MAJOR := 0 + endif + ifeq ($(strip $(VERSION_MINOR)),) + VERSION_MINOR := 0 + endif ifeq ($(strip $(VERSION_BUILD)),) VERSION_BUILD := 0 endif diff --git a/include/ui_strings.h b/include/ui_strings.h index 5f90505..fed72a7 100644 --- a/include/ui_strings.h +++ b/include/ui_strings.h @@ -130,6 +130,9 @@ typedef struct { const char *parental_fail; const char *zip_not_found; const char *generic_httpc_error; + const char *http_timeout; + const char *http_no_network; + const char *http_ssl_error; const char *http303_tp; const char *http303; const char *http404; diff --git a/source/remote.c b/source/remote.c index 6519b1f..3a5b387 100644 --- a/source/remote.c +++ b/source/remote.c @@ -1180,22 +1180,43 @@ static Result http_get_with_not_found_flag(const char * url, char ** filename, c break; case HTTPC_ERROR: DEBUG("httpc error %lx\n", _header.result_code); - if (_header.result_code == 0xd8a0a03c) + switch (_header.result_code) { - // SSL failure - try curl? + case 0xd8a0a028: // bad zip file + case 0xd8a0a03c: // SSL failure + // try curl? res = curl_http_get(url, filename, buf, size, acceptable_mime_types); if (R_SUCCEEDED(res)) { return res; - } else if (res == -2) + } + + if(_header.result_code == 0xd8a0a028) { snprintf(err_buf, ERROR_BUFFER_SIZE, zip_not_available); - goto error; } + else + { + snprintf(err_buf, ERROR_BUFFER_SIZE, language.remote.http_ssl_error, _header.result_code); + } + quit = false; + break; + case 0xd8a0a049: + // Timeout (bad wifi/proxy) + snprintf(err_buf, ERROR_BUFFER_SIZE, language.remote.http_timeout); + quit = false; + break; + case 0xd8a0a046: + // poor reception/no wifi/custom dns set + snprintf(err_buf, ERROR_BUFFER_SIZE, language.remote.http_no_network); + quit = false; + break; + default: + snprintf(err_buf, ERROR_BUFFER_SIZE, language.remote.generic_httpc_error, _header.result_code); + quit = true; + break; } - snprintf(err_buf, ERROR_BUFFER_SIZE, language.remote.generic_httpc_error, _header.result_code); throw_error(err_buf, ERROR_LEVEL_ERROR); - quit = true; httpcCloseContext(&context); return _header.result_code; case SEE_OTHER: diff --git a/source/ui_strings.c b/source/ui_strings.c index 7baba56..8e48fef 100644 --- a/source/ui_strings.c +++ b/source/ui_strings.c @@ -263,6 +263,9 @@ const Language_s language_english = { .parental_fail = "Parental Control validation failed!\nBrowser Access restricted.", .zip_not_found = "ZIP not found at this URL\nIf you believe this is an error, please\ncontact the site administrator", .generic_httpc_error = "Error in HTTPC sysmodule - 0x%08lx.\nIf you are seeing this, please contact an\nAnemone developer on the Theme Plaza Discord.", + .http_timeout = "HTTP Timeout.\nCheck your Wi-Fi signal and remove\nany proxy settings if set and try again.", + .http_no_network = "Unable to connect to the Internet.\nCheck your Internet settings in the\nSystem Settings and try again.", + .http_ssl_error = "SSL Error - 0x%08lx.\nCheck if the date/time is correct,\nand that Anemone is up to date.", .http303_tp = "HTTP 303 See Other (Theme Plaza)\nHas this theme been approved?", .http303 = "HTTP 303 See Other\nDownload the resource directly\nor contact the site administrator.", .http404 = "HTTP 404 Not Found\nHas this theme been approved?", @@ -669,6 +672,9 @@ const Language_s language_spanish = { .parental_fail = "¡La validación del Control Parental falló!\nAcceso al navegador restringido.", .zip_not_found = "ZIP no encontrado en esta URL\nSi crees que esto es un error, por favor\ncontacta al administrador del sitio", .generic_httpc_error = "Error en el módulo sysmodule HTTPC - 0x%08lx.\nSi estás viendo esto, por favor contacta a un\ndesarrollador de Anemone en el Discord de Theme Plaza.", + .http_timeout = "HTTP Timeout.\nCheck your Wi-Fi signal and remove\nany proxy settings if set and try again.", + .http_no_network = "Unable to connect to the Internet.\nCheck your Internet settings in the\nSystem Settings and try again.", + .http_ssl_error = "SSL Error - 0x%08lx.\nCheck if the date/time is correct,\nand that Anemone is up to date.", .http303_tp = "HTTP 303 Ver Otro (Theme Plaza)\n¿Se ha aprobado este tema?", .http303 = "HTTP 303 Ver Otro\nDescarga el recurso directamente\no contacta al administrador del sitio.", .http404 = "HTTP 404 No Encontrado\n¿Se ha aprobado este tema?", @@ -1076,6 +1082,9 @@ const Language_s language_french = { .parental_fail = "Échec de la verification du contrôle parental.\nL'accès au site est restreint.", .zip_not_found = "Le ZIP n'a pas été trouvé sur cette URL.\nSi vous pensez que c'est une erreur,\ncontactez l'administrateur du site.", .generic_httpc_error = "Error in HTTPC sysmodule - 0x%08lx.\nSi vous voyez ceci, merci de contacter\nun développeur d'Anemone sur le serveur\nDiscord de ThemePlaza.", + .http_timeout = "HTTP Timeout.\nVérifiez la réception du signal Wifi et\nretirez les paramètres proxy si nécessaire,\npuis réessayez.", + .http_no_network = "Impossible de se connecter à Internet.\nVérifiez les paramètres de connexion\ndans les paramètres de la console,\npuis réessayez.", + .http_ssl_error = "SSL Error - 0x%08lx.\nVérifiez la date et l'heure\net que Anemone est à jour.", .http303_tp = "HTTP 303 See Other (Theme Plaza)\nLe thème est-il approuvé?", .http303 = "HTTP 303 See Other\nTéléchargez la ressource directement\nou contactez l'administrateur du site.", .http404 = "HTTP 404 Not Found\nLe thème est-il approuvé?", @@ -1482,6 +1491,9 @@ const Language_s language_portuguese = { .parental_fail = "A validação dos controles parentais falhou!\nNavegador restrito.", .zip_not_found = "ZIP não encontrado neste URL\nSe achar que isso é um erro,\ncontate o administrador do site", .generic_httpc_error = "Error in HTTPC sysmodule - 0x%08lx.\nSe estiver vendo isso, contate um\ndesenvolvedor do Anenome no discord Theme Plaza.", + .http_timeout = "HTTP Timeout.\nCheck your Wi-Fi signal and remove\nany proxy settings if set and try again.", + .http_no_network = "Unable to connect to the Internet.\nCheck your Internet settings in the\nSystem Settings and try again.", + .http_ssl_error = "SSL Error - 0x%08lx.\nCheck if the date/time is correct,\nand that Anemone is up to date.", .http303_tp = "HTTP 303 See Other (Theme Plaza)\nEsse tema foi aprovado?", .http303 = "HTTP 303 See Other\nBaixe o recurso diretamente\nou contate o administrador do site.", .http404 = "HTTP 404 Not Found\nEsse tema foi aprovado?", @@ -1891,6 +1903,9 @@ const Language_s language_korean = { .parental_fail = "Parental Control validation failed!\nBrowser Access restricted.", .zip_not_found = "ZIP not found at this URL\nIf you believe this is an error, please\ncontact the site administrator", .generic_httpc_error = "Error in HTTPC sysmodule - 0x%08lx.\nIf you are seeing this, please contact an\nAnemone developer on the Theme Plaza Discord.", + .http_timeout = "HTTP Timeout.\nCheck your Wi-Fi signal and remove\nany proxy settings if set and try again.", + .http_no_network = "Unable to connect to the Internet.\nCheck your Internet settings in the\nSystem Settings and try again.", + .http_ssl_error = "SSL Error - 0x%08lx.\nCheck if the date/time is correct,\nand that Anemone is up to date.", .http303_tp = "HTTP 303 See Other (Theme Plaza)\nHas this theme been approved?", .http303 = "HTTP 303 See Other\nDownload the resource directly\nor contact the site administrator.", .http404 = "HTTP 404 Not Found\nHas this theme been approved?",