From 6077896ffc27289df222693907d41c1bdfa44558 Mon Sep 17 00:00:00 2001 From: Burer Date: Sun, 28 Sep 2025 17:09:25 +0300 Subject: [PATCH] [apps/cmm]: fix new proxy url building --- programs/cmm/browser/WebView.c | 7 ++++--- programs/cmm/browser/settings.h | 2 +- programs/cmm/downloader/dl.c | 9 ++++----- programs/cmm/downloader/settings.h | 2 +- programs/cmm/lib/obj/http.h | 1 - 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/programs/cmm/browser/WebView.c b/programs/cmm/browser/WebView.c index f5ce82d4c..a5f94ed13 100644 --- a/programs/cmm/browser/WebView.c +++ b/programs/cmm/browser/WebView.c @@ -68,6 +68,7 @@ _http http = 0; progress_bar prbar; proc_info Form; +char settings_file[4096]; char proxy_address[4096]; #include "settings.h" @@ -523,12 +524,12 @@ bool GetLocalFileData(dword _path) bool GetUrl(dword _http_url) { char new_url_full[URL_SIZE+1]; - if (!strncmp(_http_url,"http:",5)) { + if (!strncmp(_http_url,"http://",7)) { http.get(_http_url); return true; } else if (!strncmp(_http_url,"https://",8)) { - if (proxy_address) { - strcpy(#new_url_full, proxy_address); + if (#proxy_address) { + strcpy(#new_url_full, #proxy_address); strncat(#new_url_full, _http_url, URL_SIZE); http.get(#new_url_full); return true; diff --git a/programs/cmm/browser/settings.h b/programs/cmm/browser/settings.h index d64ef75b8..cddde5cc7 100644 --- a/programs/cmm/browser/settings.h +++ b/programs/cmm/browser/settings.h @@ -2,7 +2,7 @@ _ini ini; void LoadIniConfig() { - ini.path = GetIni("/sys/settings/app.ini", "app.ini"); + ini.path = GetIni(#settings_file, "app.ini"); ini.section = "WebView"; ini.GetString("proxy", #proxy_address, sizeof(proxy_address), NULL); diff --git a/programs/cmm/downloader/dl.c b/programs/cmm/downloader/dl.c index 0ebd9f5d4..747c24dc5 100644 --- a/programs/cmm/downloader/dl.c +++ b/programs/cmm/downloader/dl.c @@ -24,6 +24,8 @@ checkbox autoclose = { T_AUTOCLOSE, false }; char uEdit[URL_SIZE]; char filepath[4096]; char save_dir[4096]; + +char settings_file[4096]; char proxy_address[4096]; #include "settings.h" @@ -178,11 +180,8 @@ void StartDownloading() if (http.transfer > 0) return; ResetDownloadSpeed(); pb.back_color = 0xFFFfff; - if (!strncmp(#uEdit,"https:",6)) { - // Build: "" - miniprintf(#get_url, "%s%s", proxy_address, #uEdit); - // notify("'HTTPS for download temporary is not supported,\ntrying to download the file via HTTP' -W"); - // miniprintf(#uEdit, "http://%s", #uEdit+8); + if (!strncmp(#uEdit,"https://",8)) { + miniprintf(#get_url, "%s%s", #proxy_address, #uEdit); } strcpy(#get_url, #uEdit); diff --git a/programs/cmm/downloader/settings.h b/programs/cmm/downloader/settings.h index d64ef75b8..cddde5cc7 100644 --- a/programs/cmm/downloader/settings.h +++ b/programs/cmm/downloader/settings.h @@ -2,7 +2,7 @@ _ini ini; void LoadIniConfig() { - ini.path = GetIni("/sys/settings/app.ini", "app.ini"); + ini.path = GetIni(#settings_file, "app.ini"); ini.section = "WebView"; ini.GetString("proxy", #proxy_address, sizeof(proxy_address), NULL); diff --git a/programs/cmm/lib/obj/http.h b/programs/cmm/lib/obj/http.h index 1d23e6c0a..d9cbf9987 100644 --- a/programs/cmm/lib/obj/http.h +++ b/programs/cmm/lib/obj/http.h @@ -112,7 +112,6 @@ struct _http dword _http::get(dword _url) { cur_url = _url; - // if (streqrp(cur_url, "http://176.223.130.192:82/?site=")) cur_url += 29; http_get stdcall (_url, 0, 0, #accept_language); transfer = EAX; return EAX;