summaryrefslogtreecommitdiff
path: root/src/test/test_pt.c
diff options
context:
space:
mode:
authorCecylia Bocovich <cohosh@torproject.org>2021-11-19 14:50:36 -0500
committerCecylia Bocovich <cohosh@torproject.org>2021-11-19 14:50:36 -0500
commit809b636b6ec9039262c1feb874a9d167046bf515 (patch)
tree9c5d63ceeca7a8c474c80cffa8687a4043de9b3f /src/test/test_pt.c
parent9d8b0c5bdc6f75891440dbe53e2572bf54e74aef (diff)
downloadtor-809b636b6ec9039262c1feb874a9d167046bf515.tar.gz
tor-809b636b6ec9039262c1feb874a9d167046bf515.zip
Don't kill managed proxy on method error
Some PT applications support more than one transport. For example, obfs4proxy supports obfs4, obfs3, and meek. If one or more transports specified in the torrc file are supported, we shouldn't kill the managed proxy on a {C,S}METHOD-ERROR. Instead, we should log a warning. We were already logging warnings on method errors. This change just makes sure that the managed proxy isn't killed, and then if no transports are configured for the managed proxy, bumps the log level up from a notice to a warning. Closes #7362
Diffstat (limited to 'src/test/test_pt.c')
-rw-r--r--src/test/test_pt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/test_pt.c b/src/test/test_pt.c
index 27e74d5ebf..07c5032933 100644
--- a/src/test/test_pt.c
+++ b/src/test/test_pt.c
@@ -233,6 +233,10 @@ test_pt_protocol(void *arg)
handle_proxy_line(line, mp);
tt_assert(mp->conf_state == PT_PROTO_ACCEPTING_METHODS);
+ strlcpy(line,"CMETHOD-ERROR fakename not supported",sizeof(line));
+ handle_proxy_line(line, mp);
+ tt_assert(mp->conf_state == PT_PROTO_ACCEPTING_METHODS);
+
strlcpy(line,"CMETHODS DONE",sizeof(line));
handle_proxy_line(line, mp);
tt_assert(mp->conf_state == PT_PROTO_CONFIGURED);