diff options
author | Stef Walter <stef@memberwebs.com> | 2006-05-17 23:19:52 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2006-05-17 23:19:52 +0000 |
commit | acbe1e8b817da2bb32d2db79a56748d829d84baa (patch) | |
tree | 44a247eb8a0fb820c9f7970a69421e839474f243 /apache1x/mod_httpauth.c | |
parent | 972952bb7b44e8c7c469acd34131232d370ded53 (diff) |
0.5.1
- Fix problem with NTLM connection caching
Diffstat (limited to 'apache1x/mod_httpauth.c')
-rw-r--r-- | apache1x/mod_httpauth.c | 24 |
1 files changed, 23 insertions, 1 deletions
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; |