Skip to content

Commit

Permalink
Fixed bug
Browse files Browse the repository at this point in the history
Changed output-directory command-line parameter to download-directory.
Fixed prompts not displaying for redirected URLs.
  • Loading branch information
erickutcher committed Oct 4, 2024
1 parent a1dc02e commit a571af8
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 38 deletions.
8 changes: 4 additions & 4 deletions HTTP_Downloader/HTTP_Downloader.rc
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ IDI_ICON_TRAY ICON "icon_tray.ico"
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,6,4
PRODUCTVERSION 1,0,6,4
FILEVERSION 1,0,6,5
PRODUCTVERSION 1,0,6,5
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -81,12 +81,12 @@ BEGIN
BEGIN
VALUE "Comments", "HTTP Downloader is made free under the GPLv3 license."
VALUE "FileDescription", "HTTP Downloader can download files through HTTP(S), FTP(S), and SFTP connections."
VALUE "FileVersion", "1, 0, 6, 4"
VALUE "FileVersion", "1, 0, 6, 5"
VALUE "InternalName", "HTTP Downloader"
VALUE "LegalCopyright", "Copyright � 2015-2024 Eric Kutcher"
VALUE "OriginalFilename", "HTTP_Downloader.exe"
VALUE "ProductName", "HTTP Downloader"
VALUE "ProductVersion", "1, 0, 6, 4"
VALUE "ProductVersion", "1, 0, 6, 5"
END
END
BLOCK "VarFileInfo"
Expand Down
6 changes: 6 additions & 0 deletions HTTP_Downloader/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version: 1.0.6.5
Released: 2024-10-04

Changed output-directory command-line parameter to download-directory.
Fixed prompts not displaying for redirected URLs.

Version: 1.0.6.4
Released: 2024-09-09

Expand Down
4 changes: 2 additions & 2 deletions HTTP_Downloader/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5247,7 +5247,7 @@ wchar_t *ParseURLSettings( wchar_t *url_list, ADD_INFO *ai )
}
else if ( ( param_name_length == 13 && _StrCmpNIW( param_name_start, L"cookie-string", 13 ) == 0 ) ||
( param_name_length == 9 && _StrCmpNIW( param_name_start, L"post-data", 9 ) == 0 ) ||
( param_name_length == 16 && _StrCmpNIW( param_name_start, L"output-directory", 16 ) == 0 ) ||
( param_name_length == 18 && _StrCmpNIW( param_name_start, L"download-directory", 18 ) == 0 ) ||
( param_name_length == 8 && _StrCmpNIW( param_name_start, L"username", 8 ) == 0 ) ||
( param_name_length == 8 && _StrCmpNIW( param_name_start, L"password", 8 ) == 0 ) ||
( param_name_length == 14 && _StrCmpNIW( param_name_start, L"proxy-hostname", 14 ) == 0 ) ||
Expand Down Expand Up @@ -5288,7 +5288,7 @@ wchar_t *ParseURLSettings( wchar_t *url_list, ADD_INFO *ai )
param_value = &password;
}
}
else if ( *param_name_start == L'o' )
else if ( *param_name_start == L'd' )
{
// Remove any quotes.
if ( param_value_start[ 0 ] == L'\"' )
Expand Down
8 changes: 4 additions & 4 deletions HTTP_Downloader/dm_version.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
16778756
https://github.com/erickutcher/httpdownloader/releases/download/v1.0.6.4/HTTP_Downloader_DM_32.zip
16778756
https://github.com/erickutcher/httpdownloader/releases/download/v1.0.6.4/HTTP_Downloader_DM_64.zip
16778757
https://github.com/erickutcher/httpdownloader/releases/download/v1.0.6.5/HTTP_Downloader_DM_32.zip
16778757
https://github.com/erickutcher/httpdownloader/releases/download/v1.0.6.5/HTTP_Downloader_DM_64.zip
2 changes: 1 addition & 1 deletion HTTP_Downloader/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
#define CURRENT_VERSION_A 1
#define CURRENT_VERSION_B 0
#define CURRENT_VERSION_C 6
#define CURRENT_VERSION_D 4
#define CURRENT_VERSION_D 5

#define CURRENT_VERSION ( ( CURRENT_VERSION_A << 24 ) | \
( CURRENT_VERSION_B << 16 ) | \
Expand Down
15 changes: 15 additions & 0 deletions HTTP_Downloader/http_parsing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3744,6 +3744,21 @@ char HandleRedirect( SOCKET_CONTEXT *context )
redirect_context->part = context->part;
redirect_context->parts = context->parts;

if ( context->got_filename == 2 )
{
redirect_context->got_filename = context->got_filename;
}

if ( context->got_last_modified == 2 )
{
redirect_context->got_last_modified = context->got_last_modified;
}

//if ( context->show_file_size_prompt )
//{
redirect_context->show_file_size_prompt = context->show_file_size_prompt;
//}

//

bool is_absolute_uri = false;
Expand Down
49 changes: 26 additions & 23 deletions HTTP_Downloader/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdL
else if ( ( arg + 1 ) < argCount &&
( arg_name_length == 13 && _StrCmpNIW( arg_name, L"cookie-string", 13 ) == 0 ) ||
( arg_name_length == 9 && _StrCmpNIW( arg_name, L"post-data", 9 ) == 0 ) ||
( arg_name_length == 16 && _StrCmpNIW( arg_name, L"output-directory", 16 ) == 0 ) ||
( arg_name_length == 18 && _StrCmpNIW( arg_name, L"download-directory", 18 ) == 0 ) ||
( arg_name_length == 16 && _StrCmpNIW( arg_name, L"download-history", 16 ) == 0 ) ||
( arg_name_length == 8 && _StrCmpNIW( arg_name, L"url-list", 8 ) == 0 ) ||
( arg_name_length == 8 && _StrCmpNIW( arg_name, L"username", 8 ) == 0 ) ||
Expand Down Expand Up @@ -429,39 +429,42 @@ int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdL
cla->password_length = length;
}
}
else if ( *arg_name == L'o' )
else if ( *arg_name == L'd' )
{
if ( CreateDirectoriesW( szArgList[ arg + 1 ], NULL ) != FALSE )
if ( arg_name_length == 18 ) // Download Directory
{
// Remove any trailing slash.
while ( length > 0 )
if ( CreateDirectoriesW( szArgList[ arg + 1 ], NULL ) != FALSE )
{
if ( szArgList[ arg + 1 ][ length - 1 ] == L'\\' )
{
--length;
}
else
// Remove any trailing slash.
while ( length > 0 )
{
break;
if ( szArgList[ arg + 1 ][ length - 1 ] == L'\\' )
{
--length;
}
else
{
break;
}
}

cl_val = &cla->download_directory;
cla->download_directory_length = length;
cla->use_download_directory = true;
}
else
{
++arg;

cl_val = &cla->download_directory;
cla->download_directory_length = length;
cla->use_download_directory = true;
continue;
}
}
else
else// if ( arg_name_length == 16 ) // Download History
{
++arg;

continue;
cl_val = &cla->download_history_file;
cla->download_history_file_length = length;
}
}
else if ( *arg_name == L'd' )
{
cl_val = &cla->download_history_file;
cla->download_history_file_length = length;
}
else if ( arg_name[ 0 ] == L'u' )
{
if ( arg_name[ 1 ] == L'r' ) // URL
Expand Down
8 changes: 4 additions & 4 deletions HTTP_Downloader/version.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
16778756
https://github.com/erickutcher/httpdownloader/releases/download/v1.0.6.4/HTTP_Downloader_32.zip
16778756
https://github.com/erickutcher/httpdownloader/releases/download/v1.0.6.4/HTTP_Downloader_64.zip
16778757
https://github.com/erickutcher/httpdownloader/releases/download/v1.0.6.5/HTTP_Downloader_32.zip
16778757
https://github.com/erickutcher/httpdownloader/releases/download/v1.0.6.5/HTTP_Downloader_64.zip

0 comments on commit a571af8

Please sign in to comment.