diff options
author | Roger Dingledine <arma@torproject.org> | 2004-09-29 06:52:36 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-09-29 06:52:36 +0000 |
commit | 136d4e573913480491e0c45ffe7ff6450cb107af (patch) | |
tree | 000b359e41d9c491f629831db2fe45af89d4448f /src/or/directory.c | |
parent | 6ed095b17769c56d8bd5c92d080e2a839c04b9e5 (diff) | |
download | tor-136d4e573913480491e0c45ffe7ff6450cb107af.tar.gz tor-136d4e573913480491e0c45ffe7ff6450cb107af.zip |
prefer tor_free to free
plus complain more loudly when we fail to parse a dir we just fetched
svn:r2401
Diffstat (limited to 'src/or/directory.c')
-rw-r--r-- | src/or/directory.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 3d0c2005e6..62958d5790 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -400,7 +400,7 @@ connection_dir_client_reached_eof(connection_t *conn) if(parse_http_response(headers, &status_code, NULL, &date_header, &compression) < 0) { log_fn(LOG_WARN,"Unparseable headers. Closing."); - free(body); free(headers); + tor_free(body); tor_free(headers); return -1; } if (date_header > 0) { @@ -433,17 +433,17 @@ connection_dir_client_reached_eof(connection_t *conn) log_fn(LOG_INFO,"Received directory (size %d):\n%s", body_len, body); if(status_code == 503 || body_len == 0) { log_fn(LOG_INFO,"Empty directory. Ignoring."); - free(body); free(headers); + tor_free(body); tor_free(headers); return 0; } if(status_code != 200) { log_fn(LOG_WARN,"Received http status code %d from dirserver. Failing.", status_code); - free(body); free(headers); + tor_free(body); tor_free(headers); return -1; } if(router_load_routerlist_from_directory(body, NULL) < 0){ - log_fn(LOG_INFO,"...but parsing failed. Ignoring."); + log_fn(LOG_WARN,"I failed to parse the directory I fetched from %s:%d. Ignoring.", conn->address, conn->port); } else { log_fn(LOG_INFO,"updated routers."); } @@ -458,12 +458,12 @@ connection_dir_client_reached_eof(connection_t *conn) if(status_code != 200) { log_fn(LOG_WARN,"Received http status code %d from dirserver. Failing.", status_code); - free(body); free(headers); + tor_free(body); tor_free(headers); return -1; } if (!(rrs = router_parse_runningrouters(body))) { log_fn(LOG_WARN, "Can't parse runningrouters list"); - free(body); free(headers); + tor_free(body); tor_free(headers); return -1; } router_get_routerlist(&rl); @@ -526,7 +526,7 @@ connection_dir_client_reached_eof(connection_t *conn) break; } } - free(body); free(headers); + tor_free(body); tor_free(headers); return 0; } |