Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CE changes for Winsparkle DLL #1

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

CE changes for Winsparkle DLL #1

wants to merge 10 commits into from

Conversation

jaredburkeen
Copy link

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
Author

@loberlander This is ready for review too.

{
if (checkUpdates)
{
static const time_t ONE_DAY = 60 * 60 * 24;

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
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.

}
}
// Check every 5 minutes
Sleep(300000);

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