miniupnpd: define min/max_lifetime only when needed
This commit is contained in:
parent
3712118bc4
commit
f6b5408e87
|
@ -908,12 +908,14 @@ init(int argc, char * * argv, struct runtime_vars * v)
|
|||
optionsfile);
|
||||
}
|
||||
}
|
||||
/* if lifetimes ae inverse*/
|
||||
#ifdef ENABLE_PCP
|
||||
/* if lifetimes are inverse */
|
||||
if (min_lifetime >= max_lifetime) {
|
||||
fprintf(stderr, "Minimum lifetime (%lu) is greater than or equal to maximum lifetime (%lu).\n", min_lifetime, max_lifetime);
|
||||
fprintf(stderr, "Check your configuration file.\n");
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif /* DISABLE_CONFIG_FILE */
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* $Id: upnpglobalvars.c,v 1.32 2013/12/13 14:07:09 nanard Exp $ */
|
||||
/* $Id: upnpglobalvars.c,v 1.33 2014/02/03 08:37:32 nanard Exp $ */
|
||||
/* MiniUPnP project
|
||||
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
||||
* (c) 2006-2012 Thomas Bernard
|
||||
* (c) 2006-2014 Thomas Bernard
|
||||
* This software is subject to the conditions detailed
|
||||
* in the LICENCE file provided within the distribution */
|
||||
|
||||
|
@ -33,8 +33,11 @@ unsigned long upstream_bitrate = 0;
|
|||
/* startup time */
|
||||
time_t startup_time = 0;
|
||||
|
||||
#ifdef ENABLE_PCP
|
||||
/* for PCP */
|
||||
unsigned long int min_lifetime = 120;
|
||||
unsigned long int max_lifetime = 86400;
|
||||
#endif
|
||||
|
||||
int runtime_flags = 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue