summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2024-02-06 17:27:02 +0100
committerAnton Luka Šijanec <anton@sijanec.eu>2024-02-06 17:27:02 +0100
commitfe476404b4ce134c946d1754d2652461340c1186 (patch)
tree789f9f4fdd656b861e607ebc5ffd7e5c5fbb8deb /src
parentMerge branch 'master' of ssh://ni.sijanec.eu/var/lib/git/sijanec/travnik (diff)
downloadtravnik-fe476404b4ce134c946d1754d2652461340c1186.tar
travnik-fe476404b4ce134c946d1754d2652461340c1186.tar.gz
travnik-fe476404b4ce134c946d1754d2652461340c1186.tar.bz2
travnik-fe476404b4ce134c946d1754d2652461340c1186.tar.lz
travnik-fe476404b4ce134c946d1754d2652461340c1186.tar.xz
travnik-fe476404b4ce134c946d1754d2652461340c1186.tar.zst
travnik-fe476404b4ce134c946d1754d2652461340c1186.zip
Diffstat (limited to '')
-rw-r--r--src/dht.c1
-rw-r--r--src/main.c2
-rw-r--r--src/metainfo.c3
-rw-r--r--src/metainfo.h2
4 files changed, 5 insertions, 3 deletions
diff --git a/src/dht.c b/src/dht.c
index 513a66f..0670f34 100644
--- a/src/dht.c
+++ b/src/dht.c
@@ -2411,6 +2411,7 @@ void periodic (struct dht * d) {
if (errno != EINPROGRESS) {
L(std_fail, d, "connect: %s", strerror(errno));
disconnect(t);
+ continue; // i think this is reasonable, but this was added when i forgot how the code works. coredump without continue in /mnt/slu/a/tmp/coredump2024/
}
}
t->time = seconds();
diff --git a/src/main.c b/src/main.c
index bcf7f98..df3d67b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -144,7 +144,7 @@ int main (int argc, char ** argv) {
dht->pollfds = &pollfds;
dht->pollfds_size = &pollfds_size;
dht->nfds = &nfds;
- dht->verbosity |= (getenv("TRAVNIK_INCOMING_DHT") ? incoming_dht : 0) | (getenv("TRAVNIK_OUTGOING_DHT") ? outgoing_dht : 0) | (getenv("TRAVNIK_DEBUG") ? debug : 0) | (getenv("TRAVNIK_EXŠECTED") ? expected : 0);
+ dht->verbosity |= (getenv("TRAVNIK_INCOMING_DHT") ? incoming_dht : 0) | (getenv("TRAVNIK_OUTGOING_DHT") ? outgoing_dht : 0) | (getenv("TRAVNIK_DEBUG") ? debug : 0) | (getenv("TRAVNIK_EXPECTED") ? expected : 0);
dht->torrents_max = K;
dht->peers_per_torrent_max = K;
struct torrent * torrent = torrent_init();
diff --git a/src/metainfo.c b/src/metainfo.c
index 680505a..72fc2ec 100644
--- a/src/metainfo.c
+++ b/src/metainfo.c
@@ -117,6 +117,7 @@ tail_recursion:
}
if (!path->next) {
struct inode * file = calloc(1, sizeof(struct inode));
+ file->length = size;
file->parent = prnt;
file->name = path->value;
path->value = NULL;
@@ -143,7 +144,7 @@ tail_recursion:
* @return sum length of the filetree
*/
-static int filetree (struct inode ** root, struct bencoding * dict, unsigned * cunt, struct inode * prnt) {
+static inode_length_t filetree (struct inode ** root, struct bencoding * dict, unsigned * cunt, struct inode * prnt) {
if (!dict)
return 0;
assert(!*root);
diff --git a/src/metainfo.h b/src/metainfo.h
index 774b91a..8af9e52 100644
--- a/src/metainfo.h
+++ b/src/metainfo.h
@@ -1,7 +1,7 @@
typedef unsigned inode_length_t;
struct inode {
char * name;
- size_t length;
+ inode_length_t length;
struct inode * next;
struct inode * child;
struct inode * parent;