aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-07-06 02:44:07 +0000
committerRoger Dingledine <arma@torproject.org>2006-07-06 02:44:07 +0000
commitfad85f173a6a271af5ebbebffb778426febbce61 (patch)
treeb0063651a95606839d164d8dbfbc47936f179114 /src/common/util.c
parent3c4205c8724f6eb01dedc1ff6bbdd7f756320a4d (diff)
downloadtor-fad85f173a6a271af5ebbebffb778426febbce61.tar
tor-fad85f173a6a271af5ebbebffb778426febbce61.tar.gz
when an exit node gets a malformed begin cell, don't complain to
the node operator, since he can't do anything about it. svn:r6733
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 33ce40d16..e80a15c64 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -1486,8 +1486,8 @@ is_local_IP(uint32_t ip)
* Return 0 on success, -1 on failure.
*/
int
-parse_addr_port(const char *addrport, char **address, uint32_t *addr,
- uint16_t *port_out)
+parse_addr_port(int severity, const char *addrport, char **address,
+ uint32_t *addr, uint16_t *port_out)
{
const char *colon;
char *_address = NULL;
@@ -1501,14 +1501,14 @@ parse_addr_port(const char *addrport, char **address, uint32_t *addr,
_address = tor_strndup(addrport, colon-addrport);
_port = (int) tor_parse_long(colon+1,10,1,65535,NULL,NULL);
if (!_port) {
- log_warn(LD_GENERAL, "Port %s out of range", escaped(colon+1));
+ log_fn(severity, LD_GENERAL, "Port %s out of range", escaped(colon+1));
ok = 0;
}
if (!port_out) {
char *esc_addrport = esc_for_log(addrport);
- log_warn(LD_GENERAL,
- "Port %s given on %s when not required",
- escaped(colon+1), esc_addrport);
+ log_fn(severity, LD_GENERAL,
+ "Port %s given on %s when not required",
+ escaped(colon+1), esc_addrport);
tor_free(esc_addrport);
ok = 0;
}
@@ -1520,7 +1520,7 @@ parse_addr_port(const char *addrport, char **address, uint32_t *addr,
if (addr) {
/* There's an addr pointer, so we need to resolve the hostname. */
if (tor_lookup_hostname(_address,addr)) {
- log_warn(LD_NET, "Couldn't look up %s", escaped(_address));
+ log_fn(severity, LD_NET, "Couldn't look up %s", escaped(_address));
ok = 0;
*addr = 0;
}