Changeset fa30fa5 for dcc.h


Ignore:
Timestamp:
2007-12-04T00:53:04Z (12 years ago)
Author:
ulim <a.sporto+bee@…>
Branches:
master
Children:
08135df
Parents:
2c2df7d (diff), dce3903 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Jabber file transfer now also with sending! You can't use a proxy yet when
sending, that's my next task. You can use proxies when receiving though!

I also changed the buffering strategy. Previously receiving continued till some
buffer limit was reached, now only one message is received and receiving stops
till it is delivered. This keeps the buffering space per file transfer to a
minimum(currently 4k). Makes sense when used on a public server. For public
servers a throughput maximum would also be interesting...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dcc.h

    r2c2df7d rfa30fa5  
    4444#define _DCC_H
    4545
    46 /* don't wait for acknowledgments */
    47 #define DCC_SEND_AHEAD
    48 
    49 /* This multiplier specifies how many bytes we
    50  * can go ahead within one event loop cycle. Notice that all in all,
    51  * we can easily be more ahead if the event loop shoots often enough.
    52  * (or the receiver processes slow enough)
    53  *
    54  * Setting this value too high will cause send buffer overflows.
    55  */
    56 #define DCC_SEND_AHEAD_MUL 10
    57 
    58 /*
    59  * queue thresholds for the out of data and overflow conditions
    60  */
    61 #define DCC_QUEUE_THRESHOLD_LOW 2048
    62 #define DCC_QUEUE_THRESHOLD_HIGH 65536
    63 
    64 /* only used in non-ahead mode */
     46/* Send an ACK after receiving this amount of data */
    6547#define DCC_PACKET_SIZE 1024
    66 
    67 /* stores buffers handed over by IM protocols */
    68 struct dcc_buffer {
    69         char *b;
    70         int len;
    71 };
    7248
    7349typedef struct dcc_file_transfer {
     
    8965       
    9066        /*
    91          * The total number of queued bytes. The following equality should always hold:
    92          *
    93          *      queued_bytes = sum(queued_buffers.len) - buffer_pos
    94          */
    95         unsigned int queued_bytes;
    96 
    97         /*
    98          * A list of dcc_buffer structures.
    99          * These are provided by the protocols directly so that no copying is neccessary.
    100          */
    101         GSList *queued_buffers;
    102        
    103         /*
    104          * current position within the first buffer.
    105          * Is non-null if the whole buffer couldn't be sent at once.
    106          */
    107         int buffer_pos;
    108 
    109         /*
    11067         * The total amount of bytes that have been sent to the irc client.
    11168         */
    11269        size_t bytes_sent;
    11370       
    114         /* imcb's handle */
     71        /* imc's handle */
    11572        file_transfer_t *ft;
     73
     74        /* if we're receiving, this is the sender's socket address */
     75        struct sockaddr_storage saddr;
    11676
    11777} dcc_file_transfer_t;
     
    12181void dcc_canceled( file_transfer_t *file, char *reason );
    12282
    123 gboolean dccs_send_write( file_transfer_t *file, gpointer data, unsigned int data_size );
     83gboolean dccs_send_write( file_transfer_t *file, char *data, unsigned int data_size );
    12484
     85file_transfer_t *dcc_request( struct im_connection *ic, char *line );
    12586#endif
Note: See TracChangeset for help on using the changeset viewer.