aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/CMsgReader.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2024-10-20 11:06:13 +0200
committerPierre Ossman <ossman@cendio.se>2024-11-06 21:24:36 +0100
commit2b7857283b834391266e414adcff8c20f8fe3067 (patch)
tree146051a67b20b217593298eec695aafda89134f6 /common/rfb/CMsgReader.cxx
parented07250fef4e258d0d37d1c4e520db6d6c1e6fdb (diff)
downloadtigervnc-2b7857283b834391266e414adcff8c20f8fe3067.tar.gz
tigervnc-2b7857283b834391266e414adcff8c20f8fe3067.zip
Use standard library naming for exceptions
This makes things more consistent since we mix with the standard library exceptions so often.
Diffstat (limited to 'common/rfb/CMsgReader.cxx')
-rw-r--r--common/rfb/CMsgReader.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/common/rfb/CMsgReader.cxx b/common/rfb/CMsgReader.cxx
index 17c92227..3025959f 100644
--- a/common/rfb/CMsgReader.cxx
+++ b/common/rfb/CMsgReader.cxx
@@ -119,7 +119,7 @@ bool CMsgReader::readMsg()
ret = readEndOfContinuousUpdates();
break;
default:
- throw ProtocolException(format("Unknown message type %d", currentMsgType));
+ throw protocol_error(format("Unknown message type %d", currentMsgType));
}
if (ret)
@@ -301,7 +301,7 @@ bool CMsgReader::readExtendedClipboard(int32_t len)
return false;
if (len < 4)
- throw ProtocolException("Invalid extended clipboard message");
+ throw protocol_error("Invalid extended clipboard message");
if (len > maxCutText) {
vlog.error("Extended clipboard message too long (%d bytes) - ignoring", len);
is->skip(len);
@@ -323,7 +323,7 @@ bool CMsgReader::readExtendedClipboard(int32_t len)
}
if (len < (int32_t)(4 + 4*num))
- throw ProtocolException("Invalid extended clipboard message");
+ throw protocol_error("Invalid extended clipboard message");
num = 0;
for (i = 0;i < 16;i++) {
@@ -348,7 +348,7 @@ bool CMsgReader::readExtendedClipboard(int32_t len)
continue;
if (!zis.hasData(4))
- throw ProtocolException("Extended clipboard decode error");
+ throw protocol_error("Extended clipboard decode error");
lengths[num] = zis.readU32();
@@ -361,7 +361,7 @@ bool CMsgReader::readExtendedClipboard(int32_t len)
size_t chunk;
if (!zis.hasData(1))
- throw ProtocolException("Extended clipboard decode error");
+ throw protocol_error("Extended clipboard decode error");
chunk = zis.avail();
if (chunk > lengths[num])
@@ -377,7 +377,7 @@ bool CMsgReader::readExtendedClipboard(int32_t len)
}
if (!zis.hasData(lengths[num]))
- throw ProtocolException("Extended clipboard decode error");
+ throw protocol_error("Extended clipboard decode error");
buffers[num] = new uint8_t[lengths[num]];
zis.readBytes(buffers[num], lengths[num]);
@@ -407,7 +407,7 @@ bool CMsgReader::readExtendedClipboard(int32_t len)
handler->handleClipboardNotify(flags);
break;
default:
- throw ProtocolException("Invalid extended clipboard action");
+ throw protocol_error("Invalid extended clipboard action");
}
}
@@ -473,7 +473,7 @@ bool CMsgReader::readRect(const Rect& r, int encoding)
vlog.error("Rect too big: %dx%d at %d,%d exceeds %dx%d",
r.width(), r.height(), r.tl.x, r.tl.y,
handler->server.width(), handler->server.height());
- throw ProtocolException("Rect too big");
+ throw protocol_error("Rect too big");
}
if (r.is_empty())
@@ -485,7 +485,7 @@ bool CMsgReader::readRect(const Rect& r, int encoding)
bool CMsgReader::readSetXCursor(int width, int height, const Point& hotspot)
{
if (width > maxCursorSize || height > maxCursorSize)
- throw ProtocolException("Too big cursor");
+ throw protocol_error("Too big cursor");
std::vector<uint8_t> rgba(width*height*4);
@@ -549,7 +549,7 @@ bool CMsgReader::readSetXCursor(int width, int height, const Point& hotspot)
bool CMsgReader::readSetCursor(int width, int height, const Point& hotspot)
{
if (width > maxCursorSize || height > maxCursorSize)
- throw ProtocolException("Too big cursor");
+ throw protocol_error("Too big cursor");
int data_len = width * height * (handler->server.pf().bpp/8);
int mask_len = ((width+7)/8) * height;
@@ -595,7 +595,7 @@ bool CMsgReader::readSetCursor(int width, int height, const Point& hotspot)
bool CMsgReader::readSetCursorWithAlpha(int width, int height, const Point& hotspot)
{
if (width > maxCursorSize || height > maxCursorSize)
- throw ProtocolException("Too big cursor");
+ throw protocol_error("Too big cursor");
const PixelFormat rgbaPF(32, 32, false, true, 255, 255, 255, 16, 8, 0);
ManagedPixelBuffer pb(rgbaPF, width, height);
@@ -656,7 +656,7 @@ bool CMsgReader::readSetCursorWithAlpha(int width, int height, const Point& hots
bool CMsgReader::readSetVMwareCursor(int width, int height, const Point& hotspot)
{
if (width > maxCursorSize || height > maxCursorSize)
- throw ProtocolException("Too big cursor");
+ throw protocol_error("Too big cursor");
uint8_t type;
@@ -750,7 +750,7 @@ bool CMsgReader::readSetVMwareCursor(int width, int height, const Point& hotspot
handler->setCursor(width, height, hotspot, data.data());
} else {
- throw ProtocolException("Unknown cursor type");
+ throw protocol_error("Unknown cursor type");
}
return true;