Main Page | Class List | File List | Class Members | File Members

transfer_api.h File Reference

Defines structures and API necessary to work with Transfer, Chunk, and Source. More...

Go to the source code of this file.

Classes

struct  upload_auth_t
struct  source
struct  chunk

Typedefs

typedef enum source_status SourceStatus
typedef source Source
typedef chunk Chunk

Enumerations

enum  TransferType { TRANSFER_DOWNLOAD, TRANSFER_UPLOAD }
enum  source_status {
  SOURCE_UNUSED = 0, SOURCE_PAUSED, SOURCE_QUEUED_REMOTE, SOURCE_QUEUED_LOCAL,
  SOURCE_COMPLETE, SOURCE_CANCELLED, SOURCE_TIMEOUT, SOURCE_WAITING,
  SOURCE_ACTIVE
}

Functions

EXTERN_C_BEGIN GIFTD_EXPORT
TransferType 
transfer_direction (struct transfer *t)
GIFTD_EXPORT size_t download_throttle (Chunk *chunk, size_t len)
GIFTD_EXPORT size_t upload_throttle (Chunk *chunk, size_t len)


Detailed Description

Defines structures and API necessary to work with Transfer, Chunk, and Source.

This API is required as protocol.h makes reference to these types.


Typedef Documentation

typedef struct chunk Chunk
 

Arbitrary file division of a single transferring file. Usedin connection with sources to perform the multi-source downloading without the plugins awareness/interaction.

typedef struct source Source
 

Defines contact url, hash, and status information. When actively transferring, the associated chunk will be referenced.

typedef enum source_status SourceStatus
 

Defines status groups that giFT can use to modify the transfer logic. Protocols are required to set an appropriate grouping with p->source_status (p, ...).


Enumeration Type Documentation

enum source_status
 

Defines status groups that giFT can use to modify the transfer logic. Protocols are required to set an appropriate grouping with p->source_status (p, ...).

Enumeration values:
SOURCE_UNUSED  this source is unused and (possibly) waiting to be placed
SOURCE_PAUSED  source has been explicitly paused by user
SOURCE_QUEUED_REMOTE  protocol says the other end is preventing us from downloading
SOURCE_QUEUED_LOCAL  we are preventing ourselves from downloading this file
SOURCE_COMPLETE  last known event was that the chunk associated complete successfully, and is now moving onto another
SOURCE_CANCELLED  remote end cancelled an active transfer
SOURCE_TIMEOUT  date timeout
SOURCE_WAITING  asked the protocol to download but haven't received any status back
SOURCE_ACTIVE  set once data has started coming in


Function Documentation

EXTERN_C_BEGIN GIFTD_EXPORT TransferType transfer_direction struct transfer *  t  ) 
 

Simple accessor for the transfer data structure to retrieve the direction. This is generally useful for plugins because there is little data structure distinction between a download and an upload.

Exported by giFT, not libgiftproto. This is not correct, and will change in the future.


Generated on Sun Aug 22 08:08:53 2004 by doxygen 1.3.7