diff options
author | Stef Walter <stef@memberwebs.com> | 2006-06-19 16:30:37 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2006-06-19 16:30:37 +0000 |
commit | 0b7db8805d91eac81a4b526d3400a9d50bd5c7e1 (patch) | |
tree | 3fc79298cd9ac9b723d826418bfb2bfba2672c22 /apache2x/mod_httpauth.c | |
parent | 40d910975e099c1a8174a9f2e44e0b7c0314954a (diff) |
Fix NTLM problems with apache 2x module.
Diffstat (limited to 'apache2x/mod_httpauth.c')
-rw-r--r-- | apache2x/mod_httpauth.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/apache2x/mod_httpauth.c b/apache2x/mod_httpauth.c index 9e8a95a..9d3854b 100644 --- a/apache2x/mod_httpauth.c +++ b/apache2x/mod_httpauth.c @@ -54,6 +54,12 @@ module AP_MODULE_DECLARE_DATA 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; @@ -614,6 +620,14 @@ finally: return ret; } +/* Make sure our connection identifier is unique */ +static apr_status_t connection_gone (void *data) +{ + conn_current = NULL; + conn_seen++; + return APR_SUCCESS; +} + int write_request(httpauth_context_t* ctx, request_rec* r) { char pidid[40]; @@ -623,9 +637,17 @@ int write_request(httpauth_context_t* ctx, request_rec* r) const apr_array_header_t* hdrs_arr; const apr_table_entry_t* elts; + /* When the connection goes away, call our handler */ + if(conn_current != r->connection) + { + conn_current = r->connection; + apr_pool_cleanup_register(r->connection->pool, r, + connection_gone, apr_pool_cleanup_null); + } + /* A unique per connection id */ - snprintf(connid, sizeof(connid), "0x%X-%X", - (unsigned int)r->connection, (unsigned int)r->connection->id); + snprintf(connid, sizeof(connid), "0x%X-%X-%X", + (unsigned int)r->connection, conn_seen, (unsigned int)r->connection->id); connid[sizeof(connid) - 1] = 0; snprintf(pidid, sizeof(pidid), "%d", (unsigned int)getpid()); pidid[sizeof(pidid) - 1] = 0; |