[wplug] C compiling question
bpmedley at 4321.tv
bpmedley at 4321.tv
Tue Oct 1 21:39:06 EDT 2002
On Tue, 1 Oct 2002, James O'Kane wrote:
> He something like this in line 3076:
> r->handler = throttle_remote_user_str;
>
> And then on line 3634:
> if (r->handler == throttle_remote_user_str) {
>
> Declaration of throttle_remote_user_str:
> static const char throttle_remote_user_str[] = "throttle-remote-user"
>
> It seems like it would save the address of throttle_remote_user_str into
> r->handler, and then line 3634 it is comparing two pointers.
>
> This is packaged along with Red Hat 7.3, so I'm concluding that this must
> have worked in some fashion at some point. Without me adding any changes,
> I've found that the if in 3634 is never true, and it should be. gdb
> confirms that. If I change the == to a strcmp, it works as it should.
> How can this have made it into 'production' code when the whole
> functionality of this modules doesn't work as is.
I personally don't know why the original wouldn't work. Assuming that
r->handler is a char *, then it should get address of
throttle_remote_user_str. This would make the == comparison true. How do
you load this module and use gdb on it?
--
~'`^`'~=-.,__,.-=~'`^`'~=-.,__,.-=~'`^`'~=-., \|/ (___) \|/ _,.-=~'`^`
Brian Medley @~./'O o`\.~@
"Knowledge is Power" brian.medley at verizon.net /__( \___/ )__\ *PPPFFBT!*
-- Francis Bacon `\__`U_/'
_,.-=~'`^`'~=-.,__,.-=~'`^`'~=-.,__,.-=~'`^`'~= <____|' ^^`'~=-.,__,.-=
~`'^`'~=-.,__,.-=~'`^`'~=-.,__,.-=~'`^`'~=-.,__,.-==--^'~=-.,__,.-=~'`^`
More information about the wplug
mailing list