diff options
author | ulim <a.sporto+bee@gmail.com> | 2008-08-12 01:07:12 +0200 |
---|---|---|
committer | ulim <a.sporto+bee@gmail.com> | 2008-08-12 01:07:12 +0200 |
commit | a02f34fb047af728f991ced3688c5e804c130878 (patch) | |
tree | 7eb7c22889aad7f06d2f22fe4920ff8c4005ece5 /conf.c | |
parent | 66be7849ef6b74c39bc8f1dc1d96bc4788eb50a0 (diff) |
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).
Diffstat (limited to 'conf.c')
-rw-r--r-- | conf.c | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -62,7 +62,9 @@ conf_t *conf_load( int argc, char *argv[] ) conf->ping_interval = 180; conf->ping_timeout = 300; conf->user = NULL; - conf->max_filetransfer_size = G_MAXUINT; + conf->ft_max_size = SIZE_MAX; + conf->ft_max_kbps = G_MAXUINT; + conf->ft_listen = NULL; proxytype = 0; i = conf_loadini( conf, global.conf_file ); @@ -306,6 +308,30 @@ static int conf_loadini( conf_t *conf, char *file ) g_free( conf->user ); conf->user = g_strdup( ini->value ); } + else if( g_strcasecmp( ini->key, "ft_max_size" ) == 0 ) + { + size_t ft_max_size; + if( sscanf( ini->value, "%zu", &ft_max_size ) != 1 ) + { + fprintf( stderr, "Invalid %s value: %s\n", ini->key, ini->value ); + return 0; + } + conf->ft_max_size = ft_max_size; + } + else if( g_strcasecmp( ini->key, "ft_max_kbps" ) == 0 ) + { + if( sscanf( ini->value, "%d", &i ) != 1 ) + { + fprintf( stderr, "Invalid %s value: %s\n", ini->key, ini->value ); + return 0; + } + conf->ft_max_kbps = i; + } + else if( g_strcasecmp( ini->key, "ft_listen" ) == 0 ) + { + g_free( conf->ft_listen ); + conf->ft_listen = g_strdup( ini->value ); + } else { fprintf( stderr, "Error: Unknown setting `%s` in configuration file.\n", ini->key ); |