From 7333d13dd4ffdf00e4a7ce921a1c4a0a97ed0cbe Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Thu, 15 Aug 2013 23:48:05 -0700 Subject: [PATCH] Rename to max_needed for clarity --- .../protocol/beast_HandshakeDetectorType.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/modules/beast_asio/protocol/beast_HandshakeDetectorType.h b/modules/beast_asio/protocol/beast_HandshakeDetectorType.h index 5d5a3f4293..b896815cd5 100644 --- a/modules/beast_asio/protocol/beast_HandshakeDetectorType.h +++ b/modules/beast_asio/protocol/beast_HandshakeDetectorType.h @@ -29,9 +29,15 @@ public: { } - /** Returns the minimum number of bytes we need to succeed. + /** How many bytes maximum we might need. + + This is the largest number of bytes that the detector + might need in order to come to a conclusion about + whether or not the handshake is a match. Depending + on the data, it could come to that conclusion sooner + though. */ - virtual std::size_t needed () = 0; + virtual std::size_t max_needed () = 0; /** Returns true if the return value of success() is valid. */ @@ -190,7 +196,7 @@ public: bytesNeeded = 3 }; - std::size_t needed () + std::size_t max_needed () { return bytesNeeded; } @@ -262,7 +268,7 @@ public: bytesNeeded = 6 }; - std::size_t needed () + std::size_t max_needed () { return bytesNeeded; } @@ -309,9 +315,9 @@ public: { } - std::size_t needed () noexcept + std::size_t max_needed () noexcept { - return m_logic.needed (); + return m_logic.max_needed (); } bool finished () noexcept