Fix crash-on-wakeup bug in networkstatus download.

svn:r5144
This commit is contained in:
Nick Mathewson 2005-09-26 16:37:39 +00:00
parent 066b58438a
commit 126a1e3e32

View File

@ -296,6 +296,12 @@ connection_dir_request_failed(connection_t *conn)
static void static void
connection_dir_download_networkstatus_failed(connection_t *conn) 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")) { if (!strcmpstart(conn->requested_resource, "all")) {
/* We're a non-authoritative directory cache; try again. */ /* We're a non-authoritative directory cache; try again. */
directory_get_from_dirserver(conn->purpose, "all.z", directory_get_from_dirserver(conn->purpose, "all.z",