aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-03-20 20:37:49 +0000
committerRoger Dingledine <arma@torproject.org>2004-03-20 20:37:49 +0000
commited0ef86c0ee71475ffceb3aef32d60a886e7e436 (patch)
treed7750bfaeb920d15e38c23f5b735d628d54dfbda /src/or
parent568a4e0a0499233c6d8bf07c01903ca9f21361c6 (diff)
downloadtor-ed0ef86c0ee71475ffceb3aef32d60a886e7e436.tar
tor-ed0ef86c0ee71475ffceb3aef32d60a886e7e436.tar.gz
make OR not crash when non-OR connection dies
svn:r1319
Diffstat (limited to 'src/or')
-rw-r--r--src/or/rephist.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c
index ab03fab09..998758164 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -131,6 +131,14 @@ void rep_hist_note_disconnect(const char* nickname, time_t when)
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);