summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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;