tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Armstrong <a...@tagish.com>
Subject Re: Any reason why...
Date Fri, 22 Jun 2001 08:24:31 GMT
Andy Armstrong wrote:
> 
> GOMEZ Henri wrote:
> >
> > >...these two lines at around 1110 in jk_ajp_common.c
> > >
> > >  int port = jk_get_worker_port(props, p->name, port);
> > >  char *host = jk_get_worker_host(props, p->name, host);
> > >
> > >use unitialised values for port and host. Anyone mind if I change them
> > >to
> > >
> > >  int port = jk_get_worker_port(props, p->name, -1);
> > >  char *host = jk_get_worker_host(props, p->name, NULL);
> > >
> >
> > The value are initialised some lines before depending AJP13/AJP14 :)
> 
> They can't be initialised before -- they're actually declared in the
> fragment I quote -- they don't exist before here.

Ah. I see the real problem -- they're declared at the start of the
function and again here. Unfortunately the values that are in scope when
jk_get_worker_port() and jk_get_worker_host() are called are the new,
uninitialised variables rather than the ones declared at the top of the
function.

Those two lines should change to

    port = jk_get_worker_port(props, p->name, port);
    host = jk_get_worker_host(props, p->name, host);


-- 
Andy Armstrong, Tagish

Mime
View raw message