Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-auto-reauth 配置项的逻辑判断有问题 #43

Open
moeray opened this issue Apr 24, 2019 · 4 comments
Open

no-auto-reauth 配置项的逻辑判断有问题 #43

moeray opened this issue Apr 24, 2019 · 4 comments

Comments

@moeray
Copy link

moeray commented Apr 24, 2019

当配置文件中不存在"no-auto-reauth"时程序才能正常掉线重新认证.反之无论no-auto-reauth=0还是no-auto-reauth=1,程序都会掉线后自动退出

@ysc3839
Copy link
Contributor

ysc3839 commented Apr 25, 2019

minieap/config.c

Lines 149 to 150 in bf4f1b4

} else if (ISOPT("no-auto-reauth")) {
g_prog_config.restart_on_logoff = 0;

应该是这里的问题

@updateing
Copy link
Owner

设计上这个参数确实就是不带值的,只要有就生效。

config.c:

        "\t--stage-timeout, -t <num>\t单个认证阶段的超时时间 [默认" STR(DEFAULT_STAGE_TIMEOUT) "]\n"
        "\t--wait-after-fail, -r <num>\t认证失败后重新认证前的等待时间(但当服务器要求重新认证时将直接开始认证)[默认" STR(DEFAULT_WAIT_AFTER_FAIL_SECS) "]\n"
        "\t--max-fail, -l <num>\t最大允许认证失败次数 [默认" STR(DEFAULT_MAX_FAILURES) "]\n"
        "\t--no-auto-reauth, -x\t认证掉线后不允许自动重连 [默认" STR(DEFAULT_RESTART_ON_LOGOFF) "]\n"
        "\t--daemonize, -b <0-3>\t后台运行方式: [默认0]\n"

@ysc3839
Copy link
Contributor

ysc3839 commented Apr 26, 2019

@updateing
但是生成配置文件时是有的。

conf_parser_add_value("no-auto-reauth", g_prog_config.restart_on_logoff ? "0" : "1");

@updateing
Copy link
Owner

这是一个复制粘贴没过脑子的例子…… 现在这样也只能靠 =0 时加个判断来挽救了😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants