diff options
Diffstat (limited to 'common/rfb')
-rw-r--r-- | common/rfb/CConnection.cxx | 2 | ||||
-rw-r--r-- | common/rfb/DecodeManager.cxx | 8 | ||||
-rw-r--r-- | common/rfb/DecodeManager.h | 5 | ||||
-rw-r--r-- | common/rfb/SConnection.cxx | 4 | ||||
-rw-r--r-- | common/rfb/VNCSConnectionST.cxx | 32 | ||||
-rw-r--r-- | common/rfb/VNCServerST.cxx | 2 |
6 files changed, 26 insertions, 27 deletions
diff --git a/common/rfb/CConnection.cxx b/common/rfb/CConnection.cxx index 7a9570ad..3a34740f 100644 --- a/common/rfb/CConnection.cxx +++ b/common/rfb/CConnection.cxx @@ -387,7 +387,7 @@ void CConnection::close() */ try { decoder.flush(); - } catch (rdr::Exception& e) { + } catch (std::exception& e) { vlog.error("%s", e.what()); } diff --git a/common/rfb/DecodeManager.cxx b/common/rfb/DecodeManager.cxx index 77beb620..6000063f 100644 --- a/common/rfb/DecodeManager.cxx +++ b/common/rfb/DecodeManager.cxx @@ -148,7 +148,7 @@ bool DecodeManager::decodeRect(const Rect& r, int encoding, 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())); } @@ -243,7 +243,7 @@ void DecodeManager::logStats() iecPrefix(bytes, "B").c_str(), ratio); } -void DecodeManager::setThreadException(const rdr::Exception& e) +void DecodeManager::setThreadException(const std::exception& e) { os::AutoMutex a(queueMutex); @@ -260,7 +260,7 @@ void DecodeManager::throwThreadException() if (threadException == nullptr) return; - rdr::Exception e(*threadException); + std::exception e(*threadException); delete threadException; threadException = nullptr; @@ -318,7 +318,7 @@ void DecodeManager::DecodeThread::worker() 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); diff --git a/common/rfb/DecodeManager.h b/common/rfb/DecodeManager.h index 5435bfc1..b11b7044 100644 --- a/common/rfb/DecodeManager.h +++ b/common/rfb/DecodeManager.h @@ -32,7 +32,6 @@ namespace os { } namespace rdr { - struct Exception; class MemOutStream; } @@ -55,7 +54,7 @@ namespace rfb { private: void logStats(); - void setThreadException(const rdr::Exception& e); + void setThreadException(const std::exception& e); void throwThreadException(); private: @@ -108,7 +107,7 @@ namespace rfb { }; std::list<DecodeThread*> threads; - rdr::Exception *threadException; + std::exception *threadException; }; } diff --git a/common/rfb/SConnection.cxx b/common/rfb/SConnection.cxx index d96ad178..c43ed493 100644 --- a/common/rfb/SConnection.cxx +++ b/common/rfb/SConnection.cxx @@ -223,7 +223,7 @@ void SConnection::processSecurityType(int secType) try { state_ = RFBSTATE_SECURITY; ssecurity = security.GetSSecurity(this, secType); - } catch (rdr::Exception& e) { + } catch (std::exception& e) { failConnection(e.what()); } } @@ -293,7 +293,7 @@ void SConnection::handleAuthFailureTimeout(Timer* /*t*/) authFailureMsg.size()); } os->flush(); - } catch (rdr::Exception& e) { + } catch (std::exception& e) { close(e.what()); return; } diff --git a/common/rfb/VNCSConnectionST.cxx b/common/rfb/VNCSConnectionST.cxx index e0fb69dc..9cdf289d 100644 --- a/common/rfb/VNCSConnectionST.cxx +++ b/common/rfb/VNCSConnectionST.cxx @@ -129,7 +129,7 @@ void VNCSConnectionST::close(const char* reason) 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()); } @@ -146,7 +146,7 @@ bool VNCSConnectionST::init() { try { initialiseProtocol(); - } catch (rdr::Exception& e) { + } catch (std::exception& e) { close(e.what()); return false; } @@ -189,7 +189,7 @@ void VNCSConnectionST::processMessages() writeFramebufferUpdate(); } catch (rdr::EndOfStream&) { close("Clean disconnection"); - } catch (rdr::Exception &e) { + } catch (std::exception& e) { close(e.what()); } } @@ -203,7 +203,7 @@ void VNCSConnectionST::flushSocket() // delayed because of congestion. if (!sock->outStream().hasBufferedData()) writeFramebufferUpdate(); - } catch (rdr::Exception &e) { + } catch (std::exception& e) { close(e.what()); } } @@ -252,7 +252,7 @@ void VNCSConnectionST::pixelBufferChange() updates.clear(); updates.add_changed(server->getPixelBuffer()->getRect()); writeFramebufferUpdate(); - } catch(rdr::Exception &e) { + } catch(std::exception& e) { close(e.what()); } } @@ -261,7 +261,7 @@ void VNCSConnectionST::writeFramebufferUpdateOrClose() { try { writeFramebufferUpdate(); - } catch(rdr::Exception &e) { + } catch(std::exception& e) { close(e.what()); } } @@ -271,7 +271,7 @@ void VNCSConnectionST::screenLayoutChangeOrClose(uint16_t reason) try { screenLayoutChange(reason); writeFramebufferUpdate(); - } catch(rdr::Exception &e) { + } catch(std::exception& e) { close(e.what()); } } @@ -280,7 +280,7 @@ void VNCSConnectionST::bellOrClose() { try { if (state() == RFBSTATE_NORMAL) writer()->writeBell(); - } catch(rdr::Exception& e) { + } catch(std::exception& e) { close(e.what()); } } @@ -290,7 +290,7 @@ void VNCSConnectionST::setDesktopNameOrClose(const char *name) try { setDesktopName(name); writeFramebufferUpdate(); - } catch(rdr::Exception& e) { + } catch(std::exception& e) { close(e.what()); } } @@ -300,7 +300,7 @@ void VNCSConnectionST::setCursorOrClose() try { setCursor(); writeFramebufferUpdate(); - } catch(rdr::Exception& e) { + } catch(std::exception& e) { close(e.what()); } } @@ -310,7 +310,7 @@ void VNCSConnectionST::setLEDStateOrClose(unsigned int state) try { setLEDState(state); writeFramebufferUpdate(); - } catch(rdr::Exception& e) { + } catch(std::exception& e) { close(e.what()); } } @@ -322,7 +322,7 @@ void VNCSConnectionST::requestClipboardOrClose() if (!accessCheck(AccessCutText)) return; if (!rfb::Server::acceptCutText) return; requestClipboard(); - } catch(rdr::Exception& e) { + } catch(std::exception& e) { close(e.what()); } } @@ -334,7 +334,7 @@ void VNCSConnectionST::announceClipboardOrClose(bool available) if (!accessCheck(AccessCutText)) return; if (!rfb::Server::sendCutText) return; announceClipboard(available); - } catch(rdr::Exception& e) { + } catch(std::exception& e) { close(e.what()); } } @@ -346,7 +346,7 @@ void VNCSConnectionST::sendClipboardDataOrClose(const char* data) if (!accessCheck(AccessCutText)) return; if (!rfb::Server::sendCutText) return; sendClipboardData(data); - } catch(rdr::Exception& e) { + } catch(std::exception& e) { close(e.what()); } } @@ -418,7 +418,7 @@ void VNCSConnectionST::approveConnectionOrClose(bool accept, { try { approveConnection(accept, reason); - } catch (rdr::Exception& e) { + } catch (std::exception& e) { close(e.what()); } } @@ -805,7 +805,7 @@ void VNCSConnectionST::handleTimeout(Timer* t) if ((t == &congestionTimer) || (t == &losslessTimer)) writeFramebufferUpdate(); - } catch (rdr::Exception& e) { + } catch (std::exception& e) { close(e.what()); } diff --git a/common/rfb/VNCServerST.cxx b/common/rfb/VNCServerST.cxx index 66b05fae..f1ea2958 100644 --- a/common/rfb/VNCServerST.cxx +++ b/common/rfb/VNCServerST.cxx @@ -151,7 +151,7 @@ void VNCServerST::addSocket(network::Socket* sock, bool outgoing, AccessRights a 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); |