Changeset 60e4df3 for dcc.c


Ignore:
Timestamp:
2010-03-17T23:23:27Z (10 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
c1a3c27
Parents:
e8c8d00
Message:

Small cleanup. The max_packet_size variable doesn't seem to be read
anywhere, and reworked string handling in ft_listen() a little bit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dcc.c

    re8c8d00 r60e4df3  
    6161 */
    6262unsigned int receivedchunks=0, receiveddata=0;
    63 
    64 int max_packet_size = 0;
    6563
    6664static void dcc_finish( file_transfer_t *file );
     
    133131        struct sockaddr_storage saddr;
    134132        char *errmsg;
    135         char host[INET6_ADDRSTRLEN];
     133        char host[HOST_NAME_MAX];
    136134        char port[6];
    137135
     
    290288
    291289/*
    292  * fills max_packet_size with twice the TCP maximum segment size
    293  */
    294 gboolean  dcc_check_maxseg( dcc_file_transfer_t *df, int fd )
    295 {
    296         /*
    297          * use twice the maximum segment size as a maximum for calls to send().
    298          */
    299         if( max_packet_size == 0 )
    300         {
    301                 unsigned int mpslen = sizeof( max_packet_size );
    302                 if( getsockopt( fd, IPPROTO_TCP, TCP_MAXSEG, &max_packet_size, &mpslen ) )
    303                         return dcc_abort( df, "getsockopt() failed" );
    304                 max_packet_size *= 2;
    305         }
    306         return TRUE;
    307 }
    308 
    309 /*
    310290 * After setup, the transfer itself is handled entirely by this function.
    311291 * There are basically four things to handle: connect, receive, send, and error.
     
    334314                file->status = FT_STATUS_TRANSFERRING;
    335315                sock_make_nonblocking( fd );
    336 
    337                 if ( !dcc_check_maxseg( df, fd ) )
    338                         return FALSE;
    339316
    340317                /* IM protocol callback */
     
    446423        {
    447424                ft->status = FT_STATUS_TRANSFERRING;
    448                 if ( !dcc_check_maxseg( df, fd ) )
    449                         return FALSE;
    450425
    451426                //df->watch_in = b_input_add( df->fd, GAIM_INPUT_READ, dccs_recv_proto, df );
Note: See TracChangeset for help on using the changeset viewer.