Permalink
Browse files

Log dht messages and tweak debug levels

  • Loading branch information...
1 parent c7270ff commit 89bc5fbdfb636aa3940ad4964d906d87c14f5e03 @kerneis committed Aug 11, 2011
Showing with 8 additions and 4 deletions.
  1. +1 −1 hekate.man
  2. +3 −3 server.cpc
  3. +4 −0 tracker.cpc
View
2 hekate.man
@@ -44,7 +44,7 @@ Specify the maximum time for which a peer can remain unchoked before it is
considered for choking or dropping. The default is 300 (5 minutes).
.TP
.BI \-d " level"
-Specify the debug level. The default is 0. A value of 4 will display
+Specify the debug level. The default is 0. A value of 10 will display
every BitTorrent message sent or received.
.TP
.IR directory ...
View
6 server.cpc
@@ -72,7 +72,7 @@ send_message_2(int fd, int id,
struct iovec iov[3];
int i, rc;
- debugf(4, "%3d -> type = %d, length = %d\n",
+ debugf(10, "%3d -> type = %d, length = %d\n",
fd, id, bodylen1 + bodylen2 + 1);
DO_HTONL(buf, bodylen1 + bodylen2 + 1);
@@ -117,7 +117,7 @@ send_message_h(int fd, char *head, int headlen,
struct iovec iov[3];
int i, rc;
- debugf(4, "%3d -> h=%d, type = %d, length = %d\n",
+ debugf(10, "%3d -> h=%d, type = %d, length = %d\n",
fd, headlen, id, bodylen + 1);
DO_HTONL(buf, bodylen + 1);
@@ -789,7 +789,7 @@ stream_reader(int fd)
type = b->buf[b->start];
- debugf(4, "%3d <- type = %d, length = %d\n", fd, type, length);
+ debugf(10, "%3d <- type = %d, length = %d\n", fd, type, length);
if(type != 5 && type != 20 && length > 20) {
debugf(1, "%3d unbelievably long message!\n", fd);
View
4 tracker.cpc
@@ -44,6 +44,7 @@ THE SOFTWARE.
#include "torrent.h"
#include "server.h"
#include "tracker.h"
+#include "util.h"
char peer_id[21];
int notracker = 0, nodht = 0;
@@ -244,6 +245,9 @@ dht_loop(int dht_socket, int dht6_socket)
{
time_t tosleep = 0;
+ if(debug_level >= 5)
+ dht_debug = stderr;
+
while(1) {
int rc;
cpc_timeout *timeout;

0 comments on commit 89bc5fb

Please sign in to comment.