mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 12:23:32 +01:00
r13017@Kushana: nickm | 2007-05-20 13:40:45 -0400
Address points in r10227. svn:r10229
This commit is contained in:
parent
bc26f28865
commit
5364833be0
@ -385,11 +385,11 @@ mp_pool_clean(mp_pool_t *pool, int n)
|
|||||||
{
|
{
|
||||||
mp_chunk_t *chunk, **first_to_free;
|
mp_chunk_t *chunk, **first_to_free;
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
|
/* As said in the documentation, "negative n" means "leave an additional
|
||||||
|
* -n chunks". So replace n with a positive number. */
|
||||||
n = pool->min_empty_chunks + (-n);
|
n = pool->min_empty_chunks + (-n);
|
||||||
if (n < pool->n_empty_chunks)
|
if (n < pool->n_empty_chunks)
|
||||||
pool->min_empty_chunks = n;
|
pool->min_empty_chunks = n;
|
||||||
/* XXX020 don't we want some sort of return here, given the
|
|
||||||
* assert that follows? -RD */
|
|
||||||
}
|
}
|
||||||
ASSERT(n>=0);
|
ASSERT(n>=0);
|
||||||
|
|
||||||
|
@ -3119,9 +3119,7 @@ options_init_from_torrc(int argc, char **argv)
|
|||||||
|
|
||||||
if (argc > 1 && (!strcmp(argv[1],"--version"))) {
|
if (argc > 1 && (!strcmp(argv[1],"--version"))) {
|
||||||
char vbuf[128];
|
char vbuf[128];
|
||||||
// XXX020 below, tor_svn_revision will always be defined, right?
|
if (strlen(tor_svn_revision)) {
|
||||||
// So we can take out that check? Also in router.c. -RD
|
|
||||||
if (tor_svn_revision != NULL && strlen(tor_svn_revision)) {
|
|
||||||
tor_snprintf(vbuf, sizeof(vbuf), " (r%s)", tor_svn_revision);
|
tor_snprintf(vbuf, sizeof(vbuf), " (r%s)", tor_svn_revision);
|
||||||
} else {
|
} else {
|
||||||
vbuf[0] = 0;
|
vbuf[0] = 0;
|
||||||
|
@ -562,6 +562,9 @@ dns_resolve(edge_connection_t *exitconn)
|
|||||||
if (!exitconn->_base.marked_for_close) {
|
if (!exitconn->_base.marked_for_close) {
|
||||||
connection_free(TO_CONN(exitconn));
|
connection_free(TO_CONN(exitconn));
|
||||||
//XXX020 ... and we just leak exitconn otherwise? -RD
|
//XXX020 ... and we just leak exitconn otherwise? -RD
|
||||||
|
// If it's marked for close, it's on closeable_connection_lst in
|
||||||
|
// main.c. If it's on the closeable list, it will get freed from
|
||||||
|
// main.c. -NM
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1249,8 +1249,7 @@ void
|
|||||||
get_platform_str(char *platform, size_t len)
|
get_platform_str(char *platform, size_t len)
|
||||||
{
|
{
|
||||||
char svn_version_buf[128];
|
char svn_version_buf[128];
|
||||||
if (!strcmpend(VERSION, "-dev") &&
|
if (!strcmpend(VERSION, "-dev") && strlen(tor_svn_revision)) {
|
||||||
tor_svn_revision != NULL && strlen(tor_svn_revision)) {
|
|
||||||
tor_snprintf(svn_version_buf, sizeof(svn_version_buf), " (r%s)",
|
tor_snprintf(svn_version_buf, sizeof(svn_version_buf), " (r%s)",
|
||||||
tor_svn_revision);
|
tor_svn_revision);
|
||||||
} else {
|
} else {
|
||||||
|
@ -4856,8 +4856,8 @@ routerinfo_incompatible_with_extrainfo(routerinfo_t *ri, extrainfo_t *ei)
|
|||||||
if (ei->bad_sig)
|
if (ei->bad_sig)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* XXX020 below we should explain why this is strcmp and not strcasecmp,
|
/* The nickname must match exactly to have been generated at the same time
|
||||||
* since it differs from how we usually compare nicknames. -RD */
|
* by the same rotuer. */
|
||||||
if (strcmp(ri->nickname, ei->nickname) ||
|
if (strcmp(ri->nickname, ei->nickname) ||
|
||||||
memcmp(ri->cache_info.identity_digest, ei->cache_info.identity_digest,
|
memcmp(ri->cache_info.identity_digest, ei->cache_info.identity_digest,
|
||||||
DIGEST_LEN))
|
DIGEST_LEN))
|
||||||
|
@ -2142,8 +2142,6 @@ tokenize_string(const char *start, const char *end, smartlist_t *out,
|
|||||||
for (i = 0; table[i].t; ++i) {
|
for (i = 0; table[i].t; ++i) {
|
||||||
if (counts[table[i].v] < table[i].min_cnt) {
|
if (counts[table[i].v] < table[i].min_cnt) {
|
||||||
log_warn(LD_DIR, "Parse error: missing %s element.", table[i].t);
|
log_warn(LD_DIR, "Parse error: missing %s element.", table[i].t);
|
||||||
tor_assert(0); /* XXX020 is this assert a remote crash waiting to
|
|
||||||
* happen? -RD */
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (counts[table[i].v] > table[i].max_cnt) {
|
if (counts[table[i].v] > table[i].max_cnt) {
|
||||||
|
Loading…
Reference in New Issue
Block a user