diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-01-07 08:09:27 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-01-07 08:09:27 -0500 |
commit | f2aeaaf71d2074019a7f50185f78a36dfb18b9e5 (patch) | |
tree | 6c3d1042005d06050f54faa86a6a449f005ef3c5 /src/core | |
parent | 1b63eea66cbb8793a3cff05de8d856ce3b93fc17 (diff) | |
download | tor-f2aeaaf71d2074019a7f50185f78a36dfb18b9e5.tar.gz tor-f2aeaaf71d2074019a7f50185f78a36dfb18b9e5.zip |
Add new state to connection_proxy_state_to_string()
Also, add a CTASSERT() to make sure that we don't let this array get
out-of-sync again.
Found by coverity; this is CID 1457528.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/mainloop/connection.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c index 15b0258037..6958d2085f 100644 --- a/src/core/mainloop/connection.c +++ b/src/core/mainloop/connection.c @@ -107,6 +107,7 @@ #include "lib/crypt_ops/crypto_util.h" #include "lib/geoip/geoip.h" +#include "lib/cc/ctassert.h" #include "lib/sandbox/sandbox.h" #include "lib/net/buffers_net.h" #include "lib/tls/tortls.h" @@ -2284,9 +2285,12 @@ connection_proxy_state_to_string(int state) "PROXY_SOCKS5_WANT_AUTH_METHOD_RFC1929", "PROXY_SOCKS5_WANT_AUTH_RFC1929_OK", "PROXY_SOCKS5_WANT_CONNECT_OK", + "PROXY_HAPROXY_WAIT_FOR_FLUSH", "PROXY_CONNECTED", }; + CTASSERT(ARRAY_LENGTH(states) == PROXY_CONNECTED+1); + if (state < PROXY_NONE || state > PROXY_CONNECTED) return unknown; |