From ed5769f536f663a8deb8e8b7a68681cebaa52bdd Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Fri, 27 Jun 2014 00:10:53 -0400 Subject: [PATCH] Move AcceptedConnection class to rpcserver.h. Also, add parens to HTTPReply() to assist readability. --- src/rpcprotocol.cpp | 4 ++-- src/rpcprotocol.h | 10 ---------- src/rpcserver.h | 10 ++++++++++ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/rpcprotocol.cpp b/src/rpcprotocol.cpp index bfa799f84..2cb4a35c4 100644 --- a/src/rpcprotocol.cpp +++ b/src/rpcprotocol.cpp @@ -105,8 +105,8 @@ string HTTPReply(int nStatus, const string& strMsg, bool keepalive, strMsg.size(), contentType, FormatFullVersion(), - headersOnly ? "" : - useInternalContent ? cStatus : strMsg.c_str()); + (headersOnly ? "" : + (useInternalContent ? cStatus : strMsg.c_str()))); } bool ReadHTTPRequestLine(std::basic_istream& stream, int &proto, diff --git a/src/rpcprotocol.h b/src/rpcprotocol.h index 8d415efb1..f1317e9c2 100644 --- a/src/rpcprotocol.h +++ b/src/rpcprotocol.h @@ -71,16 +71,6 @@ enum RPCErrorCode RPC_WALLET_ALREADY_UNLOCKED = -17, // Wallet is already unlocked }; -class AcceptedConnection -{ -public: - virtual ~AcceptedConnection() {} - - virtual std::iostream& stream() = 0; - virtual std::string peer_address_to_string() const = 0; - virtual void close() = 0; -}; - // // IOStream device that speaks SSL but can also speak non-SSL // diff --git a/src/rpcserver.h b/src/rpcserver.h index 1966a65b5..fcd293663 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -21,6 +21,16 @@ class CBlockIndex; class CNetAddr; +class AcceptedConnection +{ +public: + virtual ~AcceptedConnection() {} + + virtual std::iostream& stream() = 0; + virtual std::string peer_address_to_string() const = 0; + virtual void close() = 0; +}; + /* Start RPC threads */ void StartRPCThreads(); /* Alternative to StartRPCThreads for the GUI, when no server is