Browse Source

Move AcceptedConnection class to rpcserver.h.

Also, add parens to HTTPReply() to assist readability.
0.10
Jeff Garzik 11 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(), strMsg.size(),
contentType, contentType,
FormatFullVersion(), FormatFullVersion(),
headersOnly ? "" : (headersOnly ? "" :
useInternalContent ? cStatus : strMsg.c_str()); (useInternalContent ? cStatus : strMsg.c_str())));
} }
bool ReadHTTPRequestLine(std::basic_istream<char>& stream, int &proto, 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 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 // IOStream device that speaks SSL but can also speak non-SSL
// //

10
src/rpcserver.h

@ -21,6 +21,16 @@
class CBlockIndex; class CBlockIndex;
class CNetAddr; 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 */ /* Start RPC threads */
void StartRPCThreads(); void StartRPCThreads();
/* Alternative to StartRPCThreads for the GUI, when no server is /* Alternative to StartRPCThreads for the GUI, when no server is

Loading…
Cancel
Save