]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Don't warn on http connection to my orport
authorSebastian Hahn <sebastian@torproject.org>
Thu, 11 Aug 2011 18:37:51 +0000 (20:37 +0200)
committerSebastian Hahn <sebastian@torproject.org>
Thu, 11 Aug 2011 18:37:51 +0000 (20:37 +0200)
Also remove a few other related warnings that could occur during the ssl
handshake. We do this because the relay operator can't do anything about
them, and they aren't their fault.

changes/bug3700 [new file with mode: 0644]
src/common/tortls.c

diff --git a/changes/bug3700 b/changes/bug3700
new file mode 100644 (file)
index 0000000..cef7296
--- /dev/null
@@ -0,0 +1,6 @@
+  o Minor bugfixes:
+    - Get rid of a harmless warning that could happen on relays running
+      with bufferevents. The warning was caused by someone doing an http
+      request to a relay's orport. Also don't warn for a few related
+      non-errors. Fixes bug 3700; bugfix on 0.2.3.1-alpha.
+
index 21f2c5072b3312ac25de31508ed734a8df4e30ef..455603030ff908d5814c4b61d46c439015d97b00 100644 (file)
@@ -273,6 +273,22 @@ tor_tls_log_one_error(tor_tls_t *tls, unsigned long err,
 
   addr = tls ? tls->address : NULL;
 
+  /* Some errors are known-benign, meaning they are the fault of the other
+   * side of the connection. The caller doesn't know this, so override the
+   * priority for those cases. */
+  switch (ERR_GET_REASON(err)) {
+    case SSL_R_HTTP_REQUEST:
+    case SSL_R_HTTPS_PROXY_REQUEST:
+    case SSL_R_RECORD_LENGTH_MISMATCH:
+    case SSL_R_RECORD_TOO_LARGE:
+    case SSL_R_UNKNOWN_PROTOCOL:
+    case SSL_R_UNSUPPORTED_PROTOCOL:
+      severity = LOG_INFO;
+      break;
+    default:
+      break;
+  }
+
   msg = (const char*)ERR_reason_error_string(err);
   lib = (const char*)ERR_lib_error_string(err);
   func = (const char*)ERR_func_error_string(err);