Skip to content

Commit

Permalink
ext_time_quota_acl: restore debug level feature and argument (#1936)
Browse files Browse the repository at this point in the history
Commit 4878cfe modernized the time quota ACL helper,
but removed the '-d debuglevel' feature, reducing it to a binary
toggle.
  • Loading branch information
kinkie authored and squid-anubis committed Nov 13, 2024
1 parent aacc917 commit c8ea6a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/acl/external/time_quota/ext_time_quota_acl.8
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Version 1.0
.
.SH SYNOPSIS
.if !'po4a'hide' .B ext_time_quota_acl
.if !'po4a'hide' .B "[\-b database] [\-d] [\-p pauselen] [\-h] configfile
.if !'po4a'hide' .B "[\-b database] [\-d level] [\-p pauselen] [\-h] configfile
.
.SH DESCRIPTION
.B ext_time_quota_acl
Expand Down Expand Up @@ -36,7 +36,7 @@ Default is 300 seconds (5 minutes).
.
.if !'po4a'hide' .TP
.if !'po4a'hide' .B "\-d"
Enables debug logging to stderr.
Sets verbosity level for debugging section 82 (0-9; defaults to 1; see debug_options).
.
.if !'po4a'hide' .TP
.if !'po4a'hide' .B "\-h"
Expand Down
18 changes: 9 additions & 9 deletions src/acl/external/time_quota/ext_time_quota_acl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,13 @@ static void usage(void)
debugs(MY_DEBUG_SECTION, DBG_CRITICAL, "Wrong usage. Please reconfigure in squid.conf.");

std::cerr <<
"Usage: " << program_name << " [-d] [-b dbpath] [-p pauselen] [-h] configfile\n"
" -d enable debugging output\n"
" -l logfile log messages to logfile\n"
" -b dbpath Path where persistent session database will be kept\n"
" If option is not used, then " DEFAULT_QUOTA_DB " will be used.\n"
" -p pauselen length in seconds to describe a pause between 2 requests.\n"
" -h show show command line help.\n"
"Usage: " << program_name << " [-d level] [-b dbpath] [-p pauselen] [-h] configfile\n" <<
" -d level set section " << MY_DEBUG_SECTION << " debugging to the specified level,\n"
" overwriting Squid's debug_options (default: 1)\n"
" -b dbpath Path where persistent session database will be kept\n" <<
" If option is not used, then " << DEFAULT_QUOTA_DB << " will be used.\n" <<
" -p pauselen length in seconds to describe a pause between 2 requests.\n" <<
" -h show show command line help.\n" <<
"configfile is a file containing time quota definitions.\n";
}

Expand All @@ -346,10 +346,10 @@ int main(int argc, char **argv)
program_name = argv[0];
Debug::NameThisHelper("ext_time_quota_acl");

while ((opt = getopt(argc, argv, "dp:b:h")) != -1) {
while ((opt = getopt(argc, argv, "d:p:b:h")) != -1) {
switch (opt) {
case 'd':
Debug::Levels[MY_DEBUG_SECTION] = DBG_DATA;
Debug::parseOptions(ToSBuf(MY_DEBUG_SECTION, ",", optarg).c_str());
break;
case 'b':
db_path = optarg;
Expand Down

0 comments on commit c8ea6a3

Please sign in to comment.