diff --git a/README.TXT b/README.TXT index d11de7d..c2deaeb 100644 --- a/README.TXT +++ b/README.TXT @@ -2,7 +2,7 @@ Quality of service module for Apache Web Server. http://mod-qos.sourceforge.net/ - Copyright (C) 2023 Pascal Buchbinder + Copyright (C) 2025 Pascal Buchbinder Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with diff --git a/apache2/mod_qos.c b/apache2/mod_qos.c index cef1cf9..7175e51 100644 --- a/apache2/mod_qos.c +++ b/apache2/mod_qos.c @@ -20,7 +20,7 @@ * See http://mod-qos.sourceforge.net/ for further * details and to obtain the latest version of this module. * - * Copyright (C) 2023 Pascal Buchbinder + * Copyright (C) 2025 Pascal Buchbinder * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -42,8 +42,8 @@ /************************************************************************ * Version ***********************************************************************/ -static const char revision[] = "$Id: mod_qos.c 2706 2023-05-16 19:52:59Z pbuchbinder $"; -static const char g_revision[] = "11.74"; +static const char revision[] = "$Id: mod_qos.c 2724 2025-01-03 15:05:21Z pbuchbinder $"; +static const char g_revision[] = "11.76"; /************************************************************************ * Includes @@ -1984,6 +1984,20 @@ static const char *qos_forwardedfor_fromSSL(request_rec *r) { return NULL; } +static const char *qos_forwardedfor_fromUserAgentIP(request_rec *r) { + const char *useragent_ip = NULL; +#if (AP_SERVER_MINORVERSION_NUMBER == 4) && (AP_SERVER_PATCHLEVEL_NUMBER > 18) + useragent_ip = r->useragent_ip; +#endif + if(QS_ISDEBUG(r->server)) { + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + QOS_LOGD_PFX"fromUserAgentIP() USERAGENT_IP=%s, id=%s", + useragent_ip == NULL ? "null" : useragent_ip, + qos_unique_id(r, NULL)); + } + return useragent_ip; +} + static const char *qos_pseudoip(request_rec *r, const char *header) { const char *forwardedfor = NULL; if(strcmp("SSL_CLIENT_S_DN", header) == 0) { @@ -1998,13 +2012,14 @@ static const char *qos_pseudoip(request_rec *r, const char *header) { } static const char *qos_forwardedfor(request_rec *r, const char *header) { - const char *forwardedfor = NULL; if(header[0] == '#') { - forwardedfor = qos_pseudoip(r, &header[1]); + if(strcmp("USERAGENT_IP", &header[1]) == 0) { + return qos_forwardedfor_fromUserAgentIP(r); + } + return qos_pseudoip(r, &header[1]); } else { - forwardedfor = qos_forwardedfor_fromHeader(r, header); + return qos_forwardedfor_fromHeader(r, header); } - return forwardedfor; } /** @@ -3434,6 +3449,7 @@ static int qos_return_error_andclose(conn_rec *connection, apr_socket_t *socket) if(c->cs) { c->cs->state = CONN_STATE_LINGER; } + apr_table_setn(c->notes, "short-lingering-close", "1"); apr_table_set(c->notes, QS_CONN_ABORT, QS_CONN_ABORT); if (m_forced_close == 0) { return DECLINED; @@ -8704,6 +8720,7 @@ static int qos_pre_connection(conn_rec *connection, void *skt) { if(c->cs) { c->cs->state = CONN_STATE_LINGER; } + apr_table_setn(c->notes, "short-lingering-close", "1"); apr_table_set(c->notes, QS_CONN_ABORT, QS_CONN_ABORT); if (m_forced_close == 0) { ret = DECLINED; diff --git a/apache2/mod_qos.h b/apache2/mod_qos.h index 3372abe..4606439 100644 --- a/apache2/mod_qos.h +++ b/apache2/mod_qos.h @@ -15,7 +15,7 @@ * See http://mod-qos.sourceforge.net/ for further * details. * - * Copyright (C) 2023 Pascal Buchbinder + * Copyright (C) 2025 Pascal Buchbinder * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/debian/TODO.Debian b/debian/TODO.Debian deleted file mode 100644 index 22d95f7..0000000 --- a/debian/TODO.Debian +++ /dev/null @@ -1 +0,0 @@ -- is there some official policy for packaging Apache modules? e.g. enable/disable by default diff --git a/debian/autoreconf b/debian/autoreconf deleted file mode 100644 index ef1aab0..0000000 --- a/debian/autoreconf +++ /dev/null @@ -1 +0,0 @@ -tools diff --git a/debian/changelog b/debian/changelog index ec381c3..643d493 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,26 @@ +libapache2-mod-qos (11.76-1) sid; urgency=medium + + * Merging upstream version 11.76. + * Removing TODO, not needed anymore. + * Removing ftbfs-gcc-14.patch, not needed anymore. + * Removing doc-base support, not used anymore. + * Wrap and sorting debian files. + * Updating to debhelper 13. + * Adding build-requires-root field. + * Updating to standards version 4.7.2. + * Updating homepage field. + * Updating vcs fields. + * Repeating section for binary packages explicitly. + * Updating format url in copyright. + * Updating source url in copyright. + * Updating license information in copyright. + * Moving apache2 module files into local subdirectory. + * Harmonizing debhelper install files. + * Harmonizing rules file. + * Updating rules file. + + -- Daniel Baumann Mon, 24 Mar 2025 14:26:10 +0100 + libapache2-mod-qos (11.74-2) sid; urgency=medium * New maintainer (Closes: #931973). diff --git a/debian/compat b/debian/compat deleted file mode 100644 index ec63514..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/debian/control b/debian/control index be8b07c..d793f26 100644 --- a/debian/control +++ b/debian/control @@ -1,16 +1,29 @@ Source: libapache2-mod-qos +Section: httpd Priority: optional Maintainer: Daniel Baumann -Build-Depends: debhelper (>= 9), libssl-dev (>= 0.9.8g), libapr1-dev, libaprutil1-dev, libpcre2-dev, libpng-dev, dh-apache2, apache2-dev (>= 2.4.53-1~), dh-autoreconf -Standards-Version: 4.3.0 -Section: httpd -Homepage: http://mod-qos.sourceforge.net/ -Vcs-Git: https://salsa.debian.org/sk-guest/libapache2-mod-qos.git -Vcs-Browser: https://salsa.debian.org/sk-guest/libapache2-mod-qos +Build-Depends: + debhelper-compat (= 13), + dh-apache2, + dh-autoreconf, + apache2-dev (>= 2.4.53-1~), + libapr1-dev, + libaprutil1-dev, + libpcre2-dev, + libpng-dev, + libssl-dev (>= 0.9.8g), +Rules-Requires-Root: no +Standards-Version: 4.7.2 +Homepage: https://mod-qos.sourceforge.net +Vcs-Browser: https://forgejo.debian.net/web/libapache2-mod-qos +Vcs-Git: https://forgejo.debian.net/web/libapache2-mod-qos Package: libapache2-mod-qos +Section: httpd Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} +Depends: + ${misc:Depends}, + ${shlibs:Depends}, Description: quality of service module for the apache2 This is a quality of service module (QoS) for the Apache web server implementing control mechanisms that can provide different priority diff --git a/debian/copyright b/debian/copyright index 20724eb..b3ad2be 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,17 +1,46 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: mod_qos Upstream-Contact: Pascal Buchbinder -Source: http://mod-qos.sourceforge.net/ +Source: https://sourceforge.net/projects/mod-qos/files/ Files: * -Copyright: 2007-2012, Pascal Buchbinder -License: GPL-2+ +Copyright: 2007-2025 Pascal Buchbinder +License: Apache-2.0 Files: debian/* -Copyright: 2010-2012, Sergey B Kirpichev +Copyright: 2010-2012 Sergey B Kirpichev + 2025 Daniel Baumann License: GPL-2+ +License: Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + https://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + The complete text of the Apache-2.0 License + can be found in /usr/share/common-licenses/Apache-2.0 file. + License: GPL-2+ - On Debian GNU/Linux systems, the complete text of the GNU General - Public License (GPL) version 2 can be found at - /usr/share/common-licenses/GPL-2. + 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, see . + . + The complete text of the GNU General Public License + can be found in /usr/share/common-licenses/GPL-2 file. diff --git a/debian/libapache2-mod-qos.apache2 b/debian/libapache2-mod-qos.apache2 index 69b81af..8442b6c 100644 --- a/debian/libapache2-mod-qos.apache2 +++ b/debian/libapache2-mod-qos.apache2 @@ -1,3 +1,3 @@ mod apache2/.libs/mod_qos.so -mod debian/qos.load -mod debian/qos.conf +mod debian/local/qos.load +mod debian/local/qos.conf diff --git a/debian/libapache2-mod-qos.doc-base.mod_qos b/debian/libapache2-mod-qos.doc-base.mod_qos deleted file mode 100644 index 76c7405..0000000 --- a/debian/libapache2-mod-qos.doc-base.mod_qos +++ /dev/null @@ -1,10 +0,0 @@ -Document: mod-qos -Title: mod-qos Documentation -Author: Pascal Buchbinder -Abstract: This manual describes how to install, configure - and use the QoS apache2 module. -Section: System/Security - -Format: HTML -Index: /usr/share/doc/libapache2-mod-qos/index.html -Files: /usr/share/doc/libapache2-mod-qos/q*.html diff --git a/debian/libapache2-mod-qos.docs b/debian/libapache2-mod-qos.docs index 5bccf56..7e72e9f 100644 --- a/debian/libapache2-mod-qos.docs +++ b/debian/libapache2-mod-qos.docs @@ -1,5 +1,4 @@ -README.TXT +doc/*.gif doc/favicon.ico doc/index.html -doc/*.gif doc/q*.html diff --git a/debian/libapache2-mod-qos.install b/debian/libapache2-mod-qos.install deleted file mode 100644 index 9d27655..0000000 --- a/debian/libapache2-mod-qos.install +++ /dev/null @@ -1,7 +0,0 @@ -tools/src/qslog usr/bin/ -tools/src/qspng usr/bin/ -tools/src/qssign usr/bin/ -tools/src/qstail usr/bin/ -tools/src/qsgrep usr/bin/ -tools/src/qsexec usr/bin/ -tools/src/qslogger usr/bin/ diff --git a/debian/libapache2-mod-qos.manpages b/debian/libapache2-mod-qos.manpages index 67f1694..9b1b4fe 100644 --- a/debian/libapache2-mod-qos.manpages +++ b/debian/libapache2-mod-qos.manpages @@ -1,7 +1 @@ -tools/man1/qsexec.1 -tools/man1/qsgrep.1 -tools/man1/qslog.1 -tools/man1/qspng.1 -tools/man1/qssign.1 -tools/man1/qstail.1 -tools/man1/qslogger.1 +tools/man1/*.1 diff --git a/debian/qos.conf b/debian/local/qos.conf similarity index 100% rename from debian/qos.conf rename to debian/local/qos.conf diff --git a/debian/qos.load b/debian/local/qos.load similarity index 100% rename from debian/qos.load rename to debian/local/qos.load diff --git a/debian/patches/debian/0001-ftbfs-gcc-14.patch b/debian/patches/debian/0001-ftbfs-gcc-14.patch deleted file mode 100644 index d48cc81..0000000 --- a/debian/patches/debian/0001-ftbfs-gcc-14.patch +++ /dev/null @@ -1,28 +0,0 @@ -Author: Daniel Baumann -Description: Building without qsfilter2 and qsrotate, they are removed in later upstream version (Closes: #1075142). - -diff -Naurp libapache2-mod-qos.orig/tools/src/Makefile.am libapache2-mod-qos/tools/src/Makefile.am ---- libapache2-mod-qos.orig/tools/src/Makefile.am -+++ libapache2-mod-qos/tools/src/Makefile.am -@@ -1,6 +1,6 @@ - # $Id: Makefile.am 2486 2018-09-03 20:22:17Z pbuchbinder $ - --bin_PROGRAMS=qsfilter2 qslog qspng qsrotate qssign qstail qshead qsgrep qsexec qscheck qsgeo qslogger qsdt qsrespeed qsre -+bin_PROGRAMS=qslog qspng qssign qstail qshead qsgrep qsexec qscheck qsgeo qslogger qsdt qsrespeed qsre - - qsfilter2_SOURCES= \ - qsfilter2.c qs_util.c -diff -Naurp libapache2-mod-qos.orig/tools/src/Makefile.in libapache2-mod-qos/tools/src/Makefile.in ---- libapache2-mod-qos.orig/tools/src/Makefile.in -+++ libapache2-mod-qos/tools/src/Makefile.in -@@ -88,8 +88,8 @@ POST_INSTALL = : - NORMAL_UNINSTALL = : - PRE_UNINSTALL = : - POST_UNINSTALL = : --bin_PROGRAMS = qsfilter2$(EXEEXT) qslog$(EXEEXT) qspng$(EXEEXT) \ -- qsrotate$(EXEEXT) qssign$(EXEEXT) qstail$(EXEEXT) \ -+bin_PROGRAMS = qslog$(EXEEXT) qspng$(EXEEXT) \ -+ qssign$(EXEEXT) qstail$(EXEEXT) \ - qshead$(EXEEXT) qsgrep$(EXEEXT) qsexec$(EXEEXT) \ - qscheck$(EXEEXT) qsgeo$(EXEEXT) qslogger$(EXEEXT) \ - qsdt$(EXEEXT) qsrespeed$(EXEEXT) qsre$(EXEEXT) diff --git a/debian/patches/series b/debian/patches/series deleted file mode 100644 index 2dfad7f..0000000 --- a/debian/patches/series +++ /dev/null @@ -1 +0,0 @@ -debian/0001-ftbfs-gcc-14.patch diff --git a/debian/rules b/debian/rules index 56dc601..3294efe 100755 --- a/debian/rules +++ b/debian/rules @@ -3,25 +3,17 @@ export DEB_BUILD_MAINT_OPTIONS := hardening=+bindnow %: - dh $@ --with apache2,autoreconf + dh ${@} --sourcedirectory=tools --with apache2 -override_dh_auto_configure: - dh_auto_configure --sourcedirectory=tools -- \ - --with-apr=/usr/bin \ - --with-apr-util=/usr/bin \ - --with-pcre=/usr/bin \ - --with-png=/usr/bin \ - --with-ssl=/usr/lib +execute_after_dh_auto_clean: + rm -f apache2/mod_qos.*l* apache2/mod_qos.o + rm -rf apache2/.libs/ -override_dh_auto_build: +execute_after_dh_auto_build: LTFLAGS="--no-silent" apxs2 \ -S CFLAGS="$(CFLAGS) \ -D_LARGEFILE64_SOURCE $(CPPFLAGS)" \ -lcrypto -DHAVE_OPENSSL -c apache2/mod_qos.c - dh_auto_build --sourcedirectory=tools - -override_dh_auto_clean: - dh_auto_clean --sourcedirectory=tools - dh_clean apache2/.libs/* apache2/mod_qos.*l* apache2/mod_qos.o - rm -rf apache2/.libs/ +override_dh_installchangelog: + dh_installchangelog doc/CHANGES.txt diff --git a/debian/watch b/debian/watch index c792550..aa84930 100644 --- a/debian/watch +++ b/debian/watch @@ -1,6 +1,2 @@ -version=3 -# Homepage Pattern [Version [Action]] +version=4 http://sf.net/mod-qos/mod_qos-(.+)\.tar\.gz -# qa.debian.org runs a redirector which allows a simpler form of URL -# for SourceForge based projects. The format below will automatically -# be rewritten to use the redirector. diff --git a/doc/CHANGES.txt b/doc/CHANGES.txt index 5fd53bc..9c83dab 100644 --- a/doc/CHANGES.txt +++ b/doc/CHANGES.txt @@ -1,12 +1,27 @@ +Version 11.76 + + - Setting connection note short-lingering-close when aborting connection (to + improve connection close behavior when using MPM event). + + - Removes outdated utilities from the distribution package: qsfilter2, + qspng, qsrotate, qssign, qstail, qshead, qsgrep, qsexec, qscheck, qslogger, + and qsdt. + +Version 11.75 + + - QS_ClientIpFromHeader supports other modules (e.g. mod_remoteip) setting + a client address to the request record when using the special header + name #USERAGENT_IP. + Version 11.74 -- Fixed: Potential counter overflow for early event detection - (increment before block) or log only mode. + - Fixed: Potential counter overflow for early event detection + (increment before block) or log only mode. Version 11.73 - This release introduces support of the PCRE2 (10.x) library in place of - the now end-of-life PCRE version 1 (8.x) API. + This release introduces support of the PCRE2 (10.x) library in place of + the now end-of-life PCRE version 1 (8.x) API. - Removes PCRE API dependency from mod_qos.c. The module no longer has an explicit dependency to the PCRE library but uses ap_pregcomp(), diff --git a/doc/MESSAGES.txt b/doc/MESSAGES.txt index 3afdb29..8385a5e 100644 --- a/doc/MESSAGES.txt +++ b/doc/MESSAGES.txt @@ -1,4 +1,4 @@ -mod_qos version 11.74 +mod_qos version 11.76 mod_qos(001): QS_ClientEventLimitCount directives can't be added/removed by graceful restart. A server restart is required to apply the new configuration! mod_qos(002): failed to create shared memory (ACT)(%s): %s (%lu bytes) mod_qos(002): failed to create shared memory (client control)(%s): %s (%d bytes) diff --git a/doc/glossary.html b/doc/glossary.html index 66ddc49..1c74fce 100644 --- a/doc/glossary.html +++ b/doc/glossary.html @@ -32,7 +32,7 @@ See http://mod-qos.sourceforge.net/ for further details. - Copyright (C) 2023 Pascal Buchbinder + Copyright (C) 2025 Pascal Buchbinder Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -598,6 +598,6 @@ You can use the spreadsheet program of your choice to process the output:



-© 2023, Pascal Buchbinder +© 2024, Pascal Buchbinder diff --git a/doc/headerfilterrules.txt b/doc/headerfilterrules.txt index 58d4d5c..deba4d0 100644 --- a/doc/headerfilterrules.txt +++ b/doc/headerfilterrules.txt @@ -94,4 +94,4 @@ QS_ResponseHeaderFilter rules: name=X-Frame-Options, action=drop, size=4000, pattern=^[\x20-\xFF]*$ name=X-XSS-Protection, action=drop, size=4000, pattern=^[\x20-\xFF]*$ -mod_qos 11.74 +mod_qos 11.76 diff --git a/doc/index.html b/doc/index.html index 839d364..71baeae 100644 --- a/doc/index.html +++ b/doc/index.html @@ -34,7 +34,7 @@ See http://mod-qos.sourceforge.net/ for further details. - Copyright (C) 2023 Pascal Buchbinder + Copyright (C) 2025 Pascal Buchbinder Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -248,7 +248,7 @@ server's modules directory.
-cd mod_qos-11.74/apache2
+cd mod_qos-11.76/apache2
 apxs -i -c mod_qos.c -lcrypto -lpcre2-8
 cd ../..
 
@@ -320,11 +320,11 @@ within the format string used by the QSLog dir The support tools may be built (at least on some Linux platforms) using the GNU autotools. Some of these utilities require third-party libraries such as apr, apr-util, PCRE2, -libpng, and OpenSSL. +and OpenSSL.
-cd mod_qos-11.74/tools
+cd mod_qos-11.76/tools
 ./configure
 make
 
@@ -946,10 +946,6 @@ that has occurred during a request. QS_Country
ISO 3166 country code of client IPv4 address. Only available if the geographical database file has been loaded.
-Note: You may use the QS_ClientIpFromHeader <header> -directive to override the client's IP address based on the value within the defined -HTTP request header (e.g., X-Forwarded-For) instead of taking the IP address of -the client which has opened the TCP connection.