~ubuntu-branches/ubuntu/precise/amule-adunanza/precise

« back to all changes in this revision

Viewing changes to src/KnownFile.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-02-18 21:16:23 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100218211623-gptwe60zx1knfkmu
Tags: 2010.1+2.2.6-0ubuntu1
* New upstream release (LP: #524697)
  - Drop manpages_spelling_fixes.diff fixed by upstream
  - Drop cryptopp-reference.diff fixed by upstream
  - Bump Standards-Version no changes required
  - Update install files (amule -> amuleadunanza)
  - debian/rules: amule.xpm -> amuleadunanza.xpm
  - Add README.Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
//
4
4
// Parts of this file are based on work from pan One (http://home-3.tiscali.nl/~meost/pms/)
5
5
//
6
 
// Copyright (c) 2003-2008 aMule Team ( admin@amule.org / http://www.amule.org )
 
6
// Copyright (c) 2003-2009 aMule Team ( admin@amule.org / http://www.amule.org )
7
7
// Copyright (c) 2002 Merkur ( devs@emule-project.net / http://www.emule-project.net )
8
8
//
9
9
// Any parts of this program derived from the xMule, lMule or eMule project,
603
603
// ADUNANZA BEGIN
604
604
#if 0
605
605
                                if(GetLastPublishTimeKadSrc() > (uint32)time(NULL)+KADEMLIAREPUBLISHTIMES) {
 
606
#else
 
607
                                // if(GetLastPublishTimeKadSrc() > ((uint32)time(NULL) + theApp->rm->kadRepublishTimeS)) {
 
608
                                if (GetLastPublishTimeKadSrc() > ((uint32)time(NULL) + theApp->get_kadRepublishTimeS())) {
606
609
#endif
607
 
                                if(GetLastPublishTimeKadSrc() > ((uint32)time(NULL) + theApp->rm->kadRepublishTimeS)) {
608
610
// ADUNANZA END
609
611
                                        //There may be a posibility of an older client that saved a random number here.. This will check for that..
610
612
                                        SetLastPublishTimeKadSrc(0, 0);
945
947
        SourceSet::iterator it = m_ClientUploadList.begin();
946
948
        for ( ; it != m_ClientUploadList.end(); it++ ) {
947
949
                const CUpDownClient *cur_src = *it;
948
 
                
 
950
// ADUNANZA BEGIN
 
951
                if (!cur_src) continue;
 
952
// ADUNANZA END         
949
953
                if (    cur_src->HasLowID() ||
950
954
                        cur_src == forClient ||
951
955
                        !(      cur_src->GetUploadState() == US_UPLOADING ||
1163
1167
// ADUNANZA BEGIN
1164
1168
#if 0           
1165
1169
                m_lastPublishTimeKadNotes = (uint32)time(NULL)+KADEMLIAREPUBLISHTIMEN;
 
1170
#else
 
1171
                // m_lastPublishTimeKadNotes = (uint32)time(NULL)+theApp->rm->kadRepublishTimeN;
 
1172
                m_lastPublishTimeKadNotes = (uint32)time(NULL)+theApp->get_kadRepublishTimeN();
1166
1173
#endif
1167
 
                m_lastPublishTimeKadNotes = (uint32)time(NULL)+theApp->rm->kadRepublishTimeN;
1168
1174
// ADUNANZA END
1169
1175
                return true;
1170
1176
        }
1173
1179
// ADUNANZA BEGIN
1174
1180
#if 0
1175
1181
                m_lastPublishTimeKadNotes = (uint32)time(NULL)+KADEMLIAREPUBLISHTIMEN;
 
1182
#else
 
1183
                // m_lastPublishTimeKadNotes = (uint32)time(NULL)+theApp->rm->kadRepublishTimeN;
 
1184
                m_lastPublishTimeKadNotes = (uint32)time(NULL)+theApp->get_kadRepublishTimeN();
1176
1185
#endif
1177
 
                m_lastPublishTimeKadNotes = (uint32)time(NULL)+theApp->rm->kadRepublishTimeN;
1178
1186
// ADUNANZA END
1179
1187
                return true;
1180
1188
        }
1194
1202
// ADUNANZA BEGIN
1195
1203
#if 0
1196
1204
                                SetLastPublishTimeKadSrc( (uint32)time(NULL)+KADEMLIAREPUBLISHTIMES, lastBuddyIP );
 
1205
#else
 
1206
                                // SetLastPublishTimeKadSrc( (uint32)time(NULL)+theApp->rm->kadRepublishTimeS, lastBuddyIP );
 
1207
                                SetLastPublishTimeKadSrc( (uint32)time(NULL)+theApp->get_kadRepublishTimeS(), lastBuddyIP );
1197
1208
#endif
1198
 
                                SetLastPublishTimeKadSrc( (uint32)time(NULL)+theApp->rm->kadRepublishTimeS, lastBuddyIP );
1199
1209
// ADUNANZA END
1200
1210
                                return true;
1201
1211
                        }
1211
1221
// ADUNANZA BEGIN
1212
1222
#if 0
1213
1223
        SetLastPublishTimeKadSrc((uint32)time(NULL)+KADEMLIAREPUBLISHTIMES,lastBuddyIP);
 
1224
#else
 
1225
        // SetLastPublishTimeKadSrc((uint32)time(NULL)+theApp->rm->kadRepublishTimeS,lastBuddyIP);
 
1226
        SetLastPublishTimeKadSrc((uint32)time(NULL)+theApp->get_kadRepublishTimeS(), lastBuddyIP);
1214
1227
#endif
1215
 
        SetLastPublishTimeKadSrc((uint32)time(NULL)+theApp->rm->kadRepublishTimeS,lastBuddyIP);
1216
1228
// ADUNANZA END
1217
1229
        return true;
1218
1230
        
1233
1245
        if (flag) {
1234
1246
                ArrayOfUInts16 count;   
1235
1247
// ADUNANZA BEGIN
1236
 
#if 0
 
1248
// TEST_20090908_BEGIN
 
1249
// Rimetto il count.reserve sempre rimosso dalle patch AdunanzA
 
1250
// In realtà probabilmente lo si deve fare solo per il numero
 
1251
// dei client AdunanzA e non per tutta la uploadList
 
1252
// #if 0
1237
1253
                count.reserve(m_ClientUploadList.size());       
1238
 
#endif
 
1254
// #endif
 
1255
// TEST_20090908_END
1239
1256
// ADUNANZA END
1240
1257
                
1241
1258
                SourceSet::iterator it = m_ClientUploadList.begin();
1242
1259
                for ( ; it != m_ClientUploadList.end(); it++ ) {
1243
1260
// ADUNANZA BEGIN
 
1261
// Mod Adu
 
1262
// lupz
 
1263
// SECONDO STIMATORE
 
1264
// consideriamo solo le fonti adunanza per effettuare la stima
1244
1265
#if 0
1245
1266
                        if ( !(*it)->GetUpPartStatus().empty() && (*it)->GetUpPartCount() == partcount ) {
1246
 
#endif
 
1267
#else
1247
1268
                        if ( (*it) && 
1248
1269
                             (*it)->IsAdunanzA() && // ADUFLAGS
1249
1270
                             !(*it)->GetUpPartStatus().empty() &&
1250
1271
                             ((*it)->GetUpPartCount() == partcount) ) {
 
1272
#endif
1251
1273
// ADUNANZA END
1252
1274
                                count.push_back((*it)->GetUpCompleteSourcesCount());
1253
1275
                        }
1415
1437
bool CKnownFile::HasProperAICHHashSet() const
1416
1438
{
1417
1439
#ifdef CLIENT_GUI
 
1440
// ADUNANZA BEGIN
 
1441
#if 0
1418
1442
        return m_AICHMasterHash.Length();
1419
1443
#else
 
1444
        return (m_AICHMasterHash.Length() != 0);
 
1445
#endif
 
1446
// ADUNANZA END
 
1447
#else
1420
1448
        return m_pAICHHashSet->HasValidMasterHash() &&
1421
1449
                (m_pAICHHashSet->GetStatus() == AICH_HASHSETCOMPLETE ||
1422
1450
                 m_pAICHHashSet->GetStatus() == AICH_VERIFIED);