httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@attglobal.net>
Subject Re: mod_usertrack.c modifications and child seg faults
Date Wed, 20 Nov 2002 12:39:53 GMT
Joe Oppegaard <joe@joppegaard.com> writes:

> Once I switch over to the if statement that first checks for r->content_type
> then calls strcmp, everything works just as expected.
> 
> Any ideas on why this is?

the simple answer is "because r->content_type has not yet been set at
this point"

and if you look at other code in Apache you'll see checks to verify
that r->content_type is actually set

as for why r->content_type isn't set as of the fixup hook on this
particular request, I do not know...  it depends on the config
affecting this request and what other modules are doing

> --- mod_usertrack.c.orig        2002-11-19 23:36:26.000000000 -0800
> +++ mod_usertrack.c     2002-11-19 23:37:55.000000000 -0800
> @@ -222,8 +222,16 @@
> 
>              return DECLINED;    /* There's already a cookie, no new one */
>          }
>    make_cookie(r);
>    return OK;                  /* We set our cookie */
> +

is this really the right patch?  how do you even get to the code below
given the unconditional "return OK" right above?

> +
> +    /*if (r->content_type && strcmp(r->content_type,"text/html") == 0)
{*/
> +    if (strcmp(r->content_type,"text/html") == 0) {
> +        make_cookie(r);
> +        return OK;
> +    }
> +    else {
> +        return DECLINED;
> +    }
>  }
> 
>  static void *make_cookie_log_state(apr_pool_t *p, server_rec *s)

-- 
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...

Mime
View raw message