aboutsummaryrefslogtreecommitdiffstats
path: root/common/rdr/InStream.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/rdr/InStream.h')
-rw-r--r--common/rdr/InStream.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/common/rdr/InStream.h b/common/rdr/InStream.h
index 5623142c..7ad4996f 100644
--- a/common/rdr/InStream.h
+++ b/common/rdr/InStream.h
@@ -38,6 +38,11 @@
namespace rdr {
+ class end_of_stream : public std::runtime_error {
+ public:
+ end_of_stream() noexcept : std::runtime_error("End of stream") {}
+ };
+
class InStream {
public:
@@ -182,9 +187,7 @@ namespace rdr {
private:
const uint8_t* restorePoint;
-#ifdef RFB_INSTREAM_CHECK
size_t checkedBytes;
-#endif
inline void check(size_t bytes) {
#ifdef RFB_INSTREAM_CHECK
@@ -204,11 +207,7 @@ namespace rdr {
protected:
- InStream() : restorePoint(nullptr)
-#ifdef RFB_INSTREAM_CHECK
- ,checkedBytes(0)
-#endif
- {}
+ InStream() : restorePoint(nullptr), checkedBytes(0) {}
const uint8_t* ptr;
const uint8_t* end;
};