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.
This commit is contained in:
Nick Mathewson 2012-05-16 12:31:45 -04:00
parent 75fc4dbbca
commit 2b6e91c2ee
2 changed files with 7 additions and 0 deletions

5
changes/bug4710 Normal file
View File

@ -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.

View File

@ -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: