~mvo/apt/mvo

« back to all changes in this revision

Viewing changes to apt-pkg/acquire-worker.cc

  • Committer: Michael Vogt
  • Date: 2011-11-10 15:32:52 UTC
  • mfrom: (1561.70.60 debian-experimental2)
  • Revision ID: michael.vogt@ubuntu.com-20111110153252-1u9lc3lm2cgb6b1m
merged from http://bzr.debian.org/bzr/apt/apt/debian-experimental2

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
   ##################################################################### */
13
13
                                                                        /*}}}*/
14
14
// Include Files                                                        /*{{{*/
 
15
#include <config.h>
 
16
 
15
17
#include <apt-pkg/acquire-worker.h>
16
18
#include <apt-pkg/acquire-item.h>
17
19
#include <apt-pkg/configuration.h>
19
21
#include <apt-pkg/fileutl.h>
20
22
#include <apt-pkg/strutl.h>
21
23
 
22
 
#include <apti18n.h>
23
 
 
24
24
#include <iostream>
25
25
#include <sstream>
26
26
#include <fstream>
27
 
    
 
27
 
28
28
#include <sys/stat.h>
29
29
#include <unistd.h>
30
30
#include <fcntl.h>
31
31
#include <signal.h>
32
32
#include <stdio.h>
33
33
#include <errno.h>
 
34
 
 
35
#include <apti18n.h>
34
36
                                                                        /*}}}*/
35
37
 
36
38
using namespace std;
256
258
            
257
259
            CurrentItem = Itm;
258
260
            CurrentSize = 0;
259
 
            TotalSize = atoi(LookupTag(Message,"Size","0").c_str());
260
 
            ResumePoint = atoi(LookupTag(Message,"Resume-Point","0").c_str());
261
 
            Itm->Owner->Start(Message,atoi(LookupTag(Message,"Size","0").c_str()));
 
261
            TotalSize = strtoull(LookupTag(Message,"Size","0").c_str(), NULL, 10);
 
262
            ResumePoint = strtoull(LookupTag(Message,"Resume-Point","0").c_str(), NULL, 10);
 
263
            Itm->Owner->Start(Message,strtoull(LookupTag(Message,"Size","0").c_str(), NULL, 10));
262
264
 
263
265
            // Display update before completion
264
266
            if (Log != 0 && Log->MorePulses == true)
287
289
               Log->Pulse(Owner->GetOwner());
288
290
            
289
291
            OwnerQ->ItemDone(Itm);
290
 
            unsigned long long const ServerSize = atoll(LookupTag(Message,"Size","0").c_str());
 
292
            unsigned long long const ServerSize = strtoull(LookupTag(Message,"Size","0").c_str(), NULL, 10);
291
293
            if (TotalSize != 0 && ServerSize != TotalSize)
292
294
               _error->Warning("Size of file %s is not what the server reported %s %llu",
293
295
                               Owner->DestFile.c_str(), LookupTag(Message,"Size","0").c_str(),TotalSize);