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

[or-cvs] Fix crash-on-wakeup bug in networkstatus download.



Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv22626/src/or

Modified Files:
	directory.c 
Log Message:
Fix crash-on-wakeup bug in networkstatus download.

Index: directory.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/directory.c,v
retrieving revision 1.290
retrieving revision 1.291
diff -u -d -r1.290 -r1.291
--- directory.c	23 Sep 2005 21:25:29 -0000	1.290
+++ directory.c	26 Sep 2005 16:37:39 -0000	1.291
@@ -296,6 +296,12 @@
 static void
 connection_dir_download_networkstatus_failed(connection_t *conn)
 {
+  if (!conn->requested_resource) {
+    /* We never reached directory_send_command, which means that we never
+     * opened a network connection.  Either we're out of sockets, or the
+     * network is down.  Either way, retrying would be pointless. */
+    return;
+  }
   if (!strcmpstart(conn->requested_resource, "all")) {
     /* We're a non-authoritative directory cache; try again. */
     directory_get_from_dirserver(conn->purpose, "all.z",