Commit Graph

3706 Commits

Author SHA1 Message Date
Maxim Biro
6b40a581b1 Put config-related functions in a separate file
bootstrap_node_packets.c was giving an error as it was being included
twice and there were no include guards, so part of it was split into
bootstrap_node_packets.h.
2016-01-01 00:19:35 -05:00
Maxim Biro
e1fc8c1d3c Add ability to run the daemon in foreground
Useful for things like a Docker container or just running it in the
terminal.

Complements the stdout logging option. This is actually why the stdout
logging was added in the first place -- to be used in the foreground
mode, though nothing stops one from using stdout in the background
mode, which one could redirect to a file.
2015-12-31 23:18:39 -05:00
Maxim Biro
2ef1ce9421 Fix wrong filename mentioned above license 2015-12-31 20:06:37 -05:00
Maxim Biro
ffa927fa36 Rename LOGGER_BACKEND to LOG_BACKEND 2015-12-31 20:01:24 -05:00
Maxim Biro
a40fd1bb6c Add ability to specify multiple command line arguments
Needed in order to specify which log backend to use.

Init scripts need to be updated to contain --config before the path to
the config file.
2015-12-31 19:58:34 -05:00
Maxim Biro
8c812f5341 Make daemon use the new log code
"log" is a reserved name (log from math.h), so it got changed into
write_log.
2015-12-31 02:44:44 -05:00
Maxim Biro
c50781a2b7 Make logger a global object instead of an instance
Passing Logger object into every function isn't fun. See for yourself:
something as simple as a public key printing function turns from
>void print_public_key(const uint8_t *public_key)
to
>void print_public_key(Logger *logger, const uint8_t *public_key)
2015-12-31 01:24:31 -05:00
Maxim Biro
bfc3c4eaac Add logger object to be able to support multiple logging backends 2015-12-30 23:43:04 -05:00
Maxim Biro
78d6e2d58b Change log levels
Some of them were set incorrectly, e.g. something that caused the
daemon to exit was marked as just a warning, instead of an error.

Removed debug level as it was hard to decide whether something should
go into info or debug. This is mostly because the use of the debug level
wasn't well defined. Debug should be used for information that could
help a user to debug an issue, but messages marked as debug were by the
most part the "success" log messages, which could go into info level
instead.
2015-12-30 21:49:00 -05:00
irungentoo
0938ba08d9
Send get nodes instead of ping to timing out nodes. 2015-12-16 17:22:07 -05:00
irungentoo
d6b4761c2f
This is still useful. 2015-12-16 16:42:12 -05:00
irungentoo
09aa7884c8
Slightly increase ping timeout. 2015-12-16 16:24:29 -05:00
irungentoo
97ba2f7640
Less packet spam. 2015-12-16 14:26:40 -05:00
irungentoo
c1e00c5d39
Improved the to_ping list. 2015-12-16 11:28:30 -05:00
irungentoo
1d91699e8e
Fixed use of it after free. 2015-12-15 15:12:38 -05:00
irungentoo
9a87f03aec
Onion test fixed to work with faster DHT. 2015-12-15 14:58:36 -05:00
irungentoo
836e180757
More efficient DHT searching. 2015-12-15 14:13:28 -05:00
irungentoo
5e6bd7bfee
Sort list if timed out nodes are in the middle of the list. 2015-12-14 20:18:53 -05:00
irungentoo
4cfafe8310
Send get nodes more to closer nodes than further nodes. 2015-12-14 19:37:19 -05:00
irungentoo
9b9d442e17
Merge branch 'LittleVulpix-donatorfile' of https://github.com/LittleVulpix/toxcore 2015-12-12 15:32:50 -05:00
irungentoo
7e56ae40fd
Small onion search improvement. 2015-12-12 14:50:25 -05:00
irungentoo
07a6f482d9
Update so this works with the new distance function. 2015-12-12 14:49:21 -05:00
LittleVulpix
7c2d4480e3 Added my pixfile! 2015-12-12 20:40:57 +01:00
irungentoo
1c8109e524
Unused variable. 2015-12-11 23:08:34 -05:00
irungentoo
b5978a0da8
Remove useless vars. 2015-12-11 18:27:12 -05:00
irungentoo
2d93eb2048
Better DHT tests. 2015-12-11 17:50:36 -05:00
irungentoo
7494c65bee
More DHT fixes. 2015-12-11 17:44:21 -05:00
irungentoo
5fe8429da8
DHT fix. 2015-12-11 17:21:39 -05:00
irungentoo
22b1ebb46e
DHT improvements.
Feed better nodes to onion, bootstrap off close clients when DHT friend is added.
2015-12-11 16:48:10 -05:00
irungentoo
ae801b3257
DHT fix.
Return only closest nodes in get nodes packet.
2015-12-11 15:34:04 -05:00
irungentoo
1986a2e492
DHT fixes. 2015-12-11 15:07:46 -05:00
irungentoo
39700abd86
Check if node can be stored before sorting. 2015-12-10 10:09:48 -05:00
irungentoo
8fa264e770
Small fix. 2015-12-09 09:10:03 -05:00
irungentoo
deb0b358a5
DHT fix.
Improve DHT distance function.
2015-12-09 08:59:10 -05:00
irungentoo
4a6837acc7
Improve likelyhood of the closest nodes being in our lists. 2015-12-08 20:04:27 -05:00
irungentoo
30acc33ef6
uint32_t -> unsigned int. 2015-12-08 19:09:38 -05:00
irungentoo
feda36e7cf
Forgot to stage this before committing. 2015-12-08 18:37:02 -05:00
irungentoo
4f33b27f6b
Fixed DHT bug. 2015-12-08 16:50:18 -05:00
irungentoo
73b2bce08a
If we receive a packet from a node we are searching for, ping it. 2015-12-08 15:43:03 -05:00
irungentoo
9c64769331
Merge branch 'master' of https://github.com/mannol/toxcore 2015-12-02 22:36:45 -05:00
irungentoo
f40a60575f
Slightly increased number of peers to announce to.
Some test fixes.
2015-12-01 20:11:53 -05:00
Eniz Vukovic
96a7b7b4fc Fix error reporting in toxav_call() 2015-11-29 00:38:33 +01:00
irungentoo
516b6ab46c
Forgot to commit these. 2015-11-26 10:44:16 -05:00
irungentoo
73b2144edc
Increase max file transfer speed.
Fix bug that limited it to 1K packets per second.
2015-11-21 11:05:26 -05:00
irungentoo
25843bf141
More file transfer improvements. 2015-11-21 10:05:39 -05:00
irungentoo
608ee07c96
File transfer fix. 2015-11-20 21:48:25 -05:00
irungentoo
994a5db105
File transfer fix. 2015-11-20 20:34:15 -05:00
irungentoo
5a800fe467
Send queue size should not affect the speed of packets being resent. 2015-11-19 17:04:39 -05:00
irungentoo
548fafc4dd
Fixed division by 0. 2015-11-19 15:10:20 -05:00
irungentoo
0c29c00125
Attempted fix of disconnect when switching from TCP to UDP. 2015-11-19 15:03:02 -05:00