#include "downloads.h"
#include <glib.h>
#include <errno.h>
Go to the source code of this file.
Data Structures | |
struct | dmesh_urlinfo_t |
A download mesh info (describes an URL). More... | |
Enumerations | |
enum | dmesh_url_error_t { DMESH_URL_OK = 0, DMESH_URL_HTTP_PARSER, DMESH_URL_BAD_FILE_PREFIX, DMESH_URL_RESERVED_INDEX, DMESH_URL_NO_FILENAME, DMESH_URL_BAD_ENCODING } |
Error codes from dmesh_url_parse(). More... | |
Functions | |
void | dmesh_init (void) |
Initialize the download mesh. | |
void | dmesh_close (void) |
Called at servent shutdown time. | |
const gchar * | dmesh_url_strerror (dmesh_url_error_t errnum) |
gboolean | dmesh_url_parse (const gchar *url, dmesh_urlinfo_t *info) |
Parse URL `url', and fill a structure `info' representing this URL. | |
gboolean | dmesh_add (gchar *sha1, const host_addr_t addr, guint16 port, guint idx, gchar *name, time_t stamp) |
Same as dmesh_raw_add(), but this is for public consumption. | |
gboolean | dmesh_remove (const gchar *sha1, const host_addr_t addr, guint16 port, guint idx, gchar *name) |
Remove entry from mesh due to a failed download attempt. | |
gint | dmesh_count (const gchar *sha1) |
Get the number of dmesh entries for a given SHA1. | |
gboolean | dmesh_collect_sha1 (const gchar *value, gchar *digest) |
Parse the value of the X-Gnutella-Content-URN header in `value', looking for a SHA1. | |
void | dmesh_collect_locations (gchar *sha1, gchar *value, gboolean defer) |
Parse value of the "X-Gnutella-Alternate-Location" to extract alternate sources for a given SHA1 key. | |
void | dmesh_collect_compact_locations (gchar *sha1, gchar *value) |
Parse the value of the "X-Alt" header to extract alternate sources for a given SHA1 key given in the new compact form. | |
gint | dmesh_fill_alternate (const gchar *sha1, gnet_host_t *hvec, gint hcnt) |
Fill supplied vector `hvec' whose size is `hcnt' with some alternate locations for a given SHA1 key, that can be requested by hash directly. | |
gint | dmesh_alternate_location (const gchar *sha1, gchar *buf, size_t size, const host_addr_t addr, time_t last_sent, const gchar *vendor, fileinfo_t *fi, gboolean request) |
Build alternate location header for a given SHA1 key. | |
void | dmesh_multiple_downloads (gchar *sha1, filesize_t size, fileinfo_t *fi) |
This is called when swarming is first requested to get a list of all the servers with the requested file known by dmesh. | |
void | dmesh_check_results_set (gnet_results_set_t *rs) |
Parse query hit (result set) for entries whose SHA1 match something we have into the mesh or share, and insert them if needed. | |
void | dmesh_store (void) |
Store download mesh onto file. | |
void | dmesh_ban_store (void) |
Store banned mesh onto file. | |
Variables | |
dmesh_url_error_t | dmesh_url_errno |
Error from dmesh_url_parse(). |
|
Error codes from dmesh_url_parse().
|
|
Same as dmesh_raw_add(), but this is for public consumption.
|
|
Build alternate location header for a given SHA1 key. We generate at most `size' bytes of data into `alt'.
|
|
Store banned mesh onto file. The banned mesh is normally stored in ~/.gtk-gnutella/dmesh_ban. |
|
Parse query hit (result set) for entries whose SHA1 match something we have into the mesh or share, and insert them if needed.
|
|
Called at servent shutdown time.
|
|
Parse the value of the "X-Alt" header to extract alternate sources for a given SHA1 key given in the new compact form.
|
|
Parse value of the "X-Gnutella-Alternate-Location" to extract alternate sources for a given SHA1 key.
|
|
Parse the value of the X-Gnutella-Content-URN header in `value', looking for a SHA1. When found, the SHA1 is extracted and placed into the given `digest' buffer.
|
|
Get the number of dmesh entries for a given SHA1.
|
|
Fill supplied vector `hvec' whose size is `hcnt' with some alternate locations for a given SHA1 key, that can be requested by hash directly.
|
|
Initialize the download mesh.
|
|
This is called when swarming is first requested to get a list of all the servers with the requested file known by dmesh. It creates a new download for every server found.
|
|
Remove entry from mesh due to a failed download attempt.
|
|
Store download mesh onto file. The download mesh is normally stored in ~/.gtk-gnutella/dmesh. |
|
Parse URL `url', and fill a structure `info' representing this URL.
|
|
|
|
Error from dmesh_url_parse().
|