Changeset 9fae35c for conf.c


Ignore:
Timestamp:
2006-01-23T23:28:13Z (18 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
ec3e411
Parents:
7308b63 (diff), 68c7c14 (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:

Merge from Wilmer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • conf.c

    r7308b63 r9fae35c  
    4646        conf = g_new0( conf_t, 1 );
    4747       
     48#ifdef IPV6
     49        conf->iface = "::";
     50#else
    4851        conf->iface = "0.0.0.0";
     52#endif
    4953        conf->port = 6667;
    5054        conf->nofork = 0;
     
    5357        conf->runmode = RUNMODE_INETD;
    5458        conf->authmode = AUTHMODE_OPEN;
    55         conf->password = NULL;
     59        conf->auth_pass = NULL;
     60        conf->oper_pass = NULL;
    5661        conf->configdir = g_strdup( CONFIG );
    5762        conf->plugindir = g_strdup( PLUGINDIR );
     
    5964        conf->ping_interval = 180;
    6065        conf->ping_timeout = 300;
     66        proxytype = 0;
    6167       
    6268        i = conf_loadini( conf, CONF_FILE );
     
    7177        }
    7278       
    73         while( ( opt = getopt( argc, argv, "i:p:nvIDc:d:h" ) ) >= 0 )
     79        while( argc > 0 && ( opt = getopt( argc, argv, "i:p:nvIDFc:d:h" ) ) >= 0 )
     80        /*     ^^^^ Just to make sure we skip this step from the REHASH handler. */
    7481        {
    7582                if( opt == 'i' )
     
    8794                }
    8895                else if( opt == 'n' )
    89                         conf->nofork=1;
     96                        conf->nofork = 1;
    9097                else if( opt == 'v' )
    91                         conf->verbose=1;
     98                        conf->verbose = 1;
    9299                else if( opt == 'I' )
    93                         conf->runmode=RUNMODE_INETD;
     100                        conf->runmode = RUNMODE_INETD;
    94101                else if( opt == 'D' )
    95                         conf->runmode=RUNMODE_DAEMON;
     102                        conf->runmode = RUNMODE_DAEMON;
     103                else if( opt == 'F' )
     104                        conf->runmode = RUNMODE_FORKDAEMON;
    96105                else if( opt == 'c' )
    97106                {
     
    101110                                CONF_FILE = g_strdup( optarg );
    102111                                g_free( conf );
     112                                /* Re-evaluate arguments. Don't use this option twice,
     113                                   you'll end up in an infinite loop! Hope this trick
     114                                   works with all libcs BTW.. */
     115                                optind = 1;
    103116                                return( conf_load( argc, argv ) );
    104117                        }
     
    118131                                "  -I  Classic/InetD mode. (Default)\n"
    119132                                "  -D  Daemon mode. (Still EXPERIMENTAL!)\n"
     133                                "  -F  Forking daemon. (one process per client)\n"
    120134                                "  -i  Specify the interface (by IP address) to listen on.\n"
    121135                                "      (Default: 0.0.0.0 (any interface))\n"
     
    157171                                if( g_strcasecmp( ini->value, "daemon" ) == 0 )
    158172                                        conf->runmode = RUNMODE_DAEMON;
     173                                else if( g_strcasecmp( ini->value, "forkdaemon" ) == 0 )
     174                                        conf->runmode = RUNMODE_FORKDAEMON;
    159175                                else
    160176                                        conf->runmode = RUNMODE_INETD;
     
    184200                        else if( g_strcasecmp( ini->key, "authpassword" ) == 0 )
    185201                        {
    186                                 conf->password = g_strdup( ini->value );
     202                                conf->auth_pass = g_strdup( ini->value );
     203                        }
     204                        else if( g_strcasecmp( ini->key, "operpassword" ) == 0 )
     205                        {
     206                                conf->oper_pass = g_strdup( ini->value );
    187207                        }
    188208                        else if( g_strcasecmp( ini->key, "hostname" ) == 0 )
Note: See TracChangeset for help on using the changeset viewer.