aboutsummaryrefslogtreecommitdiffstats
path: root/dcc.h
diff options
context:
space:
mode:
authorulim <a.sporto+bee@gmail.com>2007-12-04 01:48:57 +0100
committerulim <a.sporto+bee@gmail.com>2007-12-04 01:48:57 +0100
commitdce390357114e30a424106c99e49cef1e682e1af (patch)
treef238de491573827510c55e29cf80e2fda7ccc793 /dcc.h
parent2ff20765990c756533957e8da9c7c29dd3102e79 (diff)
Send and receive seems to work now! Also adopted the new buffering strategy,
only one buffer of 2k per transfer now.
Diffstat (limited to 'dcc.h')
-rw-r--r--dcc.h47
1 files changed, 2 insertions, 45 deletions
diff --git a/dcc.h b/dcc.h
index d5805a1f..e53823e7 100644
--- a/dcc.h
+++ b/dcc.h
@@ -43,33 +43,9 @@
#ifndef _DCC_H
#define _DCC_H
-/* don't wait for acknowledgments */
-#define DCC_SEND_AHEAD
-
-/* This multiplier specifies how many bytes we
- * can go ahead within one event loop cycle. Notice that all in all,
- * we can easily be more ahead if the event loop shoots often enough.
- * (or the receiver processes slow enough)
- *
- * Setting this value too high will cause send buffer overflows.
- */
-#define DCC_SEND_AHEAD_MUL 10
-
-/*
- * queue thresholds for the out of data and overflow conditions
- */
-#define DCC_QUEUE_THRESHOLD_LOW 2048
-#define DCC_QUEUE_THRESHOLD_HIGH 65536
-
-/* only used in non-ahead mode */
+/* Send an ACK after receiving this amount of data */
#define DCC_PACKET_SIZE 1024
-/* stores buffers handed over by IM protocols */
-struct dcc_buffer {
- char *b;
- int len;
-};
-
typedef struct dcc_file_transfer {
struct im_connection *ic;
@@ -88,25 +64,6 @@ typedef struct dcc_file_transfer {
gint watch_out; /* writable */
/*
- * The total number of queued bytes. The following equality should always hold:
- *
- * queued_bytes = sum(queued_buffers.len) - buffer_pos
- */
- unsigned int queued_bytes;
-
- /*
- * A list of dcc_buffer structures.
- * These are provided by the protocols directly so that no copying is neccessary.
- */
- GSList *queued_buffers;
-
- /*
- * current position within the first buffer.
- * Is non-null if the whole buffer couldn't be sent at once.
- */
- int buffer_pos;
-
- /*
* The total amount of bytes that have been sent to the irc client.
*/
size_t bytes_sent;
@@ -123,7 +80,7 @@ file_transfer_t *dccs_send_start( struct im_connection *ic, char *user_nick, cha
void dcc_canceled( file_transfer_t *file, char *reason );
-gboolean dccs_send_write( file_transfer_t *file, gpointer data, unsigned int data_size );
+gboolean dccs_send_write( file_transfer_t *file, char *data, unsigned int data_size );
file_transfer_t *dcc_request( struct im_connection *ic, char *line );
#endif