Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Windows users have reported "access denied" errors with
%TEMP%\CdFileMgr
during repo updates, see #3963:Cause
Repo updates are downloaded to temp files with paths in that folder, which are then loaded back from disk. Some users have found that their anti-virus software was stopping CKAN from accessing these temp files.
Changes
Now repo updates are downloaded into a
MemoryStream
and processed directly (instead of being saved to disk, then immediately re-loaded and parsed). Since they are around 30 MiB for the biggest repo, this should work fine for everyone, including whomever or whatever is preventing us from reading the temp files.NetAsyncDownloader.DownloadTarget
is now an abstract base class with child classes:NetAsyncDownloader.DownloadTargetFile
- downloads to a file on disk, replaces previous usages ofDownloadTarget
, and its default temp file path is now a standard path instead of one in theCdFileMgr
folderNetAsyncDownloader.DownloadTargetStream
- downloads to aMemoryStream
, now used byRepositoryDataManager.Update
using () {}
, since this closes theMemoryStream
and makes it inaccessible for processing after downloadNetAsyncDownloader.DownloadPart.path
was redundant withNetAsyncDownloader.DownloadTarget.filename
and is now eliminated