Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

uploads.h File Reference


Detailed Description

Handles upload of our files to others users.

Author:
Raphael Manfredi
Date:
2001-2003
Author:
Daniel Walker (dwalker@cats.ucsc.edu)
Date:
2000

#include "common.h"
#include "bsched.h"
#include "bh_upload.h"
#include "if/core/uploads.h"

Go to the source code of this file.

Data Structures

struct  upload
struct  upload_http_cb
 This structure is used for HTTP status printing callbacks. More...


Defines

#define upload_vendor_str(u)   ((u)->user_agent ? (u)->user_agent : "")
#define UPLOAD_F_STALLED   0x00000001 /**< Stall condition present */
 Stall condition present.

#define UPLOAD_F_EARLY_STALL   0x00000002 /**< Pre-stalling condition */
 Pre-stalling condition.


Typedefs

typedef upload gnutella_upload_t

Functions

gboolean upload_is_enabled (void)
 Check whether uploading is enabled: we have slots, and bandwidth.

void upload_timer (time_t now)
 Upload heartbeat timer.

void upload_remove (struct upload *, const gchar *,...) G_GNUC_PRINTF(2
void handle_push_request (struct gnutella_node *)
 Called when we receive a Push request on Gnet.

void upload_add (struct gnutella_socket *s)
 Create a new upload request, and begin reading HTTP headers.

void upload_connect_conf (struct upload *u)
void upload_init (void)
 Initialize uploads.

void upload_close (void)
 Final cleanup at shutdown time.

void upload_stop_all (struct dl_file_info *fi, const gchar *reason)
 Stop all uploads dealing with partial file `fi'.

void upload_send_giv (const host_addr_t addr, guint16 port, guint8 hops, guint8 ttl, guint32 file_index, const gchar *file_name, gboolean banning, guint32 flags)
 Send a GIV string to the specified IP:port.

gnutella_upload_tupload_create (struct gnutella_socket *s, gboolean push)
 Create a new upload structure, linked to a socket.

void upload_fire_upload_info_changed (gnutella_upload_t *n)
void expect_http_header (gnutella_upload_t *u, upload_stage_t new_status)
 Prepare reception of a full HTTP header, including the leading request.


Define Documentation

#define UPLOAD_F_EARLY_STALL   0x00000002 /**< Pre-stalling condition */
 

Pre-stalling condition.

#define UPLOAD_F_STALLED   0x00000001 /**< Stall condition present */
 

Stall condition present.

#define upload_vendor_str u   )     ((u)->user_agent ? (u)->user_agent : "")
 


Typedef Documentation

typedef struct upload gnutella_upload_t
 


Function Documentation

void expect_http_header gnutella_upload_t u,
upload_stage_t  new_status
 

Prepare reception of a full HTTP header, including the leading request.

Will call upload_request() when everything has been parsed.

void handle_push_request struct gnutella_node n  ) 
 

Called when we receive a Push request on Gnet.

If it is not for us, discard it. If we are the target, then connect back to the remote servent.

void upload_add struct gnutella_socket s  ) 
 

Create a new upload request, and begin reading HTTP headers.

void upload_close void   ) 
 

Final cleanup at shutdown time.

void upload_connect_conf struct upload u  ) 
 

gnutella_upload_t* upload_create struct gnutella_socket s,
gboolean  push
 

Create a new upload structure, linked to a socket.

void upload_fire_upload_info_changed gnutella_upload_t n  ) 
 

void upload_init void   ) 
 

Initialize uploads.

gboolean upload_is_enabled void   ) 
 

Check whether uploading is enabled: we have slots, and bandwidth.

void upload_remove struct upload ,
const gchar *  ,
... 
 

void upload_send_giv const host_addr_t  addr,
guint16  port,
guint8  hops,
guint8  ttl,
guint32  file_index,
const gchar *  file_name,
gboolean  banning,
guint32  flags
 

Send a GIV string to the specified IP:port.

`ip' and `port' is where we need to connect. `hops' and `ttl' are the values from the PUSH message we received, just for logging in case we cannot connect. `file_index' and `file_name' are the values we determined from PUSH. `banning' must be TRUE when we determined connections to the IP were currently prohibited.

void upload_stop_all struct dl_file_info fi,
const gchar *  reason
 

Stop all uploads dealing with partial file `fi'.

void upload_timer time_t  now  ) 
 

Upload heartbeat timer.


Generated on Sun Feb 12 10:50:09 2006 for Gtk-Gnutella by doxygen 1.3.6