Changeset 767a148 for conf.c


Ignore:
Timestamp:
2010-03-21T16:06:31Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
1cc0df3, 85693e6
Parents:
545d7c0 (diff), a81d679 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merging in file transfer support. Most important points from my review
are fixed now, time to let it settle in and get people to try it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • conf.c

    r545d7c0 r767a148  
    6363        conf->ping_timeout = 300;
    6464        conf->user = NULL;
     65        conf->ft_max_size = SIZE_MAX;
     66        conf->ft_max_kbps = G_MAXUINT;
     67        conf->ft_listen = NULL;
    6568        conf->protocols = NULL;
    6669        proxytype = 0;
     
    308311                                conf->user = g_strdup( ini->value );
    309312                        }
     313                        else if( g_strcasecmp( ini->key, "ft_max_size" ) == 0 )
     314                        {
     315                                size_t ft_max_size;
     316                                if( sscanf( ini->value, "%zu", &ft_max_size ) != 1 )
     317                                {
     318                                        fprintf( stderr, "Invalid %s value: %s\n", ini->key, ini->value );
     319                                        return 0;
     320                                }
     321                                conf->ft_max_size = ft_max_size;
     322                        }
     323                        else if( g_strcasecmp( ini->key, "ft_max_kbps" ) == 0 )
     324                        {
     325                                if( sscanf( ini->value, "%d", &i ) != 1 )
     326                                {
     327                                        fprintf( stderr, "Invalid %s value: %s\n", ini->key, ini->value );
     328                                        return 0;
     329                                }
     330                                conf->ft_max_kbps = i;
     331                        }
     332                        else if( g_strcasecmp( ini->key, "ft_listen" ) == 0 )
     333                        {
     334                                g_free( conf->ft_listen );
     335                                conf->ft_listen = g_strdup( ini->value );
     336                        }
    310337                        else if( g_strcasecmp( ini->key, "protocols" ) == 0 )
    311338                        {
Note: See TracChangeset for help on using the changeset viewer.