[AGENT++] [PATCH] agent++: locking fixes and improvements

dominik.vogt at external.thalesgroup.com dominik.vogt at external.thalesgroup.com
Thu Aug 19 07:45:50 CEST 2010


On Wed, Aug 18, 2010 at 10:22:59PM +0200, Jochen Katz wrote:
>    I still have problems to follow. So a few questions:
> 
>    Am 18.08.2010 09:58, schrieb dominik.vogt at external.thalesgroup.com:
>    > The code is structured like this:
>    >
>    >   for (/*outer loop*/)
> 
>    Is this "for (int j=0; j<maxrep; j++) {"?

Yes.  Please refer to the patch.  In the first line of the hunk
it states that the patched code is in the function
Mib::process_get_bulk_request() near line 3951:

  @@ -3951,7 +3951,6 @@ void Mib::process_get_bulk_request(Request* req)
      ^^^^                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

>    >   {
>    >     for (/*middle loop*/)
> 
>    Is this "for (; (id < req->subrequests()) &&
>           (id < endofNextRow); id++) {"?

Yes.  Note that this loop is *not* an inner loop of the one you
quoted above.

>    >     {
>    > A     lock_mib()
>    >       do
> 
>    Is this "do" inside an "#ifdef _SNMPv3"?
>    If all answers are yes, then the patch is not applicable, because it it
>    inside an #else of "#ifdef _SNMPv3".

Argh, I see what you mean, you are right.  8-O

Using ifdefs like this is a real software maintenance nightmare.
Many years ago, reading this paper proved very helpful to me:

  http://doc.cat-v.org/henry_spencer/ifdef_considered_harmful

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt



More information about the AGENTPP mailing list