[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r15179: Actually reinstate errors that did not work on windows, and (tor/trunk/src/or)



Author: nickm
Date: 2008-06-12 23:52:58 -0400 (Thu, 12 Jun 2008)
New Revision: 15179

Modified:
   tor/trunk/src/or/reasons.c
Log:
Actually reinstate errors that did not work on windows, and add a comment about reading the documentation of the S_CASE and E_CASE macros before adding new cases to the switch statements there.

Modified: tor/trunk/src/or/reasons.c
===================================================================
--- tor/trunk/src/or/reasons.c	2008-06-13 02:07:17 UTC (rev 15178)
+++ tor/trunk/src/or/reasons.c	2008-06-13 03:52:58 UTC (rev 15179)
@@ -148,6 +148,9 @@
 uint8_t
 errno_to_stream_end_reason(int e)
 {
+  /* To add new errors here, find out if they exist on Windows, and if a WSA*
+   * equivalent exists on windows. Add a case, an S_CASE, or an E_CASE as
+   * appropriate. */
   switch (e) {
     case EPIPE:
       return END_STREAM_REASON_DONE;
@@ -188,6 +191,9 @@
 const char *
 orconn_end_reason_to_control_string(int r)
 {
+  /* To add new errors here, find out if they exist on Windows, and if a WSA*
+   * equivalent exists on windows. Add a case, an S_CASE, or an E_CASE as
+   * appropriate. */
   switch (r) {
     case END_OR_CONN_REASON_DONE:
       return "DONE";
@@ -252,8 +258,8 @@
       return END_OR_CONN_REASON_DONE;
     S_CASE(ENOTCONN):
     S_CASE(ENETUNREACH):
-//    case ENETDOWN: /* << somebody should look into the Windows equiv */
-//    case EHOSTUNREACH:
+    S_CASE(ENETDOWN):
+    S_CASE(EHOSTUNREACH):
       return END_OR_CONN_REASON_NO_ROUTE;
     S_CASE(ECONNREFUSED):
       return END_OR_CONN_REASON_REFUSED;