~ubuntu-branches/ubuntu/saucy/apt-cacher-ng/saucy

« back to all changes in this revision

Viewing changes to include/csmapping.h

  • Committer: Package Import Robot
  • Author(s): Eduard Bloch
  • Date: 2011-09-30 16:37:18 UTC
  • mfrom: (24.2.16 sid)
  • Revision ID: package-import@ubuntu.com-20110930163718-r0agyg6jptvobt5w
* New upstream versions
  + implements extra keeping of obsolete package versions (closes: #634145)
  + configurable outgoing connection protocol (closes: #641257)

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
                memcpy(csum, a.csum, 20);
39
39
        };
40
40
        
41
 
        bool Set(const mstring & in, CSTYPES eCstype, off_t newsize)
 
41
        bool Set(const mstring & hexString, CSTYPES eCstype, off_t newsize)
42
42
        {
43
 
                if(newsize<0 || in.empty()
 
43
                if(newsize<0 || hexString.empty()
44
44
                                || (eCstype!=CSTYPE_MD5 && eCstype!=CSTYPE_SHA1)
45
 
                                || (eCstype==CSTYPE_MD5 && 32 != in.length())
46
 
                                || (eCstype==CSTYPE_SHA1 && 40 != in.length()))
 
45
                                || (eCstype==CSTYPE_MD5 && 32 != hexString.length())
 
46
                                || (eCstype==CSTYPE_SHA1 && 40 != hexString.length()))
47
47
                        return false;
48
48
 
49
49
                size=newsize;
50
50
                csType=eCstype;
51
 
                return CsAsciiToBin(in.c_str(), csum, CSTYPE_MD5==csType?16:20);
 
51
                return CsAsciiToBin(hexString.c_str(), csum, CSTYPE_MD5==csType?16:20);
52
52
        }
53
53
        void Set(uint8_t *pData, CSTYPES eCstype, off_t newsize)
54
54
        {