aboutsummaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-09-27 06:00:43 +0000
committerRoger Dingledine <arma@torproject.org>2004-09-27 06:00:43 +0000
commita2517b4f0777c961843f3dc65107e9d3ce6b3846 (patch)
treebb62e7bf322540a7f0db52fd38e77248e46af0ab /src/or/directory.c
parenta64d0933396aa2eb52e23c82d4f6ae4f6b237187 (diff)
downloadtor-a2517b4f0777c961843f3dc65107e9d3ce6b3846.tar.gz
tor-a2517b4f0777c961843f3dc65107e9d3ce6b3846.zip
checking only 0.0.7 and 0.0.8 didn't work, because some dirservers
files have really old descriptors for the authdirservers, so we're asking them in the new format because they're too old. now we actually compare the version to a cutoff version, and act appropriately. also take this chance to use only >=0.0.8 servers for dns resolves, because of the recent bugs. we'll bump to >=0.0.9pre1 once there are some servers running that. svn:r2380
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 278b042df3..d7b47c73e2 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -214,20 +214,22 @@ static void directory_send_command(connection_t *conn, int purpose,
char fetchrunninglist[] = "GET /tor/running-routers HTTP/1.0\r\n\r\n";
char tmp[8192];
routerinfo_t *router;
+ int use_newer = 0;
tor_assert(conn && conn->type == CONN_TYPE_DIR);
router = router_get_by_digest(conn->identity_digest);
tor_assert(router); /* the func that calls us found it, so we should too */
+ use_newer = tor_version_as_new_as(router->platform, "0.0.9pre1");
+
switch(purpose) {
case DIR_PURPOSE_FETCH_DIR:
tor_assert(payload == NULL);
- if (!strcmpstart(router->platform, "Tor 0.0.7") ||
- !strcmpstart(router->platform, "Tor 0.0.8"))
- connection_write_to_buf(fetchwholedir, strlen(fetchwholedir), conn);
- else
+ if(use_newer)
connection_write_to_buf(fetchwholedir_z, strlen(fetchwholedir_z), conn);
+ else
+ connection_write_to_buf(fetchwholedir, strlen(fetchwholedir), conn);
break;
case DIR_PURPOSE_FETCH_RUNNING_LIST:
tor_assert(payload == NULL);
@@ -236,7 +238,7 @@ static void directory_send_command(connection_t *conn, int purpose,
case DIR_PURPOSE_UPLOAD_DIR:
tor_assert(payload);
snprintf(tmp, sizeof(tmp), "POST %s/ HTTP/1.0\r\nContent-Length: %d\r\n\r\n",
- strcmpstart(router->platform, "Tor 0.0.8") ? "/tor" : "",
+ use_newer ? "/tor" : "",
payload_len);
connection_write_to_buf(tmp, strlen(tmp), conn);
connection_write_to_buf(payload, payload_len, conn);