Unverified Commit 7756972a authored by Igor [hyperxor]'s avatar Igor [hyperxor] Committed by GitHub

Changes in Http: make onConnection and onDisconnection methods private (#727)

parent 8b04ca8c
......@@ -26,7 +26,6 @@
#include <pistache/stream.h>
#include <pistache/tcp.h>
#include <pistache/transport.h>
#include <pistache/view.h>
namespace Pistache {
namespace Tcp {
......@@ -568,9 +567,6 @@ using ResponseParser = Private::ParserImpl<Http::Response>;
class Handler : public Tcp::Handler {
public:
void onConnection(const std::shared_ptr<Tcp::Peer> &peer) override;
void onDisconnection(const std::shared_ptr<Tcp::Peer> &peer) override;
virtual void onRequest(const Request &request, ResponseWriter response) = 0;
virtual void onTimeout(const Request &request, ResponseWriter response);
......@@ -583,6 +579,8 @@ public:
virtual ~Handler() override {}
private:
void onConnection(const std::shared_ptr<Tcp::Peer> &peer) override;
void onDisconnection(const std::shared_ptr<Tcp::Peer> &peer) override;
void onInput(const char *buffer, size_t len,
const std::shared_ptr<Tcp::Peer> &peer) override;
RequestParser &getParser(const std::shared_ptr<Tcp::Peer> &peer) const;
......@@ -603,11 +601,5 @@ std::shared_ptr<H> make_handler(Args &&... args) {
return std::make_shared<H>(std::forward<Args>(args)...);
}
namespace helpers {
inline Address httpAddr(const StringView &view) {
auto const str = view.toString();
return Address(str);
}
} // namespace helpers
} // namespace Http
} // namespace Pistache
......@@ -6,6 +6,8 @@
#pragma once
#include <pistache/view.h>
#include <cstring>
#include <limits>
#include <stdexcept>
......@@ -154,6 +156,13 @@ private:
Port port_;
};
namespace helpers {
inline Address httpAddr(const StringView &view) {
auto const str = view.toString();
return Address(str);
}
} // namespace helpers
class Error : public std::runtime_error {
public:
explicit Error(const char *message);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment