00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00036 #ifndef _core_downloads_h_
00037 #define _core_downloads_h_
00038
00039 #include "lib/header.h"
00040 #include "fileinfo.h"
00041
00042 #include "if/core/downloads.h"
00043 #include "if/core/search.h"
00044
00049 extern GSList *sl_unqueued;
00050
00051
00052
00053
00054
00055 void download_init(void);
00056 void download_restore_state(void);
00057 void download_store_if_dirty(void);
00058 void download_timer(time_t now);
00059 void download_info_change_all(fileinfo_t *old_fi, fileinfo_t *new_fi);
00060 void download_orphan_new(
00061 gchar *file, filesize_t size, gchar *sha1, fileinfo_t *fi);
00062 void download_queue(struct download *d,
00063 const gchar *fmt, ...) G_GNUC_PRINTF(2, 3);
00064 void download_stop(struct download *, guint32,
00065 const gchar *, ...) G_GNUC_PRINTF(3, 4);
00066 void download_stop_v(struct download *d, guint32 new_status,
00067 const gchar * reason, va_list ap);
00068 void download_push_ack(struct gnutella_socket *);
00069 void download_fallback_to_push(struct download *, gboolean, gboolean);
00070 void download_pickup_queued(void);
00071 void download_forget(struct download *, gboolean unavailable);
00072 gboolean download_start_prepare(struct download *d);
00073 gboolean download_start_prepare_running(struct download *d);
00074 void download_send_request(struct download *);
00075 void download_retry(struct download *);
00076 void download_close(void);
00077 gboolean download_server_nopush(gchar *guid,
00078 const host_addr_t addr, guint16 port);
00079 void download_free_removed(void);
00080 void download_redirect_to_server(struct download *d,
00081 const host_addr_t addr, guint16 port);
00082 void download_actively_queued(struct download *d, gboolean queued);
00083
00084 void download_verify_start(struct download *d);
00085 void download_verify_progress(struct download *d, guint32 hashed);
00086 void download_verify_done(struct download *d, gchar *digest, guint elapsed);
00087 void download_verify_error(struct download *d);
00088
00089 void download_move_start(struct download *d);
00090 void download_move_progress(struct download *d, filesize_t copied);
00091 void download_move_done(struct download *d, guint elapsed);
00092 void download_move_error(struct download *d);
00093
00094 guint extract_retry_after(struct download *d, const header_t *header);
00095 gboolean is_faked_download(const struct download *d);
00096
00097 struct download *download_find_waiting_unparq(const host_addr_t addr,
00098 guint16 port);
00099 void download_set_socket_rx_size(gint rx_size);
00100
00101 void download_proxy_newstate(struct download *d);
00102 void download_proxy_sent(struct download *d);
00103 void download_proxy_failed(struct download *d);
00104
00105 struct download * download_browse_start(const gchar *name,
00106 const gchar *hostname, host_addr_t addr, guint16 port,
00107 const gchar *guid, gboolean push, const gnet_host_vec_t *proxies,
00108 gnet_search_t search);
00109
00110 void download_abort_browse_host(gpointer download, gnet_search_t sh);
00111 void download_got_eof(struct download *d);
00112 void download_rx_done(struct download *d);
00113 void download_browse_received(struct download *d, ssize_t received);
00114 void download_browse_maybe_finished(struct download *d);
00115
00116 #endif
00117
00118