Re: [Nagios-devel] Hashing, take 2

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] Hashing, take 2

Post by Guest »

This is a multi-part message in MIME format.
--------------050509040002000208050507
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

And for the 1 millionth time I've forgotten to attach. This calls for
celebration! ;)

Here it is anyways. Apply with patch -p1

Andreas Ericsson wrote:
> I've decided to drop the massive hashing code changes I submitted last
> time. This new patch is minimally intrusive and seems to work nicely. I
> haven't tested this in production very much, but it seems sound enough
> (cgi's run OK from command-line, nagios -v has no problems).
>
> This is much less intrusive. Please test/use this patch instead.
>

--
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Lead Developer

--------------050509040002000208050507
Content-Type: text/plain;
name="nagios-hash-drop_in.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="nagios-hash-drop_in.diff"

diff -urN ../nagios.orig/base/utils.c ./base/utils.c
--- ../nagios.orig/base/utils.c 2005-06-13 14:41:57 +0200
+++ ./base/utils.c 2005-06-29 00:00:30 +0200
@@ -32,7 +32,7 @@
#include "../include/broker.h"
#include "../include/nebmods.h"
#include "../include/nebmodules.h"
-
+#include "../include/hash.h"

#ifdef EMBEDDEDPERL
#include "../include/epn_nagios.h"
@@ -4245,68 +4245,6 @@
}


-
-/******************************************************************/
-/************************* HASH FUNCTIONS *************************/
-/******************************************************************/
-
-/* single hash function */
-int hashfunc1(const char *name1,int hashslots){
- unsigned int i,result;
-
- result=0;
-
- if(name1)
- for(i=0;i0)
- return 1;
- else if(result<0)
- return -1;
- else
- return strcmp(val1b,val2b);
- }
-
-
-
/******************************************************************/
/************************* FILE FUNCTIONS *************************/
/******************************************************************/
diff -urN ../nagios.orig/cgi/cgiutils.c ./cgi/cgiutils.c
--- ../nagios.orig/cgi/cgiutils.c 2004-11-15 09:28:06 +0100
+++ ./cgi/cgiutils.c 2005-06-29 00:09:51 +0200
@@ -27,6 +27,7 @@
#include "../include/locations.h"
#include "../include/objects.h"
#include "../include/statusdata.h"
+#include "../include/hash.h"

#include "../include/cgiutils.h"

@@ -679,71 +680,6 @@
}


-
-/**********************************************************
- *************** CHAINED HASH FUNCTIONS *******************
- **********************************************************/
-
-
-/* single hash function */
-int hashfunc1(const char *name1,int hashslots){
- unsigned int i,result;
-
- result=0;
-
- if(name1)
- for(i=0;i<strlen(name1);i++)
- result+=name1;
-
- result=result%hashslots;
-
- return result;
- }
-
-
-/* dual hash function */
-int hashfunc2(const char *name1,const char *name2,int hashslots){
- unsigned int i,result;
-
- result=0;
- if(name1)
- for(i=0;i<strlen(name1);i++)
- result+=name1;
-
- if(name2)
- for(i=0;i<strlen(name2);i++)
- result+=name2;
-
- result=result%hashslots;
-
- return result;
- }
-
-
-/* single hash data comparison */
-int compare_hashdata1(const char *val1, const char *val2){
-
- return strcmp(val1,val2);
-

...[email truncated]...


This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked