addded cvs id tags
authorPhilip Kovacs <pkovacs@users.sourceforge.net>
Wed, 9 Nov 2005 02:01:10 +0000 (02:01 +0000)
committerPhilip Kovacs <pkovacs@users.sourceforge.net>
Wed, 9 Nov 2005 02:01:10 +0000 (02:01 +0000)
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@380 7f574dfc-610e-0410-a909-a81674777703

src/hash.c
src/hash.h
src/libtcp-portmon.c
src/libtcp-portmon.h

index a773b73..e404e11 100644 (file)
@@ -1,3 +1,19 @@
+/* ------------------------------------------------------
+ * Open-addressed hash using double hash probing
+ *
+ * for i in 0 to m-1: 
+ *      h(k, i) = ( h1(k) + i*h2(k) ) mod m 
+ *
+ * requires: 1) m must be a power of two
+ *           2) h2(k) must return an odd number
+ *
+ * Besed on code published in _Mastering Algorithms in C_
+ * by Kyle Loudon (O'Reilly 1999).
+ * Modified by Philip Kovacs (kovacsp3@comcast.net)
+ * 
+ * $Id$
+ * ------------------------------------------------------ */
+
 #ifdef HASH_DEBUG
 #include <stdio.h>
 #endif
index 930851c..55e78ea 100644 (file)
@@ -1,6 +1,3 @@
-#ifndef HASH_H
-#define HASH_H
-
 /* ------------------------------------------------------
  * Open-addressed hash using double hash probing
  *
  * Besed on code published in _Mastering Algorithms in C_
  * by Kyle Loudon (O'Reilly 1999).
  * Modified by Philip Kovacs (kovacsp3@comcast.net)
+ * 
+ * $Id$
  * ------------------------------------------------------ */
 
+#ifndef HASH_H
+#define HASH_H
+
 typedef struct _hash_table_t {
        int     positions;
        int     size;
index f9b801b..9a13fc5 100644 (file)
@@ -2,6 +2,8 @@
  * libtcp-portmon.c:  tcp port monitoring library.               
  *
  * Copyright (C) 2005  Philip Kovacs kovacsp3@comcast.net
+ * 
+ * $Id$
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -425,7 +427,7 @@ void show_connection_to_tcp_port_monitor(
         * connection limit.  Future versions should probably allow the client to set the hash size
         * and load limits and/or provide for automatic resizing of hashes. */
 
-       if ( (double)p_monitor->hash.size / (double)p_monitor->hash.positions > TCP_CONNECTION_HASH_MAX_LOAD_PCT )
+       if ( (double)p_monitor->hash.size / (double)p_monitor->hash.positions >= TCP_CONNECTION_HASH_MAX_LOAD_PCT )
        {
                /* hash exceeds our load limit is now "full" */
                return;
index 341e39c..56cc207 100644 (file)
@@ -3,6 +3,8 @@
  *
  * Copyright (C) 2005  Philip Kovacs kovacsp3@comcast.net
  *
+ * $Id$
+ * 
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either