summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2006-05-17 23:19:52 +0000
committerStef Walter <stef@memberwebs.com>2006-05-17 23:19:52 +0000
commitacbe1e8b817da2bb32d2db79a56748d829d84baa (patch)
tree44a247eb8a0fb820c9f7970a69421e839474f243
parent972952bb7b44e8c7c469acd34131232d370ded53 (diff)
0.5.1
- Fix problem with NTLM connection caching
-rw-r--r--ChangeLog3
-rw-r--r--apache1x/mod_httpauth.c24
-rw-r--r--apache2x/Makefile.in1
-rw-r--r--apache2x/mod_httpauth.c3
-rw-r--r--configure.in4
5 files changed, 30 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index ec783e3..fe622e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+0.5.1
+ - Fix problem with NTLM connection caching
+
0.5
- Added Dummy handler
- PostgreSQL support
diff --git a/apache1x/mod_httpauth.c b/apache1x/mod_httpauth.c
index 4443c81..4cb3e3f 100644
--- a/apache1x/mod_httpauth.c
+++ b/apache1x/mod_httpauth.c
@@ -51,6 +51,12 @@
module MODULE_VAR_EXPORT httpauth_module;
+/* Keep track of a unique identifier */
+static void* conn_current = NULL;
+
+/* And increment this when it goes out of scope */
+static unsigned int conn_seen = 0;
+
typedef struct httpauth_context
{
const char* socketname;
@@ -609,6 +615,13 @@ finally:
return ret;
}
+/* Make sure our connection identifier is unique */
+static void connection_gone (void *data)
+{
+ conn_current = NULL;
+ conn_seen++;
+}
+
int write_request(httpauth_context_t* ctx, request_rec* r)
{
char pidid[40];
@@ -618,8 +631,17 @@ int write_request(httpauth_context_t* ctx, request_rec* r)
const array_header* hdrs_arr;
const table_entry* elts;
+ /* When the connection goes away, call our handler */
+ if(conn_current != r->connection)
+ {
+ conn_current = r->connection;
+ ap_register_cleanup(r->connection->pool, r,
+ connection_gone, ap_null_cleanup);
+ }
+
/* A unique per connection id */
- snprintf(connid, sizeof(connid), "0x%X", (unsigned int)r->connection);
+ snprintf(connid, sizeof(connid), "0x%X-%X",
+ (unsigned int)r->connection, conn_seen);
connid[sizeof(connid) - 1] = 0;
snprintf(pidid, sizeof(pidid), "%d", (unsigned int)getpid());
pidid[sizeof(pidid) - 1] = 0;
diff --git a/apache2x/Makefile.in b/apache2x/Makefile.in
index 625bc7d..2244be8 100644
--- a/apache2x/Makefile.in
+++ b/apache2x/Makefile.in
@@ -7,7 +7,6 @@ all: mod_httpauth.so
mod_httpauth.so: mod_httpauth.c ../common/sock_any.c
@APXS@ -c -Wc,-g -Wc,-O0 $(DEF) $(INC) $(LIB) mod_httpauth.c
- @SH_LINK@ -rpath $(libexecdir) -module -avoid-version mod_httpauth.lo
# install the DSO file into the Apache installation
# and activate it in the Apache configuration
diff --git a/apache2x/mod_httpauth.c b/apache2x/mod_httpauth.c
index ff4494e..9e8a95a 100644
--- a/apache2x/mod_httpauth.c
+++ b/apache2x/mod_httpauth.c
@@ -624,7 +624,8 @@ int write_request(httpauth_context_t* ctx, request_rec* r)
const apr_table_entry_t* elts;
/* A unique per connection id */
- snprintf(connid, sizeof(connid), "0x%X", (unsigned int)r->connection);
+ snprintf(connid, sizeof(connid), "0x%X-%X",
+ (unsigned int)r->connection, (unsigned int)r->connection->id);
connid[sizeof(connid) - 1] = 0;
snprintf(pidid, sizeof(pidid), "%d", (unsigned int)getpid());
pidid[sizeof(pidid) - 1] = 0;
diff --git a/configure.in b/configure.in
index d4f51ca..0b4fc23 100644
--- a/configure.in
+++ b/configure.in
@@ -36,8 +36,8 @@ dnl Nate Nielsen <nielsen@memberwebs.com>
dnl
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(httpauth, 0.5, nielsen@memberwebs.com)
-AM_INIT_AUTOMAKE(httpauth, 0.5)
+AC_INIT(httpauth, 0.5.1, nielsen@memberwebs.com)
+AM_INIT_AUTOMAKE(httpauth, 0.5.1)
LDFLAGS="$LDFLAGS -L/usr/local/lib"
CFLAGS="$CFLAGS -I/usr/local/include -g -O0"