diff options
Diffstat (limited to 'conf.c')
| -rw-r--r-- | conf.c | 44 | 
1 files changed, 29 insertions, 15 deletions
| @@ -59,10 +59,12 @@ conf_t *conf_load( int argc, char *argv[] )  	conf->plugindir = g_strdup( PLUGINDIR );  	conf->pidfile = g_strdup( PIDFILE );  	conf->motdfile = g_strdup( ETCDIR "/motd.txt" ); -	conf->welcomefile = g_strdup( ETCDIR "/welcome.txt" );  	conf->ping_interval = 180;  	conf->ping_timeout = 300;  	conf->user = NULL; +	conf->ft_max_size = SIZE_MAX; +	conf->ft_max_kbps = G_MAXUINT; +	conf->ft_listen = NULL;  	conf->protocols = NULL;  	proxytype = 0; @@ -79,7 +81,7 @@ conf_t *conf_load( int argc, char *argv[] )  		   at a *valid* configuration file. */  	} -	while( argc > 0 && ( opt = getopt( argc, argv, "i:p:P:nvIDFc:d:hR:u:V" ) ) >= 0 ) +	while( argc > 0 && ( opt = getopt( argc, argv, "i:p:P:nvIDFc:d:hu:V" ) ) >= 0 )  	/*     ^^^^ Just to make sure we skip this step from the REHASH handler. */  	{  		if( opt == 'i' ) @@ -155,13 +157,6 @@ conf_t *conf_load( int argc, char *argv[] )  			        BITLBEE_VERSION, BITLBEE_VERSION_CODE );  			return NULL;  		} -		else if( opt == 'R' ) -		{ -			/* Backward compatibility; older BitlBees passed this -			   info using a command-line flag. Allow people to -			   upgrade from such a version for now. */ -			setenv( "_BITLBEE_RESTART_STATE", optarg, 0 ); -		}  		else if( opt == 'u' )  		{  			g_free( conf->user ); @@ -258,11 +253,6 @@ static int conf_loadini( conf_t *conf, char *file )  				g_free( conf->motdfile );  				conf->motdfile = g_strdup( ini->value );  			} -			else if( g_strcasecmp( ini->key, "welcomefile" ) == 0 ) -			{ -				g_free( conf->welcomefile ); -				conf->welcomefile = g_strdup( ini->value ); -			}  			else if( g_strcasecmp( ini->key, "account_storage" ) == 0 )  			{  				g_free( conf->primary_storage ); @@ -320,6 +310,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 if( g_strcasecmp( ini->key, "protocols" ) == 0 )  			{  				g_strfreev( conf->protocols ); @@ -354,7 +368,7 @@ void conf_loaddefaults( irc_t *irc )  	{  		if( g_strcasecmp( ini->section, "defaults" ) == 0 )  		{ -			set_t *s = set_find( &irc->set, ini->key ); +			set_t *s = set_find( &irc->b->set, ini->key );  			if( s )  			{ | 
