Skip to content

CE changes for Winsparkle DLL#1

Open
jaredburkeen wants to merge 10 commits intomasterfrom
ce-winsparkle
Open

CE changes for Winsparkle DLL#1
jaredburkeen wants to merge 10 commits intomasterfrom
ce-winsparkle

Conversation

@jaredburkeen
Copy link
Copy Markdown

UX changes, don't use caching for loading release notes, check for updates in the background.

nickdademo and others added 2 commits September 15, 2016 10:41
There are cases where INTERNET_STATUS_CONNECTION_CLOSED events could
be triggered during a download transfer (due to network connectivity
issues).

Previously, WinSparkle would erroneously report the download as
successfully completed due to the fact that InternetReadFileEx would
return TRUE with 'dwBufferLength' set to zero after the connection
closed event.

This commit aims to gracefully handle these events (by throwing an
exception) via doing the following:
- When an INTERNET_STATUS_CONNECTION_CLOSED event is triggered,
immediately close the connection handle so that future API calls will
return failure (e.g. ERROR_INVALID_HANDLE).
- If the download has completed (indicated by 'dwBufferLength' being
zero), check that the connection handle is still valid. This detects
the case when the INTERNET_STATUS_CONNECTION_CLOSED event is received
and the connection handle is closed during a call to
InternetReadFileEx.
@jaredburkeen
Copy link
Copy Markdown
Author

@loberlander This is ready for review too.

Comment thread src/updatechecker.cpp Outdated
{
if (checkUpdates)
{
static const time_t ONE_DAY = 60 * 60 * 24;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not seem to be used here. Is it needed?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I'm not using it and doesn't look like it was used before in the base Winsparkle library. I'll remove it.

Comment thread src/updatechecker.cpp Outdated
}
}
// Check every 5 minutes
Sleep(300000);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the high frequency (every 5 minutes) periodic checking needed? Why can't we just sleep once for the exact time defined by the returned value of win_sparkle_get_update_check_interval()?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was set at 5 minutes for testing purposes. You're correct, I should be able to change to the update check interval. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants