Browse Source

Move AcceptedConnection class to rpcserver.h.

Also, add parens to HTTPReply() to assist readability.
pull/145/head
Jeff Garzik 10 years ago
parent
commit
ed5769f536
  1. 4
      src/rpcprotocol.cpp
  2. 10
      src/rpcprotocol.h
  3. 10
      src/rpcserver.h

4
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<char>& stream, int &proto,

10
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
//

10
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

Loading…
Cancel
Save