[tor-commits] [tor/master] Report EADDRNOTAVAIL and EADDRINUSE as RESOURCELIMIT

nickm at torproject.org nickm at torproject.org
Tue Jun 5 14:21:46 UTC 2012


commit 2b6e91c2ee4f89c0ee31c83c3a5e5414fd2b3d40
Author: Nick Mathewson <nickm at torproject.org>
Date:   Wed May 16 12:31:45 2012 -0400

    Report EADDRNOTAVAIL and EADDRINUSE as RESOURCELIMIT
    
    These errors usually mean address exhaustion; reporting them as such
    lets clients adjust their load to try other exits.
    
    Fix for bug 4710; bugfix on 0.1.0.1-rc, which started using
    END_STREAM_REASON_RESOURCELIMIT.
---
 changes/bug4710  |    5 +++++
 src/or/reasons.c |    2 ++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/changes/bug4710 b/changes/bug4710
new file mode 100644
index 0000000..7f94b4d
--- /dev/null
+++ b/changes/bug4710
@@ -0,0 +1,5 @@
+  o Minor bugfixes:
+    - Exit nodes now correcly report EADDRINUSE and EADDRNOTAVAIL as
+      resource exhaustion, so that clients can adjust their load to
+      try other exits. Fix for bug 4710; bugfix on 0.1.0.1-rc, which
+      started using END_STREAM_REASON_RESOURCELIMIT.
diff --git a/src/or/reasons.c b/src/or/reasons.c
index 319e6c0..67abc35 100644
--- a/src/or/reasons.c
+++ b/src/or/reasons.c
@@ -184,6 +184,8 @@ errno_to_stream_end_reason(int e)
     S_CASE(ENOBUFS):
     case ENOMEM:
     case ENFILE:
+    S_CASE(EADDRINUSE):
+    S_CASE(EADDRNOTAVAIL):
     E_CASE(EMFILE):
       return END_STREAM_REASON_RESOURCELIMIT;
     default:





More information about the tor-commits mailing list