~ubuntu-branches/ubuntu/precise/libtorrent/precise

« back to all changes in this revision

Viewing changes to src/data/hash_chunk.h

  • Committer: Bazaar Package Importer
  • Author(s): Rogério Brito
  • Date: 2011-10-13 13:54:16 UTC
  • mfrom: (1.1.14 upstream) (4.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20111013135416-rvqceyzqswz4r17v
Tags: 0.12.9-3
* Urgency medium due to RC bugfix. Closes: #644031.
* debian/patches: Fix compilation with IPv6. Closes: #490277.
  Thanks to Steinar H. Gunderson.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
#ifndef LIBTORRENT_HASH_CHUNK_H
38
38
#define LIBTORRENT_HASH_CHUNK_H
39
39
 
 
40
#include "torrent/exceptions.h"
40
41
#include "utils/sha1.h"
41
42
 
42
43
#include "chunk.h"
82
83
  return itr->size() - (pos - itr->position());
83
84
}
84
85
 
 
86
inline uint32_t
 
87
HashChunk::remaining() {
 
88
  if (!m_chunk.is_valid())
 
89
    throw internal_error("HashChunk::remaining(...) called on an invalid chunk");
 
90
 
 
91
  return m_chunk.chunk()->chunk_size() - m_position;
 
92
}
 
93
 
85
94
}
86
95
 
87
96
#endif