summaryrefslogtreecommitdiff
path: root/src/or/buffers.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-09-26 10:03:50 +0000
committerRoger Dingledine <arma@torproject.org>2003-09-26 10:03:50 +0000
commit9e5cafc395397426030e8098d64b8e25625863c5 (patch)
treea92b2c34d62a5673746387e1b10e42788e1838ef /src/or/buffers.c
parentdb2684149eb0b1528e0b545303ad4db69a0ed584 (diff)
downloadtor-9e5cafc395397426030e8098d64b8e25625863c5.tar.gz
tor-9e5cafc395397426030e8098d64b8e25625863c5.zip
first pass: obey log convention
ERR is if something fatal just happened WARNING is something bad happened, but we're still running. The bad thing is either a bug in the code, an attack or buggy protocol/implementation of the remote peer, etc. The operator should examine the bad thing and try to correct it. (No error or warning messages should be expected. I expect most people to run on -l warning eventually.) NOTICE is never ever used. INFO means something happened (maybe bad, maybe ok), but there's nothing you need to (or can) do about it. DEBUG is for everything louder than INFO. svn:r486
Diffstat (limited to 'src/or/buffers.c')
-rw-r--r--src/or/buffers.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c
index 6dd7185271..e23270e85e 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -221,7 +221,7 @@ int write_to_buf(const char *string, int string_len, buf_t *buf) {
/* this is the point where you would grow the buffer, if you want to */
if (string_len + buf->datalen > buf->len) { /* we're out of luck */
- log_fn(LOG_DEBUG, "buflen too small. Time to implement growing dynamic bufs.");
+ log_fn(LOG_WARNING, "buflen too small. Time to implement growing dynamic bufs.");
return -1;
}
@@ -280,11 +280,11 @@ int fetch_from_buf_http(buf_t *buf,
log_fn(LOG_DEBUG,"headerlen %d, bodylen %d.",headerlen,bodylen);
if(headers_out && max_headerlen <= headerlen) {
- log_fn(LOG_DEBUG,"headerlen %d larger than %d. Failing.", headerlen, max_headerlen-1);
+ log_fn(LOG_WARNING,"headerlen %d larger than %d. Failing.", headerlen, max_headerlen-1);
return -1;
}
if(body_out && max_bodylen <= bodylen) {
- log_fn(LOG_DEBUG,"bodylen %d larger than %d. Failing.", bodylen, max_bodylen-1);
+ log_fn(LOG_WARNING,"bodylen %d larger than %d. Failing.", bodylen, max_bodylen-1);
return -1;
}
@@ -346,33 +346,33 @@ int fetch_from_buf_socks(buf_t *buf,
socks4_info.destip = ntohl(*(uint32_t*)(buf->buf+4));
if(socks4_info.version != 4) {
- log_fn(LOG_NOTICE,"Unrecognized version %d.",socks4_info.version);
+ log_fn(LOG_WARNING,"Unrecognized version %d.",socks4_info.version);
return -1;
}
if(socks4_info.command != 1) { /* not a connect? we don't support it. */
- log_fn(LOG_NOTICE,"command %d not '1'.",socks4_info.command);
+ log_fn(LOG_WARNING,"command %d not '1'.",socks4_info.command);
return -1;
}
port = socks4_info.destport;
if(!port) {
- log_fn(LOG_NOTICE,"Port is zero.");
+ log_fn(LOG_WARNING,"Port is zero.");
return -1;
}
if(!socks4_info.destip) {
- log_fn(LOG_NOTICE,"DestIP is zero.");
+ log_fn(LOG_WARNING,"DestIP is zero.");
return -1;
}
if(socks4_info.destip >> 8) {
struct in_addr in;
- log_fn(LOG_NOTICE,"destip not in form 0.0.0.x.");
+ log_fn(LOG_DEBUG,"destip not in form 0.0.0.x.");
in.s_addr = htonl(socks4_info.destip);
tmpbuf = inet_ntoa(in);
if(max_addrlen <= strlen(tmpbuf)) {
- log_fn(LOG_DEBUG,"socks4 addr too long.");
+ log_fn(LOG_WARNING,"socks4 addr too long.");
return -1;
}
log_fn(LOG_DEBUG,"Successfully read destip (%s)", tmpbuf);
@@ -393,7 +393,7 @@ int fetch_from_buf_socks(buf_t *buf,
return 0;
}
if(max_addrlen <= next-startaddr) {
- log_fn(LOG_DEBUG,"Destaddr not here yet.");
+ log_fn(LOG_WARNING,"Destaddr too long.");
return -1;
}
}