diff --git a/modules/ripple_websocket/autosocket/ripple_AutoSocket.h b/modules/ripple_websocket/autosocket/ripple_AutoSocket.h index 5c016a543b..d8b931b16d 100644 --- a/modules/ripple_websocket/autosocket/ripple_AutoSocket.h +++ b/modules/ripple_websocket/autosocket/ripple_AutoSocket.h @@ -7,14 +7,14 @@ #ifndef __AUTOSOCKET_H_ #define __AUTOSOCKET_H_ +namespace basio = boost::asio; +namespace bassl = basio::ssl; + // Socket wrapper that supports both SSL and non-SSL connections. // Generally, handle it as you would an SSL connection. // To force a non-SSL connection, just don't call async_handshake. // To force SSL only inbound, call setSSLOnly. -namespace basio = boost::asio; -namespace bassl = basio::ssl; - class AutoSocket { public: @@ -118,7 +118,8 @@ public: } } - template void async_shutdown (ShutdownHandler handler) + template + void async_shutdown (ShutdownHandler handler) { if (isSecure ()) mSocket->async_shutdown (handler); @@ -137,7 +138,8 @@ public: } } - template void async_read_some (const Seq& buffers, Handler handler) + template + void async_read_some (const Seq& buffers, Handler handler) { if (isSecure ()) mSocket->async_read_some (buffers, handler); @@ -172,7 +174,8 @@ public: basio::async_read_until (PlainSocket (), buffers, cond, handler); } - template void async_write (const Buf& buffers, Handler handler) + template + void async_write (const Buf& buffers, Handler handler) { if (isSecure ()) boost::asio::async_write (*mSocket, buffers, handler); @@ -207,7 +210,8 @@ public: boost::asio::async_read (PlainSocket (), buffers, cond, handler); } - template void async_read (const Buf& buffers, Handler handler) + template + void async_read (const Buf& buffers, Handler handler) { if (isSecure ()) boost::asio::async_read (*mSocket, buffers, handler); @@ -215,7 +219,8 @@ public: boost::asio::async_read (PlainSocket (), buffers, handler); } - template void async_write_some (const Seq& buffers, Handler handler) + template + void async_write_some (const Seq& buffers, Handler handler) { if (isSecure ()) mSocket->async_write_some (buffers, handler); @@ -265,5 +270,3 @@ private: }; #endif - -// vim:ts=4 diff --git a/src/cpp/ripple/ripple_Peer.cpp b/src/cpp/ripple/ripple_Peer.cpp index bf8394c910..a1538a8d6f 100644 --- a/src/cpp/ripple/ripple_Peer.cpp +++ b/src/cpp/ripple/ripple_Peer.cpp @@ -30,10 +30,11 @@ public: void handleConnect (const boost::system::error_code & error, boost::asio::ip::tcp::resolver::iterator it); - std::string& getIP () + std::string const& getIP () { return mIpPort.first; } + std::string getDisplayName () { return mCluster ? mNodeName : mIpPort.first; diff --git a/src/cpp/ripple/ripple_Peer.h b/src/cpp/ripple/ripple_Peer.h index 1046e6e6bf..49f05b6b93 100644 --- a/src/cpp/ripple/ripple_Peer.h +++ b/src/cpp/ripple/ripple_Peer.h @@ -20,14 +20,6 @@ public: typedef boost::shared_ptr pointer; typedef pointer const& ref; - static int const psbGotHello = 0; - static int const psbSentHello = 1; - static int const psbInMap = 2; - static int const psbTrusted = 3; - static int const psbNoLedgers = 4; - static int const psbNoTransactions = 5; - static int const psbDownLevel = 6; - public: static pointer New (boost::asio::io_service& io_service, boost::asio::ssl::context& ctx, @@ -38,7 +30,7 @@ public: virtual void handleConnect (const boost::system::error_code& error, boost::asio::ip::tcp::resolver::iterator it) = 0; - virtual std::string& getIP () = 0; + virtual std::string const& getIP () = 0; virtual std::string getDisplayName () = 0;