forked from crnt/Fastcgi-Daemon
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ilya Golubtsov
committed
Apr 29, 2011
1 parent
ce762a6
commit ad134ad
Showing
9 changed files
with
313 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
noinst_HEADERS = component_context.h componentset.h config.h functors.h \ | ||
handler_context.h handlerset.h loader.h parser.h range.h requestimpl.h \ | ||
xml.h data_buffer_impl.h string_buffer.h server.h request_cache.h \ | ||
thread_pool.h request_thread_pool.h globals.h | ||
thread_pool.h request_thread_pool.h globals.h request_filter.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
// Fastcgi Daemon - framework for design highload FastCGI applications on C++ | ||
// Copyright (C) 2011 Ilya Golubtsov <golubtsov@yandex-team.ru> | ||
|
||
// This program is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU General Public License | ||
// as published by the Free Software Foundation; either version 2 | ||
// of the License, or (at your option) any later version. | ||
|
||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with this program; if not, write to the Free Software | ||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
|
||
#ifndef _FASTCGI_DETAILS_REQUEST_FILTER_H_ | ||
#define _FASTCGI_DETAILS_REQUEST_FILTER_H_ | ||
|
||
#include <string> | ||
|
||
#include <boost/regex.hpp> | ||
|
||
|
||
namespace fastcgi | ||
{ | ||
|
||
class Request; | ||
|
||
class RequestFilter { | ||
public: | ||
virtual bool check(const Request *request) const = 0; | ||
}; | ||
|
||
class RegexFilter { | ||
public: | ||
RegexFilter(const std::string ®ex); | ||
~RegexFilter(); | ||
|
||
bool check(const std::string &value) const; | ||
private: | ||
boost::regex regex_; | ||
}; | ||
|
||
class UrlFilter : public RequestFilter { | ||
public: | ||
UrlFilter(const std::string ®ex); | ||
~UrlFilter(); | ||
|
||
virtual bool check(const Request *request) const; | ||
private: | ||
RegexFilter regex_; | ||
}; | ||
|
||
class HostFilter : public RequestFilter { | ||
public: | ||
HostFilter(const std::string ®ex); | ||
~HostFilter(); | ||
|
||
virtual bool check(const Request *request) const; | ||
private: | ||
RegexFilter regex_; | ||
}; | ||
|
||
class PortFilter : public RequestFilter { | ||
public: | ||
PortFilter(const std::string ®ex); | ||
~PortFilter(); | ||
|
||
virtual bool check(const Request *request) const; | ||
private: | ||
RegexFilter regex_; | ||
}; | ||
|
||
class AddressFilter : public RequestFilter { | ||
public: | ||
AddressFilter(const std::string ®ex); | ||
~AddressFilter(); | ||
|
||
virtual bool check(const Request *request) const; | ||
private: | ||
RegexFilter regex_; | ||
}; | ||
|
||
class ParamFilter : public RequestFilter { | ||
public: | ||
ParamFilter(const std::string &name, const std::string ®ex); | ||
~ParamFilter(); | ||
|
||
virtual bool check(const Request *request) const; | ||
private: | ||
std::string name_; | ||
RegexFilter regex_; | ||
}; | ||
|
||
} // namespace fastcgi | ||
|
||
#endif // _FASTCGI_DETAILS_REQUEST_FILTER_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.