-
Notifications
You must be signed in to change notification settings - Fork 1
/
LoggingFilter.h
49 lines (42 loc) · 1.88 KB
/
LoggingFilter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//
// Created by victor on 17/10/17.
//
#ifndef CXXDOOR_LOGGINGFILTER_H
#define CXXDOOR_LOGGINGFILTER_H
#include <proxygen/httpserver/Filters.h>
#include <proxygen/httpserver/RequestHandlerFactory.h>
using proxygen::Filter;
namespace cxxdoor {
class LoggingFilter : public Filter {
public:
LoggingFilter(proxygen::RequestHandler *upstream);
void setResponseHandler(proxygen::ResponseHandler *handler) noexcept override;
void onRequest(std::unique_ptr<proxygen::HTTPMessage> headers)noexcept override;
void onBody(std::unique_ptr<folly::IOBuf> body)noexcept override;
void onUpgrade(proxygen::UpgradeProtocol protocol) noexcept override;
void onEOM()noexcept override;
void requestComplete()noexcept override;
void onError(proxygen::ProxygenError err)noexcept override;
void onEgressPaused()noexcept override;
void onEgressResumed()noexcept override;
void sendHeaders(proxygen::HTTPMessage &msg)noexcept override;
void sendChunkHeader(size_t len)noexcept override;
void sendBody(std::unique_ptr<folly::IOBuf> body)noexcept override;
void sendChunkTerminator() noexcept override;
void sendEOM() noexcept override;
void sendAbort() noexcept override;
void refreshTimeout()noexcept override;
void pauseIngress()noexcept override;
void resumeIngress()noexcept override;
proxygen::ResponseHandler *newPushedResponse(proxygen::PushHandler *handler)noexcept override;
const wangle::TransportInfo &getSetupTransportInfo() const noexcept override;
void getCurrentTransportInfo(wangle::TransportInfo *tinfo) const noexcept override;
};
class LoggingFilterFactory: public proxygen::RequestHandlerFactory {
public:
void onServerStart(folly::EventBase *evb) noexcept override;
void onServerStop() noexcept override;
proxygen::RequestHandler *onRequest(proxygen::RequestHandler *handler, proxygen::HTTPMessage *message) noexcept override;
};
}
#endif //CXXDOOR_LOGGINGFILTER_H