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

[or-cvs] r8747: Another patch from Mike Perry; sprintfing a NULL pointer. (w (in tor/trunk: . src/or)



Author: nickm
Date: 2006-10-18 11:41:46 -0400 (Wed, 18 Oct 2006)
New Revision: 8747

Modified:
   tor/trunk/
   tor/trunk/src/or/command.c
   tor/trunk/src/or/control.c
Log:
 r9077@totoro:  nickm | 2006-10-18 11:41:16 -0400
 Another patch from Mike Perry; sprintfing a NULL pointer. (with comment).



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r9077] on 96637b51-b116-0410-a10e-9941ebb49b64

Modified: tor/trunk/src/or/command.c
===================================================================
--- tor/trunk/src/or/command.c	2006-10-18 14:08:40 UTC (rev 8746)
+++ tor/trunk/src/or/command.c	2006-10-18 15:41:46 UTC (rev 8747)
@@ -384,7 +384,16 @@
           reason == END_CIRC_REASON_REQUESTED) {
         /* XXXX This logic is wrong.  Really, we should report the fact that
          * the circuit was closed because of a DESTROY, *and* we should report
-         * the reason that we were given. -NM */
+         * the reason that we were given. -NM
+         *   Hrmm. We could store the fact that we sent a truncate and the
+         * reason for this truncate in circuit_t. If we ever get a destroy
+         * that doesn't match this reason, we could complain loudly -MP
+         *   That won't work for the cases where the destroy is not because of
+         * a truncate, though.  The idea is that if we get a DESTROYED cell
+         * with reason 'CONNECTFAILED' and another DESTROYED cell with reason
+         * 'RESOURCELIMIT', the controller may want to know the reported
+         * reason. -NM
+         */
         reason = END_CIRC_REASON_DESTROYED;
       }
       circuit_mark_for_close(circ, reason);

Modified: tor/trunk/src/or/control.c
===================================================================
--- tor/trunk/src/or/control.c	2006-10-18 14:08:40 UTC (rev 8746)
+++ tor/trunk/src/or/control.c	2006-10-18 15:41:46 UTC (rev 8747)
@@ -2837,7 +2837,7 @@
       return "REASON=NOSUCHSERVICE";
     default:
       log_warn(LD_BUG, "Unrecognized reason code %d", (int)reason);
-      return NULL;
+      return "REASON=UNRECOGNIZED"; /* should never get called */
   }
 }