Raphael Manfredi
#include "common.h"
#include "bh_upload.h"
#include "share.h"
#include "bsched.h"
#include "tx.h"
#include "tx_link.h"
#include "tx_chunk.h"
#include "tx_deflate.h"
#include "qhit.h"
#include "gmsg.h"
#include "guid.h"
#include "version.h"
#include "if/gnet_property.h"
#include "if/gnet_property_priv.h"
#include "lib/header.h"
#include "lib/misc.h"
#include "lib/url.h"
#include "lib/walloc.h"
#include "lib/override.h"
Data Structures | |
struct | browse_host_ctx |
Defines | |
#define | BH_MAX_QHIT_SIZE 3500 /**< Flush hits larger than this */ |
Flush hits larger than this. | |
#define | BH_SCAN_AHEAD 100 /**< Amount of files scanned ahead */ |
Amount of files scanned ahead. | |
#define | BH_BUFSIZ 16384 /**< Buffer size for TX deflation */ |
Buffer size for TX deflation. | |
Enumerations | |
enum | bh_state { BH_STATE_HEADER = 0, BH_STATE_LIBRARY_INFO, BH_STATE_FILES, BH_STATE_REBUILDING, BH_STATE_TRAILER, BH_STATE_EOF, NUM_BH_STATES } |
enum | bh_type { BH_TYPE_HTML = 0, BH_TYPE_QHIT } |
Functions | |
RCSID ("$Id:bh_upload.c, v 1.21 2006/01/01 19:09:02 rmanfredi Exp $") | |
size_t | browse_host_read_data (struct browse_host_ctx *bh, gchar *dest, size_t *size) |
Copies up to ``*size'' bytes from current data block (bh->b_data + bh->b_offset) to the buffer ``dest''. | |
void | browse_host_next_state (struct browse_host_ctx *bh, enum bh_state state) |
Sets the state of the browse host context to ``state'' and resets the data block variables. | |
ssize_t | browse_host_read_html (gpointer ctx, gpointer const dest, size_t size) |
Writes the browse host data of the context ``ctx'' to the buffer ``dest''. | |
void | browse_host_record_hit (gpointer data, size_t len, gpointer udata) |
Enqueue query hit built by creating a message. | |
ssize_t | browse_host_read_qhits (gpointer ctx, gpointer const dest, size_t size) |
Writes the browse host data of the context ``ctx'' to the buffer ``dest''. | |
ssize_t | browse_host_write (gpointer ctx, gpointer data, size_t size) |
Write data to the TX stack. | |
void | browse_tx_flushed (txdrv_t *unused_tx, gpointer arg) |
Callback invoked when the TX stack is fully flushed. | |
void | browse_host_flush (gpointer ctx, bh_closed_t cb, gpointer arg) |
Flush the TX stack, invoking callback when it's done. | |
void | browse_host_close (gpointer ctx, gboolean fully_served) |
Closes the browse host context and releases its memory. | |
special_ctx * | browse_host_open (gpointer owner, gnet_host_t *host, bh_writable_t writable, struct tx_deflate_cb *deflate_cb, struct tx_link_cb *link_cb, wrap_io_t *wio, gint flags) |
Creates a new browse host context. |
|
Buffer size for TX deflation.
|
|
Flush hits larger than this. Therefore, don't generate too large ones or they might be dropped by the recipient. Still, we need a large size to avoid generating too many useless Gnutella headers and query hit trailers (like push proxies, our GUID, etc...). |
|
Amount of files scanned ahead.
|
|
|
|
|
|
Closes the browse host context and releases its memory.
|
|
Flush the TX stack, invoking callback when it's done.
|
|
Sets the state of the browse host context to ``state'' and resets the data block variables.
|
|
Creates a new browse host context. The context must be freed with browse_host_close().
|
|
Copies up to ``*size'' bytes from current data block (bh->b_data + bh->b_offset) to the buffer ``dest''.
|
|
Writes the browse host data of the context ``ctx'' to the buffer ``dest''. This must be called multiple times to retrieve the complete data until zero is returned i.e., the end of file is reached. This routine deals with HTML data generation.
|
|
Writes the browse host data of the context ``ctx'' to the buffer ``dest''. This must be called multiple times to retrieve the complete data until zero is returned i.e., the end of file is reached. This routine deals with query hit data generation.
|
|
Enqueue query hit built by creating a message. Callback for qhit_build_results(). |
|
Write data to the TX stack.
|
|
Callback invoked when the TX stack is fully flushed.
|
|
|