Compare commits

...

1 Commits

Author SHA1 Message Date
Chee Yee 93fb338ce0 failed install to display server error message 2024-11-08 00:38:31 -08:00
5 changed files with 20 additions and 5 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ add_executable(ezremote_client
add_self(ezremote_client)
add_pkg(ezremote_client ${CMAKE_SOURCE_DIR}/data "RMTC00001" "ezRemote Client" "01.30" 32 0)
add_pkg(ezremote_client ${CMAKE_SOURCE_DIR}/data "RMTC00001" "ezRemote Client" "01.31" 32 0)
target_link_libraries(ezremote_client
c
+1 -1
View File
@@ -1157,7 +1157,7 @@ namespace Actions
int ret = tmp_client.Size(path, &bytes_to_download);
if (ret == 0)
{
sprintf(status_message, "%s - %s", lang_strings[STR_FAILED], lang_strings[STR_CANNOT_READ_PKG_HDR_MSG]);
sprintf(status_message, "%s", tmp_client.LastResponse());
tmp_client.Quit();
activity_inprogess = false;
Windows::SetModalMode(false);
+5 -1
View File
@@ -90,7 +90,7 @@ int BaseClient::Size(const std::string &path, int64_t *size)
*size = atoll(content_length.c_str());
return 1;
}
else // Server doesn't support HEAD request. Try get range with 0 bytes and grab size from the response header
else if (res->status == 405)// Server doesn't support HEAD request. Try get range with 0 bytes and grab size from the response header
// example: Content-Range: bytes 0-10/4372785
{
Headers headers = {{"Range", "bytes=0-1"}};
@@ -111,6 +111,10 @@ int BaseClient::Size(const std::string &path, int64_t *size)
}
}
}
else
{
sprintf(this->response, "%d - %s", res->status, detail::status_message(res->status));
}
}
else
{
+2
View File
@@ -1898,6 +1898,8 @@ make_basic_authentication_header(const std::string &username,
namespace detail {
const char *status_message(int status);
std::string encode_query_param(const std::string &value);
std::string encode_url(const std::string &s);
+11 -2
View File
@@ -1292,7 +1292,7 @@ namespace HttpServer
failed(res, 200, lang_strings[STR_CANT_EXTRACT_URL_MSG]);
activity_inprogess = false;
file_transfering = false;
Windows::SetModalMode(true);
Windows::SetModalMode(false);
return;
}
delete(filehost);
@@ -1305,6 +1305,15 @@ namespace HttpServer
BaseClient *baseclient = new BaseClient();
baseclient->Connect(host, "", "");
if (!baseclient->FileExists(path))
{
failed(res, 200, baseclient->LastResponse());
activity_inprogess = false;
file_transfering = false;
Windows::SetModalMode(false);
return;
}
baseclient->Head(path, &header, sizeof(pkg_header));
if (BE32(header.pkg_magic) == 0x7F434E54)
@@ -1322,7 +1331,7 @@ namespace HttpServer
failed(res, 200, lang_strings[STR_FAIL_INSTALL_FROM_URL_MSG]);
activity_inprogess = false;
file_transfering = false;
Windows::SetModalMode(true);
Windows::SetModalMode(false);
return;
}
}