#include "common.h"
#include "bsched.h"
#include "dmesh.h"
#include "ggep.h"
#include "ggep_type.h"
#include "gmsg.h"
#include "gnutella.h"
#include "nodes.h"
#include "qhit.h"
#include "settings.h"
#include "share.h"
#include "tls_cache.h"
#include "uploads.h"
#include "if/gnet_property_priv.h"
#include "if/core/main.h"
#include "lib/array.h"
#include "lib/getdate.h"
#include "lib/endian.h"
#include "lib/misc.h"
#include "lib/tm.h"
#include "lib/override.h"
Data Structures | |
| struct | found_struct |
Defines | |
| #define | QHIT_SIZE_THRESHOLD 2016 |
| Flush query hits larger than this. | |
| #define | QHIT_MAX_RESULTS 255 |
| Maximum amount of hits in a query hit. | |
| #define | QHIT_MAX_ALT 15 |
| Send out 15 alt-locs per entry, max. | |
| #define | QHIT_MAX_PROXIES 5 |
| Send out 5 push-proxies at most. | |
| #define | QHIT_MAX_GGEP 512 |
| Allocated room for trailing GGEP. | |
| #define | QHIT_MIN_TRAILER_LEN (4+3+16) |
| NAME + open flags + GUID. | |
Functions | |
| found_struct * | found_get (void) |
| size_t | found_file_count (void) |
| size_t | found_max_size (void) |
| void | found_add_files (size_t n) |
| gboolean | found_ggep_h (void) |
| gchar * | found_open (void) |
| void | found_close (size_t len) |
| size_t | found_size (void) |
| size_t | found_left (void) |
| gboolean | found_write (gconstpointer data, size_t length) |
| void | found_set_header (void) |
| void | found_clear (void) |
| void | found_process (void) |
| const struct array * | found_token (void) |
| void | found_init (size_t max_size, const gchar *xuid, gboolean ggep_h, qhit_process_t proc, gpointer udata, const struct array *token) |
| void | qhit_send_node (gpointer data, size_t len, gpointer udata) |
| Processor for query hits sent inbound. | |
| void | flush_match (void) |
| Flush pending search request to the network. | |
| gboolean | add_file (const struct shared_file *sf) |
| Add file to current query hit. | |
| void | found_reset (size_t max_size, const gchar *muid, gboolean ggep_h, qhit_process_t process, gpointer udata, const struct array *token) |
| Reset the QueryHit, that is, the "data found" pointer is at the beginning of the data found section in the query hit packet. | |
| void | qhit_send_results (struct gnutella_node *n, GSList *files, gint count, const gchar *muid, gboolean ggep_h) |
| Send as many small query hit packets as necessary to hold the `count' results held in the `files' list. | |
| void | qhit_build_results (const GSList *files, gint count, size_t max_msgsize, qhit_process_t cb, gpointer udata, const gchar *muid, gboolean ggep_h, const struct array *token) |
| Build query hit results for later delivery. | |
| void | qhit_init (void) |
| Initialization of the query hit generation. | |
| void | qhit_close (void) |
| Shutdown cleanup. | |
Variables | |
| time_t | release_date |
|
|
Send out 15 alt-locs per entry, max.
|
|
|
Allocated room for trailing GGEP.
|
|
|
Send out 5 push-proxies at most.
|
|
|
Maximum amount of hits in a query hit.
|
|
|
NAME + open flags + GUID.
|
|
|
Flush query hits larger than this.
|
|
|
Add file to current query hit.
|
|
|
Flush pending search request to the network.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||||||||||||||
|
Reset the QueryHit, that is, the "data found" pointer is at the beginning of the data found section in the query hit packet.
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||
|
Build query hit results for later delivery. Results are held in the `files' list. They are packed in hits until the message reaches the `max_msgsize' limit at which time the packet is flushed and given the the `cb' callback for processing (sending, queueing, whatever). The callback is invoked as cb(data, len, udata) where the query hit message is held in the `len' bytes starting at `data'. The `udata' parameter is simply user-supplied data, opaque for us.
|
|
|
Shutdown cleanup.
|
|
|
Initialization of the query hit generation.
|
|
||||||||||||||||
|
Processor for query hits sent inbound.
|
|
||||||||||||||||||||||||
|
Send as many small query hit packets as necessary to hold the `count' results held in the `files' list.
|
|
|
|
1.3.9.1