diff --git a/src/BaseSocket.cpp b/src/BaseSocket.cpp index 18c8030..4992647 100644 --- a/src/BaseSocket.cpp +++ b/src/BaseSocket.cpp @@ -210,7 +210,7 @@ bool BaseSocket::checkForInput() } // blocking check for waiting data - blocks for up to given timeout, can be told to break on signal-triggered config reloads -void BaseSocket::checkForInput(int timeout, bool honour_reloadconfig) throw(std::exception) +void BaseSocket::checkForInput(int timeout, bool honour_reloadconfig) noexcept(false) { #ifdef DGDEBUG std::cout << "BaseSocket::checkForInput: starting for sck:" << sck << std::endl; @@ -249,7 +249,7 @@ bool BaseSocket::readyForOutput() } // blocking equivalent of above, can be told to break on signal-triggered reloads -void BaseSocket::readyForOutput(int timeout, bool honour_reloadconfig) throw(std::exception) +void BaseSocket::readyForOutput(int timeout, bool honour_reloadconfig) noexcept(false) { // blocks if socket blocking // until timeout @@ -266,7 +266,7 @@ void BaseSocket::readyForOutput(int timeout, bool honour_reloadconfig) throw(std } // read a line from the socket, can be told to break on config reloads -int BaseSocket::getLine(char *buff, int size, int timeout, bool honour_reloadconfig, bool *chopped, bool *truncated) throw(std::exception) +int BaseSocket::getLine(char *buff, int size, int timeout, bool honour_reloadconfig, bool *chopped, bool *truncated) noexcept(false) { // first, return what's left from the previous buffer read, if anything int i = 0; @@ -347,7 +347,7 @@ int BaseSocket::getLine(char *buff, int size, int timeout, bool honour_reloadcon } // write line to socket -void BaseSocket::writeString(const char *line) throw(std::exception) +void BaseSocket::writeString(const char *line) noexcept(false) { int l = strlen(line); if (!writeToSocket(line, l, 0, timeout)) { @@ -356,7 +356,7 @@ void BaseSocket::writeString(const char *line) throw(std::exception) } // write data to socket - throws exception on failure, can be told to break on config reloads -void BaseSocket::writeToSockete(const char *buff, int len, unsigned int flags, int timeout, bool honour_reloadconfig) throw(std::exception) +void BaseSocket::writeToSockete(const char *buff, int len, unsigned int flags, int timeout, bool honour_reloadconfig) noexcept(false) { if (!writeToSocket(buff, len, flags, timeout, honour_reloadconfig)) { throw std::runtime_error(std::string("Can't write to socket: ") + strerror(errno)); diff --git a/src/BaseSocket.hpp b/src/BaseSocket.hpp index cffcf7d..bbbeac2 100644 --- a/src/BaseSocket.hpp +++ b/src/BaseSocket.hpp @@ -48,17 +48,17 @@ public: // non-blocking check for input data bool checkForInput(); // blocking check for data, can be told to break on signal triggered config reloads (-r) - void checkForInput(int timeout, bool honour_reloadconfig = false) throw(std::exception); + void checkForInput(int timeout, bool honour_reloadconfig = false) noexcept(false); // non-blocking check for writable socket bool readyForOutput(); // blocking check, can break on config reloads - void readyForOutput(int timeout, bool honour_reloadconfig = false) throw(std::exception); + void readyForOutput(int timeout, bool honour_reloadconfig = false) noexcept(false); // get a line from the socket - can break on config reloads - int getLine(char *buff, int size, int timeout, bool honour_reloadconfig = false, bool *chopped = NULL, bool *truncated = NULL) throw(std::exception); + int getLine(char *buff, int size, int timeout, bool honour_reloadconfig = false, bool *chopped = NULL, bool *truncated = NULL) noexcept(false); // write buffer to string - throws std::exception on error - void writeString(const char *line) throw(std::exception); + void writeString(const char *line) noexcept(false); // write buffer to string - can be told not to do an initial readyForOutput, and told to break on -r bool writeToSocket(const char *buff, int len, unsigned int flags, int timeout, bool check_first = true, bool honour_reloadconfig = false); // read from socket, returning number of bytes read @@ -66,7 +66,7 @@ public: // read from socket, returning error status - can be told to skip initial checkForInput, and to break on -r int readFromSocket(char *buff, int len, unsigned int flags, int timeout, bool check_first = true, bool honour_reloadconfig = false); // write to socket, throwing std::exception on error - can be told to break on -r - void writeToSockete(const char *buff, int len, unsigned int flags, int timeout, bool honour_reloadconfig = false) throw(std::exception); + void writeToSockete(const char *buff, int len, unsigned int flags, int timeout, bool honour_reloadconfig = false) noexcept(false); protected: // socket-wide timeout (is this actually used?) diff --git a/src/DataBuffer.cpp b/src/DataBuffer.cpp index 3bb8349..0fc1da7 100644 --- a/src/DataBuffer.cpp +++ b/src/DataBuffer.cpp @@ -236,7 +236,7 @@ bool DataBuffer::in(Socket * sock, Socket * peersock, HTTPHeader * requestheader } // send the request body to the client after having been handled by a DM plugin -void DataBuffer::out(Socket * sock) throw(std::exception) +void DataBuffer::out(Socket * sock) noexcept(false) { if (dontsendbody) { #ifdef DGDEBUG diff --git a/src/DataBuffer.hpp b/src/DataBuffer.hpp index dd0b8fc..e8f16aa 100644 --- a/src/DataBuffer.hpp +++ b/src/DataBuffer.hpp @@ -40,7 +40,7 @@ public: // gives true if it pauses due to too much data bool in(Socket * sock, Socket * peersock, class HTTPHeader * requestheader, class HTTPHeader * docheader, bool runav, int *headersent); // send body to client - void out(Socket * sock) throw(std::exception); + void out(Socket * sock) noexcept(false); void setTimeout(int t) { timeout = t; }; void setDecompress(String d) { decompress = d; }; diff --git a/src/HTTPHeader.cpp b/src/HTTPHeader.cpp index 383a7e5..5ffcc45 100644 --- a/src/HTTPHeader.cpp +++ b/src/HTTPHeader.cpp @@ -1602,7 +1602,7 @@ int HTTPHeader::decode1b64(char c) // - this allows us to re-open the proxy connection on pconns if squid's end has // timed out but the client's end hasn't. not much use with NTLM, since squid // will throw a 407 and restart negotiation, but works well with basic & others. -void HTTPHeader::out(Socket * peersock, Socket * sock, int sendflag, bool reconnect) throw(std::exception) +void HTTPHeader::out(Socket * peersock, Socket * sock, int sendflag, bool reconnect) noexcept(false) { String l; // for amalgamating to avoid conflict with the Nagel algorithm diff --git a/src/HTTPHeader.hpp b/src/HTTPHeader.hpp index ce30779..c237463 100644 --- a/src/HTTPHeader.hpp +++ b/src/HTTPHeader.hpp @@ -45,7 +45,7 @@ public: // - this allows us to re-open the proxy connection on pconns if squid's end has // timed out but the client's end hasn't. not much use with NTLM, since squid // will throw a 407 and restart negotiation, but works well with basic & others. - void out(Socket *peersock, Socket *sock, int sendflag, bool reconnect = false) throw(std::exception); + void out(Socket *peersock, Socket *sock, int sendflag, bool reconnect = false) noexcept(false); // discard remainder of POST data // amount to discard can be passed in, or will default to contentLength() diff --git a/src/Socket.cpp b/src/Socket.cpp index 990f30f..8212622 100644 --- a/src/Socket.cpp +++ b/src/Socket.cpp @@ -654,7 +654,7 @@ bool Socket::checkForInput() } // blocking check for waiting data - blocks for up to given timeout, can be told to break on signal-triggered config reloads -void Socket::checkForInput(int timeout, bool honour_reloadconfig) throw(std::exception) +void Socket::checkForInput(int timeout, bool honour_reloadconfig) noexcept(false) { if (!isssl){ BaseSocket::checkForInput(timeout, honour_reloadconfig); @@ -676,7 +676,7 @@ bool Socket::readyForOutput() return true; } -void Socket::readyForOutput(int timeout, bool honour_reloadconfig) throw(std::exception) +void Socket::readyForOutput(int timeout, bool honour_reloadconfig) noexcept(false) { if (!isssl){ BaseSocket::readyForOutput(timeout,honour_reloadconfig); @@ -689,7 +689,7 @@ void Socket::readyForOutput(int timeout, bool honour_reloadconfig) throw(std::ex } // read a line from the socket, can be told to break on config reloads -int Socket::getLine(char *buff, int size, int timeout, bool honour_reloadconfig, bool *chopped, bool *truncated) throw(std::exception) +int Socket::getLine(char *buff, int size, int timeout, bool honour_reloadconfig, bool *chopped, bool *truncated) noexcept(false) { if (!isssl){ return BaseSocket::getLine(buff, size,timeout, honour_reloadconfig, chopped, truncated); @@ -765,7 +765,7 @@ int Socket::getLine(char *buff, int size, int timeout, bool honour_reloadconfig, } // write line to socket -void Socket::writeString(const char *line) throw(std::exception) +void Socket::writeString(const char *line) noexcept(false) { int l = strlen(line); if (!writeToSocket(line, l, 0, timeout)) { @@ -774,7 +774,7 @@ void Socket::writeString(const char *line) throw(std::exception) } // write data to socket - throws exception on failure, can be told to break on config reloads -void Socket::writeToSockete(const char *buff, int len, unsigned int flags, int timeout, bool honour_reloadconfig) throw(std::exception) +void Socket::writeToSockete(const char *buff, int len, unsigned int flags, int timeout, bool honour_reloadconfig) noexcept(false) { if (!writeToSocket(buff, len, flags, timeout, honour_reloadconfig)) { throw std::runtime_error(std::string("Can't write to socket: ") + strerror(errno)); diff --git a/src/Socket.hpp b/src/Socket.hpp index 0917cbf..e78ae9b 100644 --- a/src/Socket.hpp +++ b/src/Socket.hpp @@ -82,19 +82,19 @@ public: // non-blocking check for writable socket bool readyForOutput(); // blocking check, can break on config reloads - void readyForOutput(int timeout, bool honour_reloadconfig = false) throw(std::exception); + void readyForOutput(int timeout, bool honour_reloadconfig = false) noexcept(false); // non-blocking check for input data bool checkForInput(); // blocking check for data, can be told to break on signal triggered config reloads (-r) - void checkForInput(int timeout, bool honour_reloadconfig = false) throw(std::exception); + void checkForInput(int timeout, bool honour_reloadconfig = false) noexcept(false); // get a line from the socket - can break on config reloads - int getLine(char *buff, int size, int timeout, bool honour_reloadconfig = false, bool *chopped = NULL, bool *truncated = NULL) throw(std::exception); + int getLine(char *buff, int size, int timeout, bool honour_reloadconfig = false, bool *chopped = NULL, bool *truncated = NULL) noexcept(false); // write buffer to string - throws std::exception on error - void writeString(const char *line) throw(std::exception); + void writeString(const char *line) noexcept(false); // write buffer to string - can be told not to do an initial readyForOutput, and told to break on -r bool writeToSocket(const char *buff, int len, unsigned int flags, int timeout, bool check_first = true, bool honour_reloadconfig = false); // read from socket, returning number of bytes read @@ -102,7 +102,7 @@ public: // read from socket, returning error status - can be told to skip initial checkForInput, and to break on -r int readFromSocket(char *buff, int len, unsigned int flags, int timeout, bool check_first = true, bool honour_reloadconfig = false); // write to socket, throwing std::exception on error - can be told to break on -r - void writeToSockete(const char *buff, int len, unsigned int flags, int timeout, bool honour_reloadconfig = false) throw(std::exception); + void writeToSockete(const char *buff, int len, unsigned int flags, int timeout, bool honour_reloadconfig = false) noexcept(false); #endif //__SSLMITM