From 60e4df367e5c3af0eb1aada19f9c39ef7079e8e6 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Wed, 17 Mar 2010 23:23:27 +0000 Subject: Small cleanup. The max_packet_size variable doesn't seem to be read anywhere, and reworked string handling in ft_listen() a little bit. --- dcc.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'dcc.c') diff --git a/dcc.c b/dcc.c index 655c98b9..d28c3b34 100644 --- a/dcc.c +++ b/dcc.c @@ -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 ) @@ -288,24 +286,6 @@ gboolean dcc_poll( dcc_file_transfer_t *df, int fd, short *revents ) return TRUE; } -/* - * 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 ); -- cgit v1.2.3