1
0
Fork 0

Merging upstream version 11.76.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-03-24 14:50:13 +01:00
parent b1c252527e
commit bca5300afb
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
65 changed files with 413 additions and 7681 deletions

View file

@ -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;

View file

@ -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