[apps/cmm]: fix new proxy url building
All checks were successful
Build system / Check kernel codestyle (pull_request) Successful in 1m37s
Build system / Build (pull_request) Successful in 1h25m31s

This commit is contained in:
2025-09-28 17:09:25 +03:00
parent 305595d12d
commit 6077896ffc
5 changed files with 10 additions and 11 deletions

View File

@@ -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;

View File

@@ -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);

View File

@@ -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: "<proxy_address><original https url>"
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);

View File

@@ -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);

View File

@@ -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;