summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 4e9c188..de21f7a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -45,7 +45,7 @@ void found_torrent (struct dht * d __attribute__((unused)), const unsigned char
L(debug, d, "%s%s", buf, t ? " stored" : " new");
if (t) {
if (!t->type)
- t->ttl = seconds()+128;
+ t->ttl = seconds()+256;
t->type |= info | peers;
} else {
if (last_added + 1 > seconds()) {
@@ -56,7 +56,7 @@ void found_torrent (struct dht * d __attribute__((unused)), const unsigned char
t = torrent_init();
memcpy(t->hash, h, 20);
t->type |= info | peers;
- t->ttl = seconds()+128;
+ t->ttl = seconds()+256;
add_torrent(d, t);
}
}
@@ -135,6 +135,7 @@ int main (int argc, char ** argv) {
struct torrent * torrent = torrent_init();
memcpy(torrent->hash, "\xdd\x82\x55\xec\xdc\x7c\xa5\x5f\xb0\xbb\xf8\x13\x23\xd8\x70\x62\xdb\x1f\x6d\x1c", 20);
torrent->type = /* (useless, since we have no listening system yet) announce | */ peers | info;
+ torrent->ttl = seconds()+128; /**< idk, enough to bootstrap i guess */
add_torrent(dht, torrent);
periodic(dht);
// alarm(PERIODIC);
@@ -143,6 +144,7 @@ w:
if (sigusr1) {
sigusr1 = 0;
dht_print(stdout, dht);
+ fflush(stdout);
goto w;
}
if (periodično) {
@@ -160,6 +162,7 @@ w:
if (sigusr1) {
sigusr1 = 0;
dht_print(stdout, dht);
+ fflush(stdout);
goto w;
}
if (periodično) {