Revision 5e646964 trunk/Pithos.Core/Agents/Downloader.cs

b/trunk/Pithos.Core/Agents/Downloader.cs
54 54
                {
55 55
                   // var cancellationToken=_cts.Token;//  .ThrowIfCancellationRequested();
56 56

  
57
                    if (await WaitOrAbort(cloudFile, cancellationToken))
57
                    if (await WaitOrAbort(accountInfo,cloudFile, cancellationToken))
58 58
                        return;
59 59

  
60 60

  
......
65 65
                    if (cloudFile.Name.EndsWith(".ignore", StringComparison.InvariantCultureIgnoreCase))
66 66
                        return;
67 67

  
68
                    if (!Selectives.IsSelected(cloudFile))
68
                    if (!Selectives.IsSelected(accountInfo,cloudFile))
69 69
                        return;
70 70

  
71 71

  
......
154 154
                throw new ArgumentException("cloudFile is a directory, not a file", "cloudFile");
155 155
            Contract.EndContractBlock();
156 156

  
157
            if (await WaitOrAbort(cloudFile, cancellationToken))
157
            if (await WaitOrAbort(accountInfo,cloudFile, cancellationToken))
158 158
                return;
159 159

  
160 160
            var fileAgent = GetFileAgent(accountInfo);
......
176 176
            ReportDownloadProgress(Path.GetFileName(localPath), 0, upHashes.Length, cloudFile.Bytes);
177 177
            for (var i = 0; i < upHashes.Length; i++)
178 178
            {
179
                if (await WaitOrAbort(cloudFile, cancellationToken))
179
                if (await WaitOrAbort(accountInfo,cloudFile, cancellationToken))
180 180
                    return;
181 181

  
182 182
                //For every non-matching hash
......
238 238
                throw new ArgumentException("cloudFile is a directory, not a file", "cloudFile");
239 239
            Contract.EndContractBlock();
240 240

  
241
            if (await WaitOrAbort(cloudFile, cancellationToken))
241
            if (await WaitOrAbort(accountInfo,cloudFile, cancellationToken))
242 242
                return;
243 243

  
244 244
            var localPath = FileInfoExtensions.GetProperFilePathCapitalization(filePath);
......
327 327
            return AgentLocator<FileAgent>.Get(accountInfo.AccountPath);
328 328
        }
329 329

  
330
        private async Task<bool> WaitOrAbort(ObjectInfo cloudFile, CancellationToken token)
330
        private async Task<bool> WaitOrAbort(AccountInfo account,ObjectInfo cloudFile, CancellationToken token)
331 331
        {
332 332
            token.ThrowIfCancellationRequested();
333 333
            await UnpauseEvent.WaitAsync();
334
            var shouldAbort = !Selectives.IsSelected(cloudFile);
334
            var shouldAbort = !Selectives.IsSelected(account,cloudFile);
335 335
            if (shouldAbort)
336 336
                Log.InfoFormat("Aborting [{0}]", cloudFile.Uri);
337 337
            return shouldAbort;

Also available in: Unified diff