diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-03-26 17:12:52 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-03-26 17:20:27 +0900 |
| commit | d64089632e82a2548752c7a6baaa68365a795a74 (patch) | |
| tree | 57fc7b85a8c1290975d58fa4761b04a7695bf7e3 /src/RangeBtMessage.h | |
| parent | c81b1321122e8509b55c94c0cbca0d8d6d319f0c (diff) | |
| parent | a7cd943a06b1a5ff4515b57060b84037f8d01f9f (diff) | |
Merge branch 'master' into random-webseeding
Diffstat (limited to 'src/RangeBtMessage.h')
| -rw-r--r-- | src/RangeBtMessage.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/RangeBtMessage.h b/src/RangeBtMessage.h index 0da6c557..c2a0d1d0 100644 --- a/src/RangeBtMessage.h +++ b/src/RangeBtMessage.h @@ -47,10 +47,10 @@ private: int32_t length_; static const size_t MESSAGE_LENGTH = 17; + protected: - template<typename T> - static std::unique_ptr<T> create(const unsigned char* data, - size_t dataLength) + template <typename T> + static std::unique_ptr<T> create(const unsigned char* data, size_t dataLength) { bittorrent::assertPayloadLengthEqual(13, dataLength, T::NAME); bittorrent::assertID(T::ID, data, T::NAME); @@ -58,9 +58,10 @@ protected: bittorrent::getIntParam(data, 5), bittorrent::getIntParam(data, 9)); } + public: - RangeBtMessage(uint8_t id, const char* name, - size_t index, int32_t begin, int32_t length); + RangeBtMessage(uint8_t id, const char* name, size_t index, int32_t begin, + int32_t length); size_t getIndex() const { return index_; } |
