Hi Dave,

On Mon, 8 Oct 2001, Dave Rolsky wrote:

> Apache::Cookie->new( $r,
>                    -name => 'foo',
>                    -value => { will_break => '', completely_borked => 1 } )->bake;

Have you tried doing

Apache::Cookie->new( $r,
                     -name => 'foo',
                     -value => { wont_break => '1', not_at_all_borked => '' } )->bake;

instead?

> The problem is here in apache_cookie.c
> 
>       while (*pair && (val = ap_getword(r->pool, &pair, '&'))) {

Quite so.

> I tried to fix it but I am a C gimp and don't know WTF I am doing.

Please don't modify the function ap_getword() in src/main/util.c as
that will probably break all sorts of things.

You could make a function like it by copying everything in the function

API_EXPORT(char*) ap_getword(....)
{
  ...
  ...
  while(*pos == stop)
  {
    ++pos;
  }
  ...
  ...
}


and making a new one for example

API_EXPORT(char*) dave_ap_getword(....)
{
  ...
  ...
  /*
  while(*pos == stop)
  {
    ++pos;
  }
  */
  ...
  ...
}


and then call that instead.  You will need to find the header file
which declares the function and put a declaration along the same lines
in there and then recompile.

I'd leave this new function in the same file (util.c) for a quick hack
but if you leave it like that then ten to one you'll forget it's in
there and have to do it all over again next time you upgrade Apache.

It's still better to find a way around the problem than to do
something nasty like this.

HTH,

73,
Ged.


Reply via email to