V(TransPort, PORT, "0"),
V(TunnelDirConns, BOOL, "1"),
V(UpdateBridgesFromAuthority, BOOL, "0"),
- VAR("UseBridges", STRING, UseBridges_, "auto"),
+ VAR("UseBridges", AUTOBOOL, UseBridges_, "auto"),
V(UseEntryGuards, BOOL, "1"),
V(UseMicrodescriptors, AUTOBOOL, "0"),
V(User, STRING, NULL),
"of the Internet, so they must not set Reachable*Addresses "
"or FascistFirewall.");
- /* XXX023 use autobool instead. */
- if (!strcmp(options->UseBridges_, "auto")) {
+ if (options->UseBridges_ == -1) {
options->UseBridges = (options->Bridges &&
!server_mode(options) &&
!options->EntryNodes);
- } else if (!strcmp(options->UseBridges_, "0")) {
- options->UseBridges = 0;
- } else if (!strcmp(options->UseBridges_, "1")) {
- options->UseBridges = 1;
} else {
- REJECT("UseBridges must be 0, 1, or auto");
+ options->UseBridges = options->UseBridges_;
}
if (options->UseBridges &&
* when doing so. */
char *BridgePassword;
- /** Whether we should start all circuits with a bridge. "1" means strictly
- * yes, "0" means strictly no, and "auto" means that we do iff any bridges
- * are configured, we are not running a server and have not specified a list
- * of entry nodes. */
- char *UseBridges_;
+ /** Whether we should start all circuits with a bridge. This is an
+ * "autobool": 1 means strictly yes, 0 means strictly no, and -1 means that
+ * we do iff any bridges are configured, we are not running a server and
+ * have not specified a list of entry nodes. Don't use this value directly;
+ * use <b>UseBridges</b> instead. */
+ int UseBridges_;
/** Effective value of UseBridges. Will be set equally for UseBridges set to
* 1 or 0, but for 'auto' it will be set to 1 iff any bridges are
* configured, we are not running a server and have not specified a list of