- /* The monitor gets to look at each connection to see if it falls within
- * the monitor's port range of interest. Connections of interest are first
- * looked up in the hash to see if they are already there. If they are, we
- * reset the age of the connection so it is not deleted. If the connection
- * is not in the hash, we add it, but only if we haven't exceeded the maximum
- * connection limit for the monitor. The function takes O(1) time. */
-
- tcp_connection_node_t *p_node;
- tcp_connection_t *p_connection, *p_conn_hash;
-
- if ( !p_monitor || !p_void )
- return;
-
- /* This p_connection is on caller's stack and not the heap. If we are interested,
- * we will create a copy of the connection (on the heap) and add it to our list. */
- p_connection = (tcp_connection_t *)p_void;
-
- /* inspect the local port number of the connection to see if we're interested. */
- if ( (p_monitor->port_range_begin <= p_connection->local_port) &&
- (p_connection->local_port <= p_monitor->port_range_end) )
- {
- /* the connection is in the range of the monitor. */
-
- /* first check the hash to see if the connection is already there. */
- if ( (p_conn_hash = g_hash_table_lookup (p_monitor->hash, (gconstpointer)p_connection->key)) )
- {
- /* it's already in the hash. reset the age of the connection. */
- p_conn_hash->age = TCP_CONNECTION_STARTING_AGE;
-
- return;
- }
-
- /* Connection is not yet in the hash. Add it if max_connections not exceeded. */
- if (g_hash_table_size (p_monitor->hash) >= p_monitor->max_port_monitor_connections)
- return;
-
- /* create a new connection node */
- if ( (p_node = (tcp_connection_node_t *) calloc(1, sizeof(tcp_connection_node_t))) == NULL )
- return;
-
- /* copy the connection data */
- if ( copy_tcp_connection( &p_node->connection, p_connection ) != 0 )
- {
- /* error copying the connection data. deallocate p_node to avoid leaks and return. */
- free( p_node );
+ /* The monitor gets to look at each connection to see if it falls within
+ * the monitor's port range of interest. Connections of interest are first
+ * looked up in the hash to see if they are already there. If they are, we
+ * reset the age of the connection so it is not deleted. If the connection
+ * is not in the hash, we add it, but only if we haven't exceeded the
+ * maximum connection limit for the monitor.
+ * The function takes O(1) time. */
+
+ tcp_connection_node_t *p_node;
+ tcp_connection_t *p_connection, *p_conn_hash;
+
+ if (!p_monitor || !p_void) {