|
Data Structures |
| struct | dl_addr |
| | Keys in the `dl_by_addr' table. More...
|
| struct | download_request |
| struct | server_select |
Defines |
| #define | DOWNLOAD_FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP) |
| #define | DOWNLOAD_MIN_OVERLAP 64 |
| | Minimum overlap for safety.
|
| #define | DOWNLOAD_SHORT_DELAY 2 |
| | Shortest retry delay.
|
| #define | DOWNLOAD_MAX_SINK 16384 |
| | Max amount of data to sink.
|
| #define | DOWNLOAD_MAX_IGN_DATA 2097152 |
| | Max amount of data to ignore.
|
| #define | DOWNLOAD_MAX_IGN_TIME 300 |
| | Max amount of secs we can ignore.
|
| #define | DOWNLOAD_MAX_IGN_REQS 3 |
| | How many mismatches per source.
|
| #define | DOWNLOAD_SERVER_HOLD 15 |
| | Space requests to same server.
|
| #define | DOWNLOAD_DNS_LOOKUP 7200 |
| | Period of server DNS lookups.
|
| #define | DOWNLOAD_STALLED 60 |
| | Consider stalled after 60 secs.
|
| #define | DOWNLOAD_PING_DELAY 300 |
| | Minimum delay for 2 HEAD pings.
|
| #define | DOWNLOAD_MAX_HEADER_EOF 5 |
| | Max # of EOF in headers we allow.
|
| #define | DOWNLOAD_DATA_TIMEOUT 5 |
| | Max # of data timeouts we allow.
|
| #define | IO_AVG_RATE 5 |
| | Compute global recv rate every 5 secs.
|
| #define | DHASH_SIZE (1UL << 10) |
| | Hash list size, must be a power of 2.
|
| #define | DHASH_MASK (DHASH_SIZE - 1) |
| #define | DL_HASH(x) ((x) & DHASH_MASK) |
| #define | MAGIC_TIME 1 |
| | For recreation upon starup.
|
Functions |
| void | download_add_to_list (struct download *d, enum dl_list idx) |
| gboolean | download_send_push_request (struct download *d) |
| | Send a push request to the target GUID, in order to request the push of the file whose index is `file_id' there onto our local port `port'.
|
| gboolean | download_read (struct download *d, pmsg_t *mb) |
| | Read callback for file data from the RX stack.
|
| gboolean | download_ignore_data (struct download *d, pmsg_t *mb) |
| | Read callback for file data from the RX stack, used when we ignore those data after a failed resuming check.
|
| void | download_request (struct download *d, header_t *header, gboolean ok) |
| | Called to initiate the download once all the HTTP headers have been read.
|
| void | download_push_ready (struct download *d, getline_t *empty) |
| | Send download request on the opened connection.
|
| void | download_push_remove (struct download *d) |
| | Forget that we sent a push request for this download.
|
| void | download_push (struct download *d, gboolean on_timeout) |
| void | download_resume_bg_tasks (void) |
| | Go through the downloads and check the completed ones that should be either moved to the "done" directory, or which should have their SHA1 computed/verified.
|
| void | download_incomplete_header (struct download *d) |
| | Called when header reading times out.
|
| gboolean | has_blank_guid (const struct download *d) |
| void | download_verify_sha1 (struct download *d) |
| | Main entry point for verifying the SHA1 of a completed download.
|
| gboolean | download_get_server_name (struct download *d, header_t *header) |
| | Extract server name from headers.
|
| gboolean | use_push_proxy (struct download *d) |
| | Try to setup the download to use the push proxies available on the server.
|
| void | download_unavailable (struct download *d, download_status_t new_status, const gchar *reason,...) G_GNUC_PRINTF(3 |
| | Like download_stop(), but flag the download as "unavailable".
|
| void | download_queue_delay (struct download *d, guint32 delay, const gchar *fmt,...) G_GNUC_PRINTF(3 |
| | Put download back to queue, but don't reconsider it for starting before the next `delay' seconds.
|
| void | download_queue_hold (struct download *d, guint32 hold, const gchar *fmt,...) G_GNUC_PRINTF(3 |
| | Same as download_queue_delay(), but make sure we don't consider scheduling any currently queued download to this server before the holding delay.
|
| void | download_reparent (struct download *d, struct dl_server *new_server) |
| | Move download from a server to another one.
|
| gboolean | download_flush (struct download *d, gboolean *trimmed, gboolean may_stop) |
| | Flush buffered data to disk.
|
| void | download_store (void) |
| | Store all pending downloads.
|
| void | download_retrieve (void) |
| | Retrieve download list and requeue each download.
|
| const gchar * | download_pathname (const struct download *d) |
| const gchar * | download_basename (const struct download *d) |
| guint | count_running_downloads (void) |
| guint | server_list_length (const struct dl_server *server, enum dl_list idx) |
| guint | count_running_on_server (const struct dl_server *server) |
| void | src_init (void) |
| void | src_close (void) |
| void | src_add_listener (src_listener_t cb, gnet_src_ev_t ev, frequency_t t, guint32 interval) |
| void | src_remove_listener (src_listener_t cb, gnet_src_ev_t ev) |
| download * | src_get_download (gnet_src_t src_handle) |
| | G_GNUC_PRINTF (2, 3) |
| void | download_rx_got_eof (gpointer o) |
| gboolean | download_data_ind (rxdrv_t *rx, pmsg_t *mb) |
| | RX data indication callback used to give us some new download traffic in a low-level message structure.
|
| gboolean | download_ignore_data_ind (rxdrv_t *rx, pmsg_t *mb) |
| | RX data indication callback used to give us some new download traffic in a low-level message structure.
|
| void | download_chunk_rx_done (gpointer o) |
| void | download_write (struct download *d, gpointer data, size_t len) |
| | Received data from outside the RX stack.
|
| download * | download_alloc (void) |
| | The only place to allocate a struct download.
|
| void | download_free (struct download **d_ptr) |
| | The only place to release a struct download.
|
| guint | dl_key_hash (gconstpointer key) |
| | Hashing of a `dl_key' structure.
|
| gint | dl_key_eq (gconstpointer a, gconstpointer b) |
| | Comparison of `dl_key' structures.
|
| guint | dl_addr_hash (gconstpointer key) |
| | Hashing of a `dl_addr' structure.
|
| gint | dl_addr_eq (gconstpointer a, gconstpointer b) |
| | Comparison of `dl_addr' structures.
|
| gint | dl_retry_cmp (gconstpointer p, gconstpointer q) |
| | Compare two `download' structures based on the `retry_after' field.
|
| gint | dl_server_retry_cmp (gconstpointer p, gconstpointer q) |
| | Compare two `dl_server' structures based on the `retry_after' field.
|
| gboolean | download_has_blank_guid (const struct download *d) |
| gboolean | is_faked_download (const struct download *d) |
| gboolean | has_good_sha1 (const struct download *d) |
| | Was downloaded file verified to have a SHA1 matching the advertised one?
|
| void | download_update_timeout_delay (struct download *d) |
| | Sets proper timeout delay, with exponential back-off and min/max enforcement.
|
| void | download_retry (struct download *d) |
| | Called to request retry of a download after a timeout, with exponential back-off timeout delay, up to a maximum.
|
| gdouble | download_total_progress (const struct download *d) |
| | Return the total progress of a download.
|
| gdouble | download_source_progress (const struct download *d) |
| | Return the total progress of a download source.
|
| void | download_init (void) |
| | Initialize downloading data structures.
|
| void | download_restore_state (void) |
| | Initialize downloading data structures.
|
| void | buffers_alloc (struct download *d) |
| | Allocate a set of buffers for data reception.
|
| void | buffers_free_item (gpointer data, gpointer unused_udata) |
| void | buffers_free (struct download *d) |
| | Dispose of the buffers used for reading.
|
| void | buffers_reset_reading (struct download *d) |
| | Reset the I/O vector for reading from the start.
|
| iovec * | buffers_to_iovec (struct download *d, gint *iov_cnt) |
| | Reset the I/O vector for writing the whole data held in the buffer.
|
| void | buffers_discard (struct download *d) |
| | Discard all read data from buffers.
|
| gboolean | buffers_full (const struct download *d) |
| | Check whether reception buffers are full.
|
| gboolean | buffers_should_flush (const struct download *d) |
| | Check whether we should request flushing of the buffered data.
|
| void | buffers_add_read (struct download *d, pmsg_t *mb) |
| | Update the buffer structure after having read "amount" more bytes: prepare `iovcnt' for the next read and increase the amount of data held.
|
| gboolean | buffers_match (const struct download *d, const gchar *data, size_t len) |
| | Compare data held in the read buffers with the data chunk supplied.
|
| void | buffers_strip_leading (struct download *d, size_t amount) |
| | Strip leading `amount' bytes from the read buffers.
|
| void | buffers_check_held (const struct download *d) |
| void | buffers_strip_trailing (struct download *d, size_t amount) |
| | Strip trailing `amount' bytes from the read buffers.
|
| void | download_timer (time_t now) |
| | Download heartbeat timer.
|
| void | dl_by_time_insert (struct dl_server *server) |
| | Insert server by retry time into the `dl_by_time' structure.
|
| void | dl_by_time_remove (struct dl_server *server) |
| | Remove server from the `dl_by_time' structure.
|
| GSList * | hostvec_to_slist (const gnet_host_vec_t *vec) |
| | Convert a vector of host to a single-linked list.
|
| void | free_proxies (struct dl_server *server) |
| | Get rid of the list of push proxies held in the server.
|
| void | remove_proxy (struct dl_server *server, const host_addr_t addr, guint16 port) |
| | Remove push proxy from server.
|
| dl_server * | allocate_server (const gchar *guid, const host_addr_t addr, guint16 port) |
| | Allocate new server structure.
|
| void | server_list_free_all (struct dl_server *server) |
| void | free_server (struct dl_server *server) |
| | Free server structure.
|
| void | server_delay_delete (struct dl_server *server) |
| | Marks server for delayed removal (via asynchronous timer).
|
| void | server_undelete (struct dl_server *server) |
| | Resurrect server pending deletion.
|
| dl_server * | get_server (const gchar *guid, const host_addr_t addr, guint16 port, gboolean allocate) |
| | Fetch server entry identified by IP:port first, then GUID+IP:port.
|
| void | change_server_addr (struct dl_server *server, const host_addr_t new_addr) |
| | The server address changed.
|
| void | set_server_hostname (struct dl_server *server, const gchar *hostname) |
| | Set/change the server's hostname.
|
| gboolean | download_server_nopush (const gchar *guid, const host_addr_t addr, guint16 port) |
| | Check whether we can safely ignore Push indication for this server, identified by its GUID, IP and port.
|
| guint | count_running_downloads_with_name (const char *name) |
| | How many downloads with same filename are running (active or establishing)?
|
| void | downloads_with_name_inc (const gchar *name) |
| | Add one to the amount of downloads running and bearing the filename.
|
| void | downloads_with_name_dec (const gchar *name) |
| | Remove one from the amount of downloads running and bearing the filename.
|
| const struct sha1 * | download_get_sha1 (const struct download *d) |
| void | server_sha1_count_inc (struct dl_server *server, struct download *d) |
| void | server_sha1_count_dec (struct dl_server *server, struct download *d) |
| gboolean | download_eq (gconstpointer p, gconstpointer q) |
| download * | server_list_lookup (const struct dl_server *server, enum dl_list idx, const struct sha1 *sha1, const gchar *file, filesize_t size) |
| list_t * | server_list_by_index (struct dl_server *server, enum dl_list idx) |
| void | server_list_insert_download_sorted (struct dl_server *server, enum dl_list idx, struct download *d) |
| void | server_list_append_download (struct dl_server *server, enum dl_list idx, struct download *d) |
| void | server_list_prepend_download (struct dl_server *server, enum dl_list idx, struct download *d) |
| download * | server_list_head (struct dl_server *server, enum dl_list idx) |
| void | server_list_remove_download (struct dl_server *server, enum dl_list idx, struct download *d) |
| download * | has_same_download (const gchar *file, const struct sha1 *sha1, filesize_t size, const gchar *guid, const host_addr_t addr, guint16 port) |
| | Check whether we already have an identical (same file, same SHA1, same host) running or queued download.
|
| gboolean | download_has_enough_active_sources (struct download *d) |
| void | download_actively_queued (struct download *d, gboolean queued) |
| | Mark a download as being actively queued.
|
| void | download_passively_queued (struct download *d, gboolean queued) |
| | Mark download as being passively queued.
|
| gboolean | download_file_exists (const struct download *d) |
| void | download_remove_file (struct download *d, gboolean reset) |
| | Remove temporary download file.
|
| void | download_info_change_all (fileinfo_t *old_fi, fileinfo_t *new_fi) |
| | Change all the fileinfo of downloads from `old_fi' to `new_fi'.
|
| void | download_info_reget (struct download *d) |
| | Invalidate improper fileinfo for the download, and get new one.
|
| void | queue_suspend_downloads_with_file (fileinfo_t *fi, gboolean suspend) |
| | Mark all downloads that point to the file_info struct as "suspended" if `suspend' is TRUE, or clear that mark if FALSE.
|
| void | queue_remove_downloads_with_file (fileinfo_t *fi, struct download *skip) |
| | Removes all downloads that point to the file_info struct.
|
| gint | download_remove_all_from_peer (const gchar *guid, const host_addr_t addr, guint16 port, gboolean unavailable) |
| | Remove all downloads to a given peer from the download queue and abort all connections to peer in the active download list.
|
| gint | download_remove_all_named (const gchar *name) |
| | Remove all downloads with a given name from the download queue and abort all connections to peer in the active download list.
|
| gint | download_remove_all_with_sha1 (const struct sha1 *sha1) |
| | remove all downloads with a given sha1 hash from the download queue and abort all conenctions to peer in the active download list.
|
| void | download_remove_all_thex (const struct sha1 *sha1) |
| | Remove all THEX downloads for a given sha1.
|
| void | download_set_socket_rx_size (gint rx_size) |
| | Change the socket RX buffer size for all the currently connected downloads.
|
| void | download_set_sha1 (struct download *d, const struct sha1 *sha1) |
| void | download_clear_stopped (gboolean complete, gboolean failed, gboolean unavailable, gboolean now) |
| | [GUI] Remove stopped downloads.
|
| void | download_move_to_list (struct download *d, enum dl_list idx) |
| | Move download from its current list to the `idx' one.
|
| void | download_server_retry_after (struct dl_server *server, time_t now, gint hold) |
| | Change the `retry_after' field of the host where this download runs.
|
| void | download_reclaim_server (struct download *d, gboolean delayed) |
| | Reclaim download's server if it is no longer holding anything.
|
| void | download_remove_from_server (struct download *d, gboolean reclaim) |
| | Remove download from server.
|
| void | download_redirect_to_server (struct download *d, const host_addr_t addr, guint16 port) |
| | Move download from a server to another when the IP:port changed due to a Location: redirection for instance, or because of a QUEUE callback.
|
| void | download_stop_v (struct download *d, download_status_t new_status, const gchar *reason, va_list ap) |
| | Vectorized version common to download_stop() and download_unavailable().
|
| void | download_stop (struct download *d, download_status_t new_status, const gchar *reason,...) |
| | Stop an active download, close its socket and its data file descriptor.
|
| void | download_queue_v (struct download *d, const gchar *fmt, va_list ap) |
| | The vectorized (message-wise) version of download_queue().
|
| void | download_queue (struct download *d, const gchar *fmt,...) |
| | Put download into queue.
|
| void | download_freeze_queue (void) |
| | Freeze the scheduling queue.
|
| void | download_thaw_queue (void) |
| | Thaw the scheduling queue.
|
| gboolean | download_queue_is_frozen (void) |
| | Test whether download queue is frozen.
|
| void | download_queue_hold_delay_v (struct download *d, gint delay, time_t hold, const gchar *fmt, va_list ap) |
| | Common vectorized code for download_queue_delay() and download_queue_hold().
|
| void | download_push_insert (struct download *d) |
| | Record that we sent a push request for this download.
|
| void | download_send_head_ping (struct download *d) |
| | Send a HEAD Ping vendor message to node to get alternate sources via UDP since we're not going to issue an HTTP request right now.
|
| void | download_list_send_head_ping (list_t *list) |
| | Send a HEAD Ping to all the downloads in the list.
|
| gboolean | download_ignore_requested (struct download *d) |
| | Check whether download should be ignored, and stop it immediately if it is.
|
| void | download_unqueue (struct download *d) |
| | Remove download from queue.
|
| gboolean | download_start_prepare_running (struct download *d) |
| | Setup the download structure with proper range offset, and check that the download is not otherwise completed.
|
| gboolean | download_start_prepare (struct download *d) |
| | Make download a "running" one (in running list, unqueued), then call download_start_prepare_running().
|
| gboolean | download_pick_chunk (struct download *d) |
| | Called for swarming downloads when we are connected to the remote server, but before making the request, to pick up a chunk for downloading.
|
| gboolean | download_pick_available (struct download *d) |
| | Pickup a range we don't have yet from the available ranges.
|
| void | download_bad_source (struct download *d) |
| | Indicates that this download source is not good enough for us: it is either non-connectible, does not allow resuming, etc...
|
| gnutella_socket * | download_connect (struct download *d) |
| | Establish asynchronous connection to remote server.
|
| void | download_start (struct download *d, gboolean check_allowed) |
| | (Re)start a stopped or queued download.
|
| void | download_pause (struct download *d) |
| | Pause a download.
|
| void | download_pickup_queued (void) |
| | Pick up new downloads from the queue as needed.
|
| void | download_fallback_to_push (struct download *d, gboolean on_timeout, gboolean user_request) |
| | Direct download failed, let's try it with a push request.
|
| const gchar * | download_escape_name (const gchar *name) |
| guint32 | get_index_from_uri (const gchar *uri) |
| download * | create_download (const gchar *file_name, const gchar *uri, filesize_t size, const host_addr_t addr, guint16 port, const gchar *guid, const gchar *hostname, const struct sha1 *sha1, time_t stamp, fileinfo_t *file_info, const gnet_host_vec_t *proxies, guint32 cflags, const gchar *parq_id) |
| | Create a new download.
|
| void | download_auto_new (const gchar *file_name, filesize_t size, const host_addr_t addr, guint16 port, const gchar *guid, const gchar *hostname, const struct sha1 *sha1, time_t stamp, fileinfo_t *fi, gnet_host_vec_t *proxies, guint32 flags) |
| | Automatic download request.
|
| download * | download_clone (struct download *d) |
| | Clone download, resetting most dynamically allocated structures in the original since they are shallow-copied to the new download.
|
| void | download_index_changed (const host_addr_t addr, guint16 port, const gchar *guid, guint32 from, guint32 to) |
| | Search has detected index change in queued download.
|
| download_request * | download_request_new (const gchar *filename, const gchar *uri, filesize_t size, host_addr_t addr, guint16 port, const gchar *guid, const gchar *hostname, const struct sha1 *sha1, time_t stamp, fileinfo_t *fi, guint32 flags, const gnet_host_vec_t *proxies, const gchar *parq_id) |
| void | download_request_free (struct download_request **req_ptr) |
| void | download_new_by_hostname_helper (const host_addr_t *addrs, size_t n, gpointer user_data) |
| | Called when we got a reply from the ADNS process.
|
| void | download_new_by_hostname (struct download_request *req) |
| gboolean | download_new (const gchar *filename, const gchar *uri, filesize_t size, const host_addr_t addr, guint16 port, const gchar *guid, const gchar *hostname, const struct sha1 *sha1, time_t stamp, fileinfo_t *fi, const gnet_host_vec_t *proxies, guint32 flags, const gchar *parq_id) |
| | Create a new download, usually called from an interactive user action.
|
| void | download_orphan_new (const gchar *filename, filesize_t size, const struct sha1 *sha1, fileinfo_t *fi) |
| | Fake a new download for an existing file that is marked complete in its fileinfo trailer.
|
| void | download_free_removed (void) |
| | Free all downloads listed in the `sl_removed' list.
|
| gboolean | download_remove (struct download *d) |
| | Freeing a download cannot be done simply, because it might happen when we are traversing the `sl_downloads' or `sl_unqueued' lists.
|
| void | download_forget (struct download *d, gboolean unavailable) |
| | Forget about download: stop it if running.
|
| void | download_abort (struct download *d) |
| | Abort download (forget about it) AND delete file if we removed the last reference to it and they want to delete on abort.
|
| void | download_resume (struct download *d) |
| void | download_requeue (struct download *d) |
| | Explicitly re-enqueue potentially stopped download.
|
| void | download_proxy_newstate (struct download *d) |
| | Called when the status of the HTTP request made by the client push-proxy code changes.
|
| void | download_proxy_sent (struct download *d) |
| | Called by client push-proxy side when we got indication that the PUSH has been sent.
|
| void | download_proxy_failed (struct download *d) |
| | Called by client push-proxy side to indicate that it could not send a PUSH.
|
| gboolean | send_udp_push (const struct array packet, host_addr_t addr, guint16 port) |
| download * | cast_to_download (gpointer p) |
| void | err_line_too_long (gpointer o) |
| void | err_header_error (gpointer o, gint error) |
| void | err_input_buffer_full (gpointer o) |
| void | err_header_read_error (gpointer o, gint error) |
| void | err_header_read_eof (gpointer o) |
| void | download_start_reading (gpointer o) |
| void | call_download_request (gpointer o, header_t *header) |
| void | call_download_push_ready (gpointer o, header_t *unused_header) |
| gboolean | download_can_ignore (struct download *d) |
| | See whether we can ignore the data from now on, keeping the connection open and sinking to /dev/null: the idea is that we keep the slot busy to get a chance to re-issue another request later.
|
| void | download_backout (struct download *d) |
| | Forget that we ever downloaded some bytes when there was a resuming mismatch at some point.
|
| gboolean | download_overlap_check (struct download *d) |
| | Check that the leading overlapping data in the read buffers match with the last ones in the downloaded file.
|
| void | download_continue (struct download *d, gboolean trimmed) |
| | Called when a chunk has been fully received but the file is still incomplete and more data is to be fetched.
|
| gboolean | download_write_data (struct download *d) |
| | Write data in socket buffer to file.
|
| gboolean | download_moved_permanently (struct download *d, header_t *header) |
| | Refresh IP:port, download index and name, by looking at the new location in the header ("Location:").
|
| gboolean | download_check_status (struct download *d, getline_t *line, gint code) |
| | Check status code from status line.
|
| gboolean | download_convert_to_urires (struct download *d) |
| | Convert download to /uri-res/N2R? request.
|
| guint | extract_retry_after (struct download *d, const header_t *header) |
| | Extract Retry-After delay from header, returning 0 if none.
|
| void | download_handle_thex_uri_header (struct download *d, header_t *header) |
| void | check_date (const header_t *header, const host_addr_t addr, struct download *d) |
| | Look for a Date: header in the reply and use it to update our skew.
|
| void | check_xhostname (struct download *d, const header_t *header) |
| | Look for an X-Hostname header in the reply.
|
| void | check_xhost (struct download *d, const header_t *header) |
| | Look for an X-Host header in the reply.
|
| gboolean | content_range_check (struct download *d, header_t *header) |
| gboolean | handle_content_urn (struct download *d, header_t *header) |
| | Handle X-Gnutella-Content-URN header.
|
| void | check_push_proxies (struct download *d, header_t *header) |
| | Extract host:port information out of X-Push-Proxy if present and update the server's list.
|
| void | update_available_ranges (struct download *d, header_t *header) |
| | Partial File Sharing Protocol (PFSP) -- client-side.
|
| void | download_sink (struct download *d) |
| | Sink read data.
|
| void | download_sink_read (gpointer data, gint unused_source, inputevt_cond_t unused_cond) |
| | Read callback for file data.
|
| const gchar * | lazy_ack_message_to_ui_string (const gchar *src) |
| void | download_mark_active (struct download *d) |
| | Mark download as receiving data: download is becoming active.
|
| gboolean | is_dumb_spammer (const gchar *user_agent) |
| | Checks whether the contents of a User-Agent or Server header match the signature of a dumb spammer.
|
| void | download_request_sent (struct download *d) |
| | Called when the whole HTTP request has been sent out.
|
| void | download_write_request (gpointer data, gint unused_source, inputevt_cond_t cond) |
| | I/O callback invoked when we can write more data to the server to finish sending the HTTP request.
|
| void | download_send_request (struct download *d) |
| | Send the HTTP request for a download, then prepare I/O reading callbacks to read the incoming status line and following headers.
|
| void | download_connected (struct download *d) |
| | This function is called once a connection has been established.
|
| download * | select_push_download (GSList *servers) |
| | On reception of a "GIV index:GUID" string, select the appropriate download to request, from the list of potential server targets.
|
| void | select_matching_servers (gpointer key, gpointer value, gpointer user) |
| | If server is matching the selection criteria, insert it in the result set.
|
| GSList * | select_servers (const gchar *guid, const host_addr_t addr, gint *count) |
| | Given a servent GUID and an IP address, build a list of all the servents that bear either this GUID or that IP address.
|
| gboolean | parse_giv (const gchar *line, gchar *hex_guid, size_t size) |
| void | download_push_ack (struct gnutella_socket *s) |
| | Initiate download on the remotely initiated connection.
|
| download * | download_find_waiting_unparq (const host_addr_t addr, guint16 port) |
| | Find a waiting download on the specified server, identified by its IP:port for which we have no PARQ information yet.
|
| gchar * | download_build_magnet (const struct download *d) |
| void | download_store_magnet (FILE *f, const struct download *d) |
| void | download_store_magnets (void) |
| void | download_store_if_dirty (void) |
| | Store pending download if needed.
|
| gboolean | download_retrieve_magnets (FILE *f) |
| void | download_retrieve_old (FILE *f) |
| void | download_moved_with_bad_sha1 (struct download *d) |
| | Post renaming/moving routine called when download had a bad SHA1.
|
| void | download_move (struct download *d, const gchar *dir, const gchar *ext) |
| | Main entry point to move the completed file `d' to target directory `dir'.
|
| void | download_move_start (struct download *d) |
| | Called when the moving daemon task starts processing a download.
|
| void | download_move_progress (struct download *d, filesize_t copied) |
| | Called to register the current moving progress.
|
| void | download_move_done (struct download *d, const gchar *pathname, guint elapsed) |
| | Called when file has been moved/renamed with its fileinfo trailer stripped.
|
| void | download_move_error (struct download *d) |
| | Called when we cannot move the file (I/O error, etc...).
|
| void | download_verify_start (struct download *d) |
| | Called when the verification daemon task starts processing a download.
|
| void | download_verify_progress (struct download *d, guint32 hashed) |
| | Called to register the current verification progress.
|
| void | download_verify_done (struct download *d, const struct sha1 *sha1, guint elapsed) |
| | Called when download verification is finished and digest is known.
|
| void | download_verify_error (struct download *d) |
| | Called when we cannot verify the SHA1 for the file (I/O error, etc...).
|
| gboolean | download_verify_callback (const struct verify *ctx, enum verify_status status, void *user_data) |
| void | download_close (void) |
| | Terminating processing, cleanup data structures.
|
| gchar * | download_url_for_uri (const struct download *d, const gchar *uri) |
| gchar * | download_build_url (const struct download *d) |
| | Creates a URL which points to a downloads (e.g.
|
| const gchar * | download_get_hostname (const struct download *d) |
| gint | download_get_http_req_percent (const struct download *d) |
| gboolean | download_something_to_clear (void) |
| | Checks unqueued list to see if there are any downloads that are finished and therefore ready to be cleared.
|
| download * | download_browse_start (const gchar *hostname, host_addr_t addr, guint16 port, const gchar *guid, const gnet_host_vec_t *proxies, gnet_search_t search, guint32 flags) |
| | Create special non-persisted download that will request "/" on the remote host and expect a stream of Gnutella query hits back.
|
| void | download_thex_done (struct download *d) |
| download * | download_thex_start (const gchar *uri, const struct sha1 *sha1, const struct tth *tth, filesize_t filesize, const gchar *hostname, host_addr_t addr, guint16 port, const gchar *guid, const gnet_host_vec_t *proxies, guint32 flags) |
| | Create special non-persisted download that will request THEX data from the remote host.
|
| void | download_abort_browse_host (struct download *d, gnet_search_t sh) |
| | Abort browse-host download when corresponding search is closed.
|
| void | download_got_eof (struct download *d) |
| | Called when an EOF is received during data reception.
|
| void | download_rx_done (struct download *d) |
| | Called when all data has been received.
|
| void | download_data_received (struct download *d, ssize_t received) |
| | Called when more data has been received on the RX stack, for non-file downloads (e.g.
|
| void | download_maybe_finished (struct download *d) |
| | Called when all the received data so far have been processed to check whether we are done.
|
| guint | download_handle_magnet (const gchar *url) |
| gboolean | download_handle_http (const gchar *url) |
| guint | download_speed_avg (struct download *d) |
| gboolean | download_is_stalled (struct download *d) |
Variables |
| hash_list_t * | sl_downloads |
| | All downloads (queued + unqueued).
|
| hash_list_t * | sl_unqueued |
| | Unqueued downloads only.
|
| GSList * | sl_removed |
| | Removed downloads only.
|
| GSList * | sl_removed_servers |
| | Removed servers only.
|
| gchar | dl_tmp [4096] |
| const gchar | DL_OK_EXT [] = ".OK" |
| | Extension to mark OK files.
|
| const gchar | DL_BAD_EXT [] = ".BAD" |
| | "Bad" files (SHA1 mismatch)
|
| const gchar | DL_UNKN_EXT [] = ".UNKN" |
| | For unchecked files.
|
| const gchar | no_reason [] = "<no reason>" |
| | Don't translate this.
|
| gboolean | download_dirty = FALSE |
| GHashTable * | dl_by_host = NULL |
| GHashTable * | dl_count_by_name = NULL |
| struct { |
| GList * servers [DHASH_SIZE] |
| | Lists of servers, by retry time.
|
| gint change [DHASH_SIZE] |
| | Counts changes to the list.
|
| } | dl_by_time |
| GHashTable * | dl_by_addr = NULL |
| | To handle download meshes, where we only know the IP/port of the host and not its GUID, we need to be able to locate the server.
|
| guint | dl_establishing = 0 |
| | Establishing downloads.
|
| guint | dl_active = 0 |
| | Active downloads.
|
| event * | src_events [EV_SRC_EVENTS] |
| idtable_t * | src_handle_map = NULL |
| const struct rx_link_cb | download_rx_link_cb |
| const struct rx_chunk_cb | download_rx_chunk_cb |
| const struct rx_inflate_cb | download_rx_inflate_cb |
| io_error | download_io_error |
| const gchar | download_file [] = "downloads" |
| const gchar | file_what [] = "downloads" |
| | What is persisted to file.
|
| gboolean | retrieving = FALSE |