~ubuntu-branches/debian/experimental/libtorrent/experimental

« back to all changes in this revision

Viewing changes to src/torrent/torrent.cc

  • Committer: Bazaar Package Importer
  • Author(s): Qingning Huo
  • Date: 2006-01-12 20:47:33 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060112204733-pblm1cm6srb4layq
Tags: 0.8.2-1
* New upstream release.
- Fixed a crash when changing file priorities (Closes: #347429)
* Build with g++-3.4, (because rtorrent crashes if built with
  g++-4.0). 

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
#include <iostream>
40
40
#include <rak/functional.h>
 
41
#include <rak/string_manip.h>
41
42
 
42
43
#include "exceptions.h"
43
44
#include "torrent.h"
46
47
#include "manager.h"
47
48
#include "resource_manager.h"
48
49
 
49
 
#include "utils/string_manip.h"
50
50
#include "net/listen.h"
51
51
#include "net/manager.h"
52
52
#include "net/throttle_list.h"
154
154
perform() {
155
155
  cachedTime = rak::timer::current();
156
156
 
157
 
//   std::list<rak::priority_item*> workQueue;
158
 
 
159
 
//   std::copy(rak::queue_popper(taskScheduler, rak::bind2nd(std::mem_fun(&rak::priority_item::compare), cachedTime)),
160
 
//          rak::queue_popper(taskScheduler, rak::bind2nd(std::mem_fun(&rak::priority_item::compare), rak::timer())),
161
 
//          std::back_inserter(workQueue));
162
 
//   std::for_each(workQueue.begin(), workQueue.end(), std::mem_fun(&rak::priority_item::clear_time));
163
 
//   std::for_each(workQueue.begin(), workQueue.end(), std::mem_fun(&rak::priority_item::call));
164
 
 
165
157
  while (!taskScheduler.empty() && taskScheduler.top()->time() <= cachedTime) {
166
158
    rak::priority_item* v = taskScheduler.top();
167
159
    taskScheduler.pop();
389
381
  ctor.initialize(d->bencode());
390
382
 
391
383
  d->initialize(d->bencode().get_key("info").compute_sha1(),
392
 
                PEER_NAME + random_string(20 - std::string(PEER_NAME).size()),
 
384
                PEER_NAME + rak::generate_random<std::string>(20 - std::string(PEER_NAME).size()),
393
385
                *manager->local_address());
394
386
 
395
387
  // Default PeerConnection factory functions.