Record Counting Bug

Carter Bullard carter at qosient.com
Sat Aug 29 16:35:09 EDT 2009


Hey Nick,
Its counting the initial management record that is the first record of  
every file.
Its a valid record.  Not interested in counting it?

Carter

On Aug 29, 2009, at 3:14 PM, Nick Diel wrote:

> This bug may affect other things, but in racount the record count is  
> always 1 higher than it should be.  I actually dug into the source  
> code here (note I am not a progammer by day or night, so take it all  
> with a grain of salt).  I found in the argus_main.c file it  
> incremented total records by one every time a file is read.  I think  
> it is as simple as removing this line since the counting actually  
> happens in the argus_util.c file.  Also right next to it we are  
> incrementing ArgusTotalMarRecords, I am not sure what this is, but  
> perhaps that shouldn't be there too.  Then this increment for these  
> two items happens for stdin and remote connections, so probably  
> should be removed too.  Here is what I think the patch file should be:
>
> --- origs/argus_main.c  2009-08-29 11:35:50.000000000 -0600
> +++ common/argus_main.c 2009-08-29 13:10:42.000000000 -0600
> @@ -216,8 +216,6 @@
>                    }
>
>                    if ((file->file != NULL) && ((ArgusReadConnection  
> (ArgusParser, file, ARGUS_FILE)) >= 0)) {
> -                     ArgusParser->ArgusTotalMarRecords++;
> -                     ArgusParser->ArgusTotalRecords++;
>
>                       if (ArgusParser->RaPollMode) {
>                           ArgusHandleDatum (ArgusParser, file, &file- 
> >ArgusInitCon, &ArgusParser->ArgusFilterCode);
> @@ -246,8 +244,6 @@
>                 file->ostop = -1;
>
>                 if (((ArgusReadConnection (ArgusParser, file,  
> ARGUS_FILE)) >= 0)) {
> -                  ArgusParser->ArgusTotalMarRecords++;
> -                  ArgusParser->ArgusTotalRecords++;
>
>                    if ((flags = fcntl(fileno(stdin), F_GETFL, 0L)) <  
> 0)
>                       ArgusLog (LOG_ERR, "ArgusConnectRemote: fcntl  
> error %s", strerror(errno));
> @@ -309,8 +305,6 @@
>              while ((addr = (void *)ArgusPopQueue(ArgusParser- 
> >ArgusRemoteHosts, ARGUS_LOCK)) != NULL) {
>                 if ((addr->fd = ArgusGetServerSocket (addr, 5)) >=  
> 0) {
>                    if ((ArgusReadConnection (ArgusParser, addr,  
> ARGUS_SOCKET)) >= 0) {
> -                     ArgusParser->ArgusTotalMarRecords++;
> -                     ArgusParser->ArgusTotalRecords++;
>
>                       if ((flags = fcntl(addr->fd, F_GETFL, 0L)) < 0)
>                          ArgusLog (LOG_ERR, "ArgusConnectRemote:  
> fcntl error %s", strerror(errno));
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3815 bytes
Desc: not available
URL: <https://pairlist1.pair.net/pipermail/argus/attachments/20090829/09763bf0/attachment.bin>


More information about the argus mailing list