|
Data Structures |
| struct | dqhit |
| | Information about query hits received. More...
|
| struct | pmsg_info |
| | Information about query messages sent. More...
|
Defines |
| #define | DH_HALF_LIFE 300 /**< 5 minutes */ |
| | 5 minutes
|
| #define | DH_MIN_HITS 250 /**< Minimum amount of hits we try to relay */ |
| | Minimum amount of hits we try to relay.
|
| #define | DH_POPULAR_HITS 500 /**< Query deemed popular after that many hits */ |
| | Query deemed popular after that many hits.
|
| #define | DH_MAX_HITS 1000 /**< Maximum hits after which we heavily drop */ |
| | Maximum hits after which we heavily drop.
|
| #define | DH_THRESH_HITS 10 /**< Consider we have no hits if less than that */ |
| | Consider we have no hits if less than that.
|
Typedefs |
| typedef dqhit | dqhit_t |
| | Information about query hits received.
|
Enumerations |
| enum | dh_drop { DH_FORWARD = 0,
DH_DROP_FC,
DH_DROP_THROTTLE
} |
| | Drop reasons. More...
|
Functions |
| | RCSID ("$Id:dh.c, v 1.15 2005/08/31 21:37:28 rmanfredi Exp $") |
| gboolean | free_muid_true (gpointer key, gpointer value, gpointer unused_udata) |
| | Hashtable iteration callback to free the MUIDs in the `by_muid' table, and the associated dqhit_t objects.
|
| void | dh_table_clear (GHashTable *ht) |
| | Clear specified hash table.
|
| void | dh_table_free (GHashTable *ht) |
| | Free specified hash table.
|
| dqhit_t * | dh_locate (const gchar *muid) |
| | Locate record for query hits for specified MUID.
|
| dqhit_t * | dh_create (const gchar *muid) |
| | Create new record for query hits for specified MUID.
|
| void | dh_got_results (const gchar *muid, gint count) |
| | Called every time we successfully parsed a query hit from the network.
|
| void | dh_timer (time_t now) |
| | Periodic heartbeat, to rotate the hash tables every half-life period.
|
| void | dh_pmsg_free (pmsg_t *mb, gpointer arg) |
| | Free routine for query hit message.
|
| enum dh_drop | dh_can_forward (dqhit_t *dh, mqueue_t *mq, gboolean test) |
| | Based on the information we have on the query hits we already seen or enqueued, determine whether we're going to drop this message on the floor or forward it.
|
| void | dh_route (gnutella_node_t *src, gnutella_node_t *dest, gint count) |
| | Route query hits from one node to the other.
|
| gboolean | dh_would_route (const gchar *muid, gnutella_node_t *dest) |
| | If we had to route hits to the specified node destination, would we?
|
| void | dh_init (void) |
| | Initialize dynamic hits.
|
| void | dh_close (void) |
| | Cleanup data structures used by dynamic querying.
|
Variables |
| GHashTable * | by_muid = NULL |
| GHashTable * | by_muid_old = NULL |
| time_t | last_rotation |