[or-cvs] make OR not crash when non-OR connection dies

Roger Dingledine arma at seul.org
Sat Mar 20 20:37:51 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	rephist.c 
Log Message:
make OR not crash when non-OR connection dies


Index: rephist.c
===================================================================
RCS file: /home/or/cvsroot/src/or/rephist.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- rephist.c	20 Mar 2004 04:59:29 -0000	1.2
+++ rephist.c	20 Mar 2004 20:37:49 -0000	1.3
@@ -131,6 +131,14 @@
 void rep_hist_note_connection_died(const char* nickname, time_t when)
 {
   or_history_t *hist;
+  if(!nickname) {
+    /* XXX
+     * If conn has no nickname, it's either an OP, or it is an OR
+     * which didn't complete its handshake (or did and was unapproved).
+     * Ignore it. Is there anything better we could do?
+     */
+    return;
+  }
   hist = get_or_history(nickname);
   if (hist->up_since) {
     hist->uptime += (when - hist->up_since);



More information about the tor-commits mailing list