diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-17 23:23:27 +0000 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-17 23:23:27 +0000 |
commit | 60e4df367e5c3af0eb1aada19f9c39ef7079e8e6 (patch) | |
tree | cf0fc3646aae9c783743ade66920a0e42af57dc2 /dcc.c | |
parent | e8c8d00ea43c204ee276bde7fb663a0f0249790f (diff) |
Small cleanup. The max_packet_size variable doesn't seem to be read
anywhere, and reworked string handling in ft_listen() a little bit.
Diffstat (limited to 'dcc.c')
-rw-r--r-- | dcc.c | 27 |
1 files changed, 1 insertions, 26 deletions
@@ -61,8 +61,6 @@ unsigned int local_transfer_id=1; */ unsigned int receivedchunks=0, receiveddata=0; -int max_packet_size = 0; - static void dcc_finish( file_transfer_t *file ); static void dcc_close( file_transfer_t *file ); gboolean dccs_send_proto( gpointer data, gint fd, b_input_condition cond ); @@ -132,7 +130,7 @@ file_transfer_t *dccs_send_start( struct im_connection *ic, char *user_nick, cha dcc_file_transfer_t *df; struct sockaddr_storage saddr; char *errmsg; - char host[INET6_ADDRSTRLEN]; + char host[HOST_NAME_MAX]; char port[6]; if( file_size > global.conf->ft_max_size ) @@ -289,24 +287,6 @@ gboolean dcc_poll( dcc_file_transfer_t *df, int fd, short *revents ) } /* - * fills max_packet_size with twice the TCP maximum segment size - */ -gboolean dcc_check_maxseg( dcc_file_transfer_t *df, int fd ) -{ - /* - * use twice the maximum segment size as a maximum for calls to send(). - */ - if( max_packet_size == 0 ) - { - unsigned int mpslen = sizeof( max_packet_size ); - if( getsockopt( fd, IPPROTO_TCP, TCP_MAXSEG, &max_packet_size, &mpslen ) ) - return dcc_abort( df, "getsockopt() failed" ); - max_packet_size *= 2; - } - return TRUE; -} - -/* * After setup, the transfer itself is handled entirely by this function. * There are basically four things to handle: connect, receive, send, and error. */ @@ -334,9 +314,6 @@ gboolean dccs_send_proto( gpointer data, gint fd, b_input_condition cond ) file->status = FT_STATUS_TRANSFERRING; sock_make_nonblocking( fd ); - if ( !dcc_check_maxseg( df, fd ) ) - return FALSE; - /* IM protocol callback */ if( file->accept ) file->accept( file ); @@ -445,8 +422,6 @@ gboolean dccs_recv_proto( gpointer data, gint fd, b_input_condition cond ) ( ft->status & FT_STATUS_CONNECTING ) ) { ft->status = FT_STATUS_TRANSFERRING; - if ( !dcc_check_maxseg( df, fd ) ) - return FALSE; //df->watch_in = b_input_add( df->fd, GAIM_INPUT_READ, dccs_recv_proto, df ); |