Remove header filtering, since it's fully configurable in nginx
This commit is contained in:
@@ -9,10 +9,9 @@
|
||||
|
||||
namespace firecgi {
|
||||
|
||||
Connection::Connection(int sock, const sockaddr_in6& client_addr, const std::function<void(Request*)>& callback, const std::unordered_set<std::string_view>& headers, int max_request_len)
|
||||
Connection::Connection(int sock, const sockaddr_in6& client_addr, const std::function<void(Request*)>& callback, int max_request_len)
|
||||
: sock_(sock),
|
||||
callback_(callback),
|
||||
headers_(headers),
|
||||
buf_(sock, max_request_len),
|
||||
request_(this) {
|
||||
char client_addr_str[INET6_ADDRSTRLEN];
|
||||
@@ -104,11 +103,9 @@ int Connection::Read() {
|
||||
}
|
||||
std::string_view value(value_buf, param_header->value_length);
|
||||
|
||||
if (headers_.find(key) != headers_.end()) {
|
||||
request_.AddParam(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace firecgi {
|
||||
|
||||
class Connection {
|
||||
public:
|
||||
Connection(int sock, const sockaddr_in6& client_addr, const std::function<void(Request*)>& callback, const std::unordered_set<std::string_view>& headers, int max_request_len);
|
||||
Connection(int sock, const sockaddr_in6& client_addr, const std::function<void(Request*)>& callback, int max_request_len);
|
||||
~Connection();
|
||||
|
||||
[[nodiscard]] int Read();
|
||||
@@ -24,7 +24,6 @@ class Connection {
|
||||
private:
|
||||
const int sock_;
|
||||
const std::function<void(Request*)>& callback_;
|
||||
const std::unordered_set<std::string_view>& headers_;
|
||||
firebuf::StreamBuffer buf_;
|
||||
Request request_;
|
||||
|
||||
|
||||
Submodule fireusage updated: 5fea6af3c3...7972d253ab
@@ -16,11 +16,10 @@
|
||||
|
||||
namespace firecgi {
|
||||
|
||||
Server::Server(int port, const std::function<void(Request*)>& callback, int threads, const std::unordered_set<std::string_view>& headers, int max_request_len)
|
||||
Server::Server(int port, const std::function<void(Request*)>& callback, int threads, int max_request_len)
|
||||
: port_(port),
|
||||
callback_(callback),
|
||||
threads_(threads),
|
||||
headers_(headers),
|
||||
max_request_len_(max_request_len),
|
||||
close_fd_(eventfd(0, 0)) {
|
||||
CHECK_GE(close_fd_, 0);
|
||||
@@ -140,7 +139,7 @@ Connection* Server::NewConn(int listen_sock, int epoll_fd) {
|
||||
int flags = 1;
|
||||
PCHECK(setsockopt(client_sock, SOL_TCP, TCP_NODELAY, &flags, sizeof(flags)) == 0);
|
||||
|
||||
auto *conn = new Connection(client_sock, client_addr, callback_, headers_, max_request_len_);
|
||||
auto *conn = new Connection(client_sock, client_addr, callback_, max_request_len_);
|
||||
{
|
||||
struct epoll_event ev{
|
||||
.events = EPOLLIN,
|
||||
|
||||
3
server.h
3
server.h
@@ -10,7 +10,7 @@ namespace firecgi {
|
||||
|
||||
class Server {
|
||||
public:
|
||||
Server(int port, const std::function<void(Request*)>& callback, int threads=1, const std::unordered_set<std::string_view>& headers={}, int max_request_len=(16*1024));
|
||||
Server(int port, const std::function<void(Request*)>& callback, int threads=1, int max_request_len=(16*1024));
|
||||
void Serve();
|
||||
void Shutdown();
|
||||
void RegisterSignalHandlers();
|
||||
@@ -23,7 +23,6 @@ class Server {
|
||||
const int port_;
|
||||
const std::function<void(Request*)> callback_;
|
||||
const int threads_;
|
||||
const std::unordered_set<std::string_view> headers_;
|
||||
const int max_request_len_;
|
||||
|
||||
int close_fd_;
|
||||
|
||||
Reference in New Issue
Block a user