mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
RPC cleanup: Improve HTTP server replies
1) support varying content types 2) support only sending the header 3) properly deliver error message as content, if HTTP error 4) move AcceptedConnection class to header, for wider use
This commit is contained in:
parent
236ae8665e
commit
c912e22db0
3 changed files with 27 additions and 14 deletions
|
|
@ -393,16 +393,6 @@ bool ClientAllowed(const boost::asio::ip::address& address)
|
|||
return false;
|
||||
}
|
||||
|
||||
class AcceptedConnection
|
||||
{
|
||||
public:
|
||||
virtual ~AcceptedConnection() {}
|
||||
|
||||
virtual std::iostream& stream() = 0;
|
||||
virtual std::string peer_address_to_string() const = 0;
|
||||
virtual void close() = 0;
|
||||
};
|
||||
|
||||
template <typename Protocol>
|
||||
class AcceptedConnectionImpl : public AcceptedConnection
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue