[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r13663: maybe appease the overflow detectors more (in tor/trunk/src: common or)
Author: arma
Date: 2008-02-21 16:56:04 -0500 (Thu, 21 Feb 2008)
New Revision: 13663
Modified:
tor/trunk/src/common/container.h
tor/trunk/src/or/connection_edge.c
Log:
maybe appease the overflow detectors more
Modified: tor/trunk/src/common/container.h
===================================================================
--- tor/trunk/src/common/container.h 2008-02-21 21:15:31 UTC (rev 13662)
+++ tor/trunk/src/common/container.h 2008-02-21 21:56:04 UTC (rev 13663)
@@ -292,7 +292,6 @@
MAP_FOREACH_MODIFY(strmap_, map, const char *, keyvar, valtype, valvar)
#define STRMAP_FOREACH_END MAP_FOREACH_END
-
void* strmap_set_lc(strmap_t *map, const char *key, void *val);
void* strmap_get_lc(const strmap_t *map, const char *key);
void* strmap_remove_lc(strmap_t *map, const char *key);
Modified: tor/trunk/src/or/connection_edge.c
===================================================================
--- tor/trunk/src/or/connection_edge.c 2008-02-21 21:15:31 UTC (rev 13662)
+++ tor/trunk/src/or/connection_edge.c 2008-02-21 21:56:04 UTC (rev 13663)
@@ -842,8 +842,8 @@
ent->expires = time(NULL) + MAX_DNS_ENTRY_AGE;
strmap_set(addressmap,address,ent);
}
- if (++ent->num_resolve_failures < 0) /* overflow. */
- ent->num_resolve_failures = SHORT_MAX;
+ if (ent->num_resolve_failures < SHORT_MAX)
+ ++ent->num_resolve_failures; /* don't overflow */
log_info(LD_APP, "Address %s now has %d resolve failures.",
safe_str(address), ent->num_resolve_failures);
return ent->num_resolve_failures;