diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2023-02-12 00:04:50 +0100 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2023-02-12 00:04:50 +0100 |
commit | 75af3d9de2fd45cdc5ba1b6427bba725c56f4fd7 (patch) | |
tree | 7a77a206dc399839dc75fc1a3bb8279413800302 /src/main.c | |
parent | lepši makefile (diff) | |
download | travnik-75af3d9de2fd45cdc5ba1b6427bba725c56f4fd7.tar travnik-75af3d9de2fd45cdc5ba1b6427bba725c56f4fd7.tar.gz travnik-75af3d9de2fd45cdc5ba1b6427bba725c56f4fd7.tar.bz2 travnik-75af3d9de2fd45cdc5ba1b6427bba725c56f4fd7.tar.lz travnik-75af3d9de2fd45cdc5ba1b6427bba725c56f4fd7.tar.xz travnik-75af3d9de2fd45cdc5ba1b6427bba725c56f4fd7.tar.zst travnik-75af3d9de2fd45cdc5ba1b6427bba725c56f4fd7.zip |
Diffstat (limited to '')
-rw-r--r-- | src/main.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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) { |