using namespace rdr;
-Exception::Exception(const char *message)
-{
- snprintf(str_, sizeof(str_), "%s", message);
-}
-
-Exception::Exception(const std::string& message)
-{
- snprintf(str_, sizeof(str_), "%s", message.c_str());
-}
-
GAIException::GAIException(const char* s, int err_)
: Exception(rfb::format("%s: %s (%d)", s, strerror(err_).c_str(), err_)),
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
* Copyright (C) 2004 Red Hat Inc.
* Copyright (C) 2010 TigerVNC Team
+ * Copyright 2015-2024 Pierre Ossman for Cendio AB
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#ifndef __RDR_EXCEPTION_H__
#define __RDR_EXCEPTION_H__
+#include <stdexcept>
#include <string>
namespace rdr {
- struct Exception {
- Exception(const char* message);
- Exception(const std::string& message);
- virtual ~Exception() {}
- virtual const char* what() const { return str_; }
- private:
- char str_[256];
+ class Exception : public std::runtime_error {
+ public:
+ Exception(const char* what_arg) : std::runtime_error(what_arg) {}
+ Exception(const std::string& what_arg) : std::runtime_error(what_arg) {}
};
struct PosixException : public Exception {
gnutls_transport_set_errno(self->session, e.err);
self->saved_exception = new SocketException(e);
return -1;
- } catch (Exception& e) {
+ } catch (std::exception& e) {
vlog.error("Failure reading TLS data: %s", e.what());
gnutls_transport_set_errno(self->session, EINVAL);
- self->saved_exception = new Exception(e);
+ self->saved_exception = new std::exception(e);
return -1;
}
InStream* in;
bool streamEmpty;
- Exception* saved_exception;
+ std::exception* saved_exception;
};
};
gnutls_transport_set_errno(self->session, e.err);
self->saved_exception = new SocketException(e);
return -1;
- } catch (Exception& e) {
+ } catch (std::exception& e) {
vlog.error("Failure sending TLS data: %s", e.what());
gnutls_transport_set_errno(self->session, EINVAL);
- self->saved_exception = new Exception(e);
+ self->saved_exception = new std::exception(e);
return -1;
}
gnutls_session_t session;
OutStream* out;
- Exception* saved_exception;
+ std::exception* saved_exception;
};
};
{
try {
flush();
- } catch (Exception&) {
+ } catch (std::exception&) {
}
deflateEnd(zs);
delete zs;
*/
try {
decoder.flush();
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
}
try {
if (!decoder->readRect(r, conn->getInStream(), conn->server, bufferStream))
return false;
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
throw Exception(format("Error reading rect: %s", e.what()));
}
iecPrefix(bytes, "B").c_str(), ratio);
}
-void DecodeManager::setThreadException(const rdr::Exception& e)
+void DecodeManager::setThreadException(const std::exception& e)
{
os::AutoMutex a(queueMutex);
if (threadException == nullptr)
return;
- rdr::Exception e(*threadException);
+ std::exception e(*threadException);
delete threadException;
threadException = nullptr;
entry->decoder->decodeRect(entry->rect, entry->bufferStream->data(),
entry->bufferStream->length(),
*entry->server, entry->pb);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
manager->setThreadException(e);
} catch(...) {
assert(false);
}
namespace rdr {
- struct Exception;
class MemOutStream;
}
private:
void logStats();
- void setThreadException(const rdr::Exception& e);
+ void setThreadException(const std::exception& e);
void throwThreadException();
private:
};
std::list<DecodeThread*> threads;
- rdr::Exception *threadException;
+ std::exception *threadException;
};
}
try {
state_ = RFBSTATE_SECURITY;
ssecurity = security.GetSSecurity(this, secType);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
failConnection(e.what());
}
}
authFailureMsg.size());
}
os->flush();
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
close(e.what());
return;
}
if (sock->outStream().hasBufferedData())
vlog.error("Failed to flush remaining socket data on close");
}
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("Failed to flush remaining socket data on close: %s", e.what());
}
{
try {
initialiseProtocol();
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
close(e.what());
return false;
}
writeFramebufferUpdate();
} catch (rdr::EndOfStream&) {
close("Clean disconnection");
- } catch (rdr::Exception &e) {
+ } catch (std::exception& e) {
close(e.what());
}
}
// delayed because of congestion.
if (!sock->outStream().hasBufferedData())
writeFramebufferUpdate();
- } catch (rdr::Exception &e) {
+ } catch (std::exception& e) {
close(e.what());
}
}
updates.clear();
updates.add_changed(server->getPixelBuffer()->getRect());
writeFramebufferUpdate();
- } catch(rdr::Exception &e) {
+ } catch(std::exception& e) {
close(e.what());
}
}
{
try {
writeFramebufferUpdate();
- } catch(rdr::Exception &e) {
+ } catch(std::exception& e) {
close(e.what());
}
}
try {
screenLayoutChange(reason);
writeFramebufferUpdate();
- } catch(rdr::Exception &e) {
+ } catch(std::exception& e) {
close(e.what());
}
}
{
try {
if (state() == RFBSTATE_NORMAL) writer()->writeBell();
- } catch(rdr::Exception& e) {
+ } catch(std::exception& e) {
close(e.what());
}
}
try {
setDesktopName(name);
writeFramebufferUpdate();
- } catch(rdr::Exception& e) {
+ } catch(std::exception& e) {
close(e.what());
}
}
try {
setCursor();
writeFramebufferUpdate();
- } catch(rdr::Exception& e) {
+ } catch(std::exception& e) {
close(e.what());
}
}
try {
setLEDState(state);
writeFramebufferUpdate();
- } catch(rdr::Exception& e) {
+ } catch(std::exception& e) {
close(e.what());
}
}
if (!accessCheck(AccessCutText)) return;
if (!rfb::Server::acceptCutText) return;
requestClipboard();
- } catch(rdr::Exception& e) {
+ } catch(std::exception& e) {
close(e.what());
}
}
if (!accessCheck(AccessCutText)) return;
if (!rfb::Server::sendCutText) return;
announceClipboard(available);
- } catch(rdr::Exception& e) {
+ } catch(std::exception& e) {
close(e.what());
}
}
if (!accessCheck(AccessCutText)) return;
if (!rfb::Server::sendCutText) return;
sendClipboardData(data);
- } catch(rdr::Exception& e) {
+ } catch(std::exception& e) {
close(e.what());
}
}
{
try {
approveConnection(accept, reason);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
close(e.what());
}
}
if ((t == &congestionTimer) ||
(t == &losslessTimer))
writeFramebufferUpdate();
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
close(e.what());
}
os.writeU32(strlen(reason));
os.writeBytes((const uint8_t*)reason, strlen(reason));
os.flush();
- } catch (rdr::Exception&) {
+ } catch (std::exception&) {
}
sock->shutdown();
closingSockets.push_back(sock);
try {
cc = new CConn(fn);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
fprintf(stderr, "Failed to open rfb file: %s\n", e.what());
exit(1);
}
while (true)
cc->processMsg();
} catch (rdr::EndOfStream& e) {
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
fprintf(stderr, "Failed to run rfb file: %s\n", e.what());
exit(1);
}
try {
pf = new rfb::PixelFormat(b, d, e, t, rm, gm, bm, rs, gs, bs);
- } catch(rfb::Exception&) {
+ } catch(std::exception&) {
if (should_fail)
printf("OK");
else
XCloseDisplay(dpy);
- } catch (rdr::Exception &e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
}
try {
server->setCursor(cim->width, cim->height, Point(cim->xhot, cim->yhot),
cursorData);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("XserverDesktop::setCursor: %s",e.what());
}
}
}
- } catch (rdr::Exception &e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
return 1;
}
delete dummy.back();
dummy.pop_back();
}
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
return 1;
}
return 0;
#include <sys/utsname.h>
#include <network/Socket.h>
-#include <rfb/Exception.h>
#include <rfb/VNCServerST.h>
#include <rfb/LogWriter.h>
#include <rfb/Configuration.h>
{
try {
server->requestClipboard();
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("XserverDesktop::requestClipboard: %s",e.what());
}
}
{
try {
server->announceClipboard(available);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("XserverDesktop::announceClipboard: %s",e.what());
}
}
{
try {
server->sendClipboardData(data_);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("XserverDesktop::sendClipboardData: %s",e.what());
}
}
{
try {
server->setName(name);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("XserverDesktop::setDesktopName: %s",e.what());
}
}
try {
server->setCursor(width, height, Point(hotX, hotY), cursorData);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("XserverDesktop::setCursor: %s",e.what());
}
{
try {
server->setCursorPos(Point(x, y), warped);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("XserverDesktop::setCursorPos: %s",e.what());
}
}
{
try {
server->add_changed(region);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("XserverDesktop::add_changed: %s",e.what());
}
}
{
try {
server->add_copied(dest, delta);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("XserverDesktop::add_copied: %s",e.what());
}
}
return;
vlog.error("Cannot find file descriptor for socket event");
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("XserverDesktop::handleSocketEvent: %s",e.what());
}
}
int nextTimeout = Timer::checkTimeouts();
if (nextTimeout >= 0 && (*timeout == -1 || nextTimeout < *timeout))
*timeout = nextTimeout;
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("XserverDesktop::blockHandler: %s", e.what());
}
}
vncHooksInit(scr);
}
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vncFatalError("vncExtInit: %s\n",e.what());
}
delete desktop[scr];
desktop[scr] = nullptr;
}
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vncFatalError("vncExtInit: %s\n",e.what());
}
}
if (strlen(addr) == 0) {
try {
desktop[0]->disconnectClients();
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("Disconnecting all clients: %s", e.what());
return -1;
}
vlog.info("Reverse connection: %s:%d%s", host.c_str(), port,
viewOnly ? " (view only)" : "");
desktop[0]->addClient(sock, true, (bool)viewOnly);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("Reverse connection: %s", e.what());
return -1;
}
desktop[scrIdx]->setFramebuffer(width, height,
vncFbptr[scrIdx],
vncFbstride[scrIdx]);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vncFatalError("vncPostScreenResize: %s\n", e.what());
}
}
{
try {
desktop[scrIdx]->refreshScreenLayout();
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vncFatalError("vncRefreshScreenLayout: %s\n", e.what());
}
}
{
try {
return desktop[scrIdx]->getMsc();
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vncFatalError("vncGetMsc: %s\n", e.what());
}
}
{
try {
desktop[scrIdx]->queueMsc(id, msc);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vncFatalError("vncQueueMsc: %s\n", e.what());
}
}
{
try {
desktop[scrIdx]->abortMsc(id);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vncFatalError("vncAbortMsc: %s\n", e.what());
}
}
vlog.info(_("Connected to host %s port %d"),
serverHost.c_str(), serverPort);
}
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
abort_connection(_("Failed to connect to \"%s\":\n\n%s"),
vncServerName, e.what());
vlog.error(_("Authentication failed: %s"), e.what());
abort_connection(_("Failed to authenticate with the server. Reason "
"given by the server:\n\n%s"), e.what());
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
abort_connection_with_unexpected_error(e);
}
for (const string& entry : dialog.serverHistory)
fltk_menu_add(dialog.serverName->menubutton(),
entry.c_str(), 0, nullptr);
- } catch (Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
fl_alert(_("Unable to load the server history:\n\n%s"),
e.what());
try {
dialog->serverName->value(loadViewerParameters(filename));
- } catch (Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
fl_alert(_("Unable to load the specified configuration file:\n\n%s"),
e.what());
try {
saveViewerParameters(filename, servername);
- } catch (Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
fl_alert(_("Unable to save the specified configuration "
"file:\n\n%s"), e.what());
try {
saveViewerParameters(nullptr, servername);
- } catch (Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
fl_alert(_("Unable to save the default configuration:\n\n%s"),
e.what());
try {
dialog->saveServerHistory();
- } catch (Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
fl_alert(_("Unable to save the server history:\n\n%s"),
e.what());
try {
getHostAndPort(a.c_str(), &hostA, &portA);
getHostAndPort(b.c_str(), &hostB, &portB);
- } catch (Exception& e) {
+ } catch (std::exception& e) {
return false;
}
try {
cc->sendClipboardData(filtered.c_str());
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
abort_connection_with_unexpected_error(e);
}
if ((pointerEventInterval == 0) || (buttonMask != lastButtonMask)) {
try {
cc->writer()->writePointerEvent(pos, buttonMask);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
abort_connection_with_unexpected_error(e);
}
vlog.debug("Local clipboard changed, notifying server");
try {
self->cc->announceClipboard(true);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
abort_connection_with_unexpected_error(e);
}
vlog.debug("Focus regained after local clipboard change, notifying server");
try {
cc->announceClipboard(true);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
abort_connection_with_unexpected_error(e);
}
try {
self->cc->writer()->writePointerEvent(self->lastPointerPos,
self->lastButtonMask);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
abort_connection_with_unexpected_error(e);
}
cc->writer()->writeKeyEvent(keySym, 0, true);
else
cc->writer()->writeKeyEvent(keySym, keyCode, true);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
abort_connection_with_unexpected_error(e);
}
cc->writer()->writeKeyEvent(iter->second, 0, false);
else
cc->writer()->writeKeyEvent(iter->second, keyCode, false);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
abort_connection_with_unexpected_error(e);
}
setKeyString(indexString, entry.c_str(), &hKey);
index++;
}
- } catch (Exception& e) {
+ } catch (std::exception& e) {
RegCloseKey(hKey);
throw;
}
try {
setKeyString("ServerName", servername, &hKey);
- } catch (Exception& e) {
+ } catch (std::exception& e) {
RegCloseKey(hKey);
throw Exception(format(_("Failed to save \"%s\": %s"),
"ServerName", e.what()));
} else {
throw Exception(_("Unknown parameter type"));
}
- } catch (Exception& e) {
+ } catch (std::exception& e) {
RegCloseKey(hKey);
throw Exception(format(_("Failed to save \"%s\": %s"),
parameterArray[i]->getName(), e.what()));
for (size_t i = 0; i < sizeof(readOnlyParameterArray)/sizeof(VoidParameter*); i++) {
try {
removeValue(readOnlyParameterArray[i]->getName(), &hKey);
- } catch (Exception& e) {
+ } catch (std::exception& e) {
RegCloseKey(hKey);
throw Exception(format(_("Failed to remove \"%s\": %s"),
readOnlyParameterArray[i]->getName(),
if (!getKeyString(indexString, servernameBuffer,
buffersize, &hKey))
break;
- } catch (Exception& e) {
+ } catch (std::exception& e) {
// Just ignore this entry and try the next one
vlog.error(_("Failed to read server history entry %d: %s"),
(int)index, e.what());
} else {
throw Exception(_("Unknown parameter type"));
}
- } catch(Exception& e) {
+ } catch(std::exception& e) {
// Just ignore this entry and continue with the rest
vlog.error(_("Failed to read parameter \"%s\": %s"),
parameters[i]->getName(), e.what());
try {
if (getKeyString("ServerName", servernameBuffer, buffersize, &hKey))
snprintf(servername, buffersize, "%s", servernameBuffer);
- } catch(Exception& e) {
+ } catch(std::exception& e) {
vlog.error(_("Failed to read parameter \"%s\": %s"),
"ServerName", e.what());
strcpy(servername, "");
value, line);
}
}
- } catch(Exception& e) {
+ } catch(std::exception& e) {
// Just ignore this entry and continue with the rest
vlog.error(_("Failed to read line %d in file %s: %s"),
lineNr, filepath, e.what());
#include <FL/Fl.H>
#include <FL/x.H>
-#include <rfb/Exception.h>
#include <rfb/LogWriter.h>
#include "i18n.h"
if (msg->message == WM_PAINT && handlers.count(msg->hwnd) == 0) {
try {
handlers[msg->hwnd] = new Win32TouchHandler(msg->hwnd);
- } catch (rfb::Exception& e) {
+ } catch (std::exception& e) {
vlog.error(_("Failed to create touch handler: %s"), e.what());
abort_vncviewer(_("Failed to create touch handler: %s"), e.what());
}
exitMainloop = true;
}
-void abort_connection_with_unexpected_error(const rdr::Exception &e) {
+void abort_connection_with_unexpected_error(const std::exception &e) {
abort_connection(_("An unexpected error occurred when communicating "
"with the server:\n\n%s"), e.what());
}
// don't try to connect to the filename
strncpy(vncServerName, newServerName, VNCSERVERNAMELEN-1);
vncServerName[VNCSERVERNAMELEN-1] = '\0';
- } catch (rfb::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
abort_vncviewer(_("Unable to load the specified configuration "
"file:\n\n%s"), e.what());
strncpy(defaultServerName, configServerName, VNCSERVERNAMELEN-1);
defaultServerName[VNCSERVERNAMELEN-1] = '\0';
}
- } catch (rfb::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
}
break;
}
}
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
abort_vncviewer(_("Failure waiting for incoming VNC connection:\n\n%s"), e.what());
return 1; /* Not reached */
if (strlen(via) > 0) {
try {
mktunnel();
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
abort_vncviewer(_("Failure setting up encrypted tunnel:\n\n%s"), e.what());
}
#define VNCSERVERNAMELEN 256
-namespace rdr {
- struct Exception;
-};
-
void abort_vncviewer(const char *error, ...)
__attribute__((__format__ (__printf__, 1, 2)));
void abort_connection(const char *error, ...)
__attribute__((__format__ (__printf__, 1, 2)));
-void abort_connection_with_unexpected_error(const rdr::Exception &);
+void abort_connection_with_unexpected_error(const std::exception &);
void disconnect();
bool should_disconnect();
ActiveDesktop ad;
if (ad.enable(false))
restoreActiveDesktop = true;
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
}
SysParamsInfo(SPI_SETDESKWALLPAPER, 0, (PVOID) "", SPIF_SENDCHANGE);
restoreWallpaper = true;
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.info("%s", e.what());
}
}
ActiveDesktop ad;
ad.enable(true);
restoreActiveDesktop = false;
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
}
}
restoreWallpaper = false;
}
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.info("%s", e.what());
}
}
}
restoreEffects = true;
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.info("%s", e.what());
}
}
restoreEffects = false;
}
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.info("%s", e.what());
}
}
clip_handle = nullptr;
vlog.debug("set clipboard");
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.debug("%s", e.what());
}
server->setCursor(width, height, hotspot, buffer.data());
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
}
}
delete [] hpages; hpages = nullptr;
return true;
- } catch (rdr::Exception&) {
+ } catch (std::exception&) {
alreadyShowing = false;
std::list<PropSheetPage*>::iterator pspi;
try {
result = _this->processMessage(msg, wParam, lParam);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("untrapped: %s", e.what());
}
key.createKey(rootkey, keyname);
processEvent(event);
return true;
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.debug("%s", e.what());
return false;
}
std::string RegKey::getString(const char* valname, const char* def) const {
try {
return getString(valname);
- } catch(rdr::Exception&) {
+ } catch(std::exception&) {
return def;
}
}
std::vector<uint8_t> RegKey::getBinary(const char* valname, const uint8_t* def, size_t deflen) const {
try {
return getBinary(valname);
- } catch(rdr::Exception&) {
+ } catch(std::exception&) {
std::vector<uint8_t> out(deflen);
memcpy(out.data(), def, deflen);
return out;
int RegKey::getInt(const char* valname, int def) const {
try {
return getInt(valname);
- } catch(rdr::Exception&) {
+ } catch(std::exception&) {
return def;
}
}
try {
getRepresentation(valname);
return true;
- } catch(rdr::Exception&) {
+ } catch(std::exception&) {
return false;
}
}
else
core = new SDisplayCorePolling(this, &updates);
core->setScreenRect(screenRect);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
delete core; core = nullptr;
if (tryMethod == 0)
throw rdr::Exception("unable to access desktop");
// Start a new Core if possible
startCore();
vlog.info("restarted");
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
// If startCore() fails then we MUST disconnect all clients,
// to cause the server to stop() the desktop.
// Otherwise, the SDesktop is in an inconsistent state
// - Flush any updates from the core
try {
core->flushUpdates();
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
restartCore();
return;
// addEvent is the last thing we do, so that the event is NOT registered if previous steps fail
if (!event || !addEvent(event, this))
throw rdr::Exception("Unable to add listener");
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
if (event)
WSACloseEvent(event);
delete sock_;
eventMask |= FD_WRITE;
if (WSAEventSelect(ci.sock->getFd(), event, eventMask) == SOCKET_ERROR)
throw rdr::SocketException("unable to re-enable WSAEventSelect:%u", WSAGetLastError());
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
remSocket(ci.sock);
}
try {
network::TcpFilter::Pattern pat(network::TcpFilter::parsePattern(newPat.c_str()));
pattern = network::TcpFilter::patternToStr(pat);
- } catch(rdr::Exception& e) {
+ } catch(std::exception& e) {
MsgBox(nullptr, e.what(), MB_ICONEXCLAMATION | MB_OK);
return false;
}
(localHost != isItemChecked(IDC_LOCALHOST)) ||
(port_number != getItemInt(IDC_PORT)) ||
(rfb::Server::idleTimeout != getItemInt(IDC_IDLE_TIMEOUT));
- } catch (rdr::Exception&) {
+ } catch (std::exception&) {
return false;
}
}
// Finally, save the Hosts value
regKey.setString("Hosts", newHosts.c_str());
- } catch (rdr::Exception&) {
+ } catch (std::exception&) {
MsgBox(nullptr, "Unable to convert AuthHosts setting to Hosts format.",
MB_ICONWARNING | MB_OK);
}
regKey.setBool("AlwaysShared", connectPriority == 1);
regKey.setBool("NeverShared", connectPriority == 2);
- } catch(rdr::Exception&) {
+ } catch(std::exception&) {
}
// Open the local, default-user settings
userKey.openKey(winvnc3, "Default");
vlog.info("loading Default prefs");
LoadUserPrefs(userKey);
- } catch(rdr::Exception& e) {
+ } catch(std::exception& e) {
vlog.error("error reading Default settings:%s", e.what());
}
userKey.openKey(winvnc3, username.c_str());
vlog.info("loading local User prefs");
LoadUserPrefs(userKey);
- } catch(rdr::Exception& e) {
+ } catch(std::exception& e) {
vlog.error("error reading local User settings:%s", e.what());
}
userKey.openKey(HKEY_CURRENT_USER, "Software\\ORL\\WinVNC3");
vlog.info("loading global User prefs");
LoadUserPrefs(userKey);
- } catch(rdr::Exception& e) {
+ } catch(std::exception& e) {
vlog.error("error reading global User settings:%s", e.what());
}
}
throw;
}
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
MsgBox(nullptr, e.what(), MB_ICONEXCLAMATION | MB_OK);
return 1;
}
else
network::createTcpListeners(&sockets, nullptr, port);
}
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
}
if (!sockets.empty()) {
if (isServiceProcess()) {
try {
rfb::win32::stopService(VNCServerService::Name);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
MsgBox(nullptr, e.what(), MB_ICONERROR | MB_OK);
}
} else {
} catch (rdr::Win32Exception &s) {
vlog.error("%s", s.what());
result = s.err;
- } catch (rdr::Exception &e) {
+ } catch (std::exception &e) {
vlog.error("%s", e.what());
}
break;
}
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
MsgBoxOrLog(e.what(), true);
}
}
}
vlog.debug("WinVNC service destroyed");
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
MsgBoxOrLog(e.what(), true);
}