Changeset a02f34f for conf.c


Ignore:
Timestamp:
2008-08-11T23:07:12Z (16 years ago)
Author:
ulim <a.sporto+bee@…>
Branches:
master
Children:
5d550c5
Parents:
66be784
Message:

Added conf entries and lib/ftutil.[ch].

ft_listen = <IP-A>:<Port-A>;<IP-B>:<Port-B> to specify listening addresses for
the bitlbee<->client connection and the bitlbee<->IM peer connection,
respectively.

ft_max_size should be obvious. ft_max_kbps should limit the kilobits per second
per transfer (not implemented yet).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • conf.c

    r66be784 ra02f34f  
    6363        conf->ping_timeout = 300;
    6464        conf->user = NULL;
    65         conf->max_filetransfer_size = G_MAXUINT;
     65        conf->ft_max_size = SIZE_MAX;
     66        conf->ft_max_kbps = G_MAXUINT;
     67        conf->ft_listen = NULL;
    6668        proxytype = 0;
    6769       
     
    307309                                conf->user = g_strdup( ini->value );
    308310                        }
     311                        else if( g_strcasecmp( ini->key, "ft_max_size" ) == 0 )
     312                        {
     313                                size_t ft_max_size;
     314                                if( sscanf( ini->value, "%zu", &ft_max_size ) != 1 )
     315                                {
     316                                        fprintf( stderr, "Invalid %s value: %s\n", ini->key, ini->value );
     317                                        return 0;
     318                                }
     319                                conf->ft_max_size = ft_max_size;
     320                        }
     321                        else if( g_strcasecmp( ini->key, "ft_max_kbps" ) == 0 )
     322                        {
     323                                if( sscanf( ini->value, "%d", &i ) != 1 )
     324                                {
     325                                        fprintf( stderr, "Invalid %s value: %s\n", ini->key, ini->value );
     326                                        return 0;
     327                                }
     328                                conf->ft_max_kbps = i;
     329                        }
     330                        else if( g_strcasecmp( ini->key, "ft_listen" ) == 0 )
     331                        {
     332                                g_free( conf->ft_listen );
     333                                conf->ft_listen = g_strdup( ini->value );
     334                        }
    309335                        else
    310336                        {
Note: See TracChangeset for help on using the changeset viewer.