|
Squid Web Cache master
|
#include "squid.h"#include "debug/Stream.h"#include "helper/protocol_defines.h"#include "sbuf/Stream.h"#include <ctime>Go to the source code of this file.
Functions | |
| static void | init_db (void) |
| static void | shutdown_db (void) |
| static SBuf | KeyString (const char *user_key, const char *sub_key) |
| static void | writeTime (const char *user_key, const char *sub_key, time_t t) |
| static time_t | readTime (const char *user_key, const char *sub_key) |
| static void | parseTime (const char *s, time_t *secs, time_t *start) |
| static void | readConfig (const char *filename) |
| static void | processActivity (const char *user_key) |
| static void | usage (void) |
| int | main (int argc, char **argv) |
Variables | |
| static const auto | MY_DEBUG_SECTION = 82 |
| const char * | db_path = DEFAULT_QUOTA_DB |
| const char * | program_name |
| TDB_CONTEXT * | db = nullptr |
| static const auto | KeyLastActivity = "last-activity" |
| static const auto | KeyPeriodStart = "period-start" |
| static const auto | KeyPeriodLengthConfigured = "period-length-configured" |
| static const auto | KeyTimeBudgetLeft = "time-budget-left" |
| static const auto | KeyTimeBudgetConfigured = "time-budget-configured" |
| static const size_t | TQ_BUFFERSIZE = 1024 |
| static int | pauseLength = 300 |
|
static |
Definition at line 73 of file ext_time_quota_acl.cc.
References db, db_path, DBG_CRITICAL, debugs, and MY_DEBUG_SECTION.
Referenced by main().
|
static |
Definition at line 91 of file ext_time_quota_acl.cc.
References ToSBuf().
Referenced by readTime(), and writeTime().
Definition at line 341 of file ext_time_quota_acl.cc.
References db_path, DBG_IMPORTANT, debugs, getopt(), HELPER_INPUT_BUFFER, HLP_MSG, init_db(), MY_DEBUG_SECTION, Debug::NameThisHelper(), optarg, optind, Debug::parseOptions(), pauseLength, processActivity(), program_name, readConfig(), SEND_BH, shutdown_db(), ToSBuf(), and usage().
|
static |
Definition at line 140 of file ext_time_quota_acl.cc.
References DBG_IMPORTANT, debugs, MY_DEBUG_SECTION, and NULL.
Referenced by readConfig().
|
static |
Definition at line 246 of file ext_time_quota_acl.cc.
References debugs, HLP_MSG, KeyLastActivity, KeyPeriodLengthConfigured, KeyPeriodStart, KeyTimeBudgetConfigured, KeyTimeBudgetLeft, MY_DEBUG_SECTION, NULL, pauseLength, readTime(), SEND_ERR, SEND_OK, ToSBuf(), and writeTime().
Referenced by main().
|
static |
This function parses the time quota file and stores it in memory.
Definition at line 185 of file ext_time_quota_acl.cc.
References DBG_IMPORTANT, debugs, KeyPeriodLengthConfigured, KeyPeriodStart, KeyTimeBudgetConfigured, KeyTimeBudgetLeft, MY_DEBUG_SECTION, NULL, parseTime(), readTime(), TQ_BUFFERSIZE, and writeTime().
Referenced by main().
|
static |
Definition at line 112 of file ext_time_quota_acl.cc.
References db, DBG_IMPORTANT, debugs, KeyString(), and MY_DEBUG_SECTION.
Referenced by processActivity(), and readConfig().
|
static |
|
static |
Definition at line 326 of file ext_time_quota_acl.cc.
References DBG_CRITICAL, debugs, MY_DEBUG_SECTION, and program_name.
Referenced by main().
|
static |
Definition at line 96 of file ext_time_quota_acl.cc.
References db, debugs, KeyString(), and MY_DEBUG_SECTION.
Referenced by processActivity(), and readConfig().
| TDB_CONTEXT* db = nullptr |
Definition at line 52 of file ext_time_quota_acl.cc.
Referenced by Ssl::CertificateDb::addCertAndPrivateKey(), Ssl::CertificateDb::Check(), Ssl::CertificateDb::Create(), Ssl::CertificateDb::deleteByKey(), deleteEntry(), Ssl::CertificateDb::deleteInvalidCertificate(), Ssl::CertificateDb::deleteOldestCertificate(), Ssl::CertificateDb::deleteRow(), fetchKey(), Ssl::CertificateDb::hasRows(), init_db(), init_db(), Ssl::CertificateDb::load(), processNewRequest(), Ssl::CertificateDb::pure_find(), Ssl::CertificateDb::purgeCert(), readTime(), Ssl::CertificateDb::rebuildSize(), Ssl::CertificateDb::save(), session_login(), shutdown_db(), shutdown_db(), and writeTime().
| const char* db_path = DEFAULT_QUOTA_DB |
Definition at line 49 of file ext_time_quota_acl.cc.
|
static |
Definition at line 54 of file ext_time_quota_acl.cc.
Referenced by processActivity().
|
static |
Definition at line 56 of file ext_time_quota_acl.cc.
Referenced by processActivity(), and readConfig().
|
static |
Definition at line 55 of file ext_time_quota_acl.cc.
Referenced by processActivity(), and readConfig().
|
static |
Definition at line 58 of file ext_time_quota_acl.cc.
Referenced by processActivity(), and readConfig().
|
static |
Definition at line 57 of file ext_time_quota_acl.cc.
Referenced by processActivity(), and readConfig().
|
static |
Definition at line 48 of file ext_time_quota_acl.cc.
Referenced by init_db(), main(), parseTime(), processActivity(), readConfig(), readTime(), usage(), and writeTime().
|
static |
If there is more than this given number of seconds between two successive requests, than the second request will be treated as a new request and the time between first and seconds request will be treated as a activity pause.
Otherwise the following request will be treated as belonging to the same activity and the quota will be reduced.
Definition at line 71 of file ext_time_quota_acl.cc.
Referenced by main(), and processActivity().
| const char* program_name |
Definition at line 50 of file ext_time_quota_acl.cc.
|
static |
Maximum size of buffers used to read or display lines.
Definition at line 61 of file ext_time_quota_acl.cc.
Referenced by readConfig().