-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

All,

First-time httpd hacker, here. I'm looking at:
https://bz.apache.org/bugzilla/show_bug.cgi?id=64338

I've found that around line 637 of mod_proxy_balancer.c it looks like
I just need to poke a value into the r->subprocess_env like this:

        apt_table_setn(r->subprocess_env,
                       "BALANCER_WORKER_STATUS", XXX);

The question is what "XXX" should be. I need to convert
(*worker)->s->status (an unsigned int) into a char*.

I can manually malloc a char*, stick it in there, and deallocate it
each time back through, but that will leak memory when the pool is
recycled and I don't get a chance to free my char*.

I can use apt_table_set instead of apt_table_setn but that will make
performance suck even more than a single allocation each time
mod_proxy handles a request.

I can also use something like apr_itoa/apr_ltoa which will allocate
from the pool which presumably will be cleaned-up at some point,
but... when? I don't know anything about how APR/httpd handle memory
management and I'm afraid I'll much it all up if I don't ask this
question.

So ... what's the right way to do this?

A performance optimization is likely to be that most workers (a) have
all the same "everything is fine" status and (b) the status doesn't
change very often. So maybe having a table of predefined status
strings sitting around wouldn't be the worth possible thing in the
world; that would avoid many needless memory (re)allocations.

Thanks,
- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl6QvLgACgkQHPApP6U8
pFgbURAAxphLP8xQwXS7cwBS5ptbTNp2tjAN55ASQjS6f0Z3novjtm1Q7NmWJKIc
G6W7ZV/tZTkMuU2xF1uTDP32RPCXZ+gi0SXdbnZdm1ZnpYZrGApbiTM+ymIBiUSU
3Sy/X5QavENDuHgaG+f+9Jq6a4BYYzPgvXmEt2lxgqrfCE2HqmbO4LRnYbeNNBDM
xu0esh9ZWKzMhfinYl/AIzWjMcEEEAU2gi5xOuq9luOg+LvQ8BnDchGoS9lCO4eO
vOuB6PesUEQ1fLxjCN/OUrNnC1y0OUua/Xfj7v/adZc8QoUdBoxz44x+BKl6reP6
cpqTPEmdPurwAQdFyvnMLkM5Simw+mkybCF184u0YseN+sOaPTrqP5WJufKn9lCF
q3CPDt3TuF0RucoMEGaY3W2Rw4NOc5yecFOG1vaVkIatrD81uMDZJCYo2wJpZiiK
esWSJ983frbfuerPRGJYKqUol4sPs2Zq5IzDUfWUBeOR+jYcqpFYoW0TKFpwDnAS
7+9dLzQjrW5RJpAdlv+0hkE3xGOACJazXgHr+Un6JJKaNgpp8ThaUVpkzN0gfX+d
TJwVGTxA2Vk5GFdSMeEof3v0vXEqQ4P6Wtfc/+glueUI5UxAs7wOukQd06cBgRo7
83gj/nnpxAq1EaRvWUwI1fY8mXflI0+/0sYclf+1Gmn/SKHB2GA=
=9SrP
-----END PGP SIGNATURE-----

Reply via email to