summaryrefslogtreecommitdiff
path: root/other/bootstrap_daemon/tox-bootstrapd.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-10-11 18:59:09 -0400
committerirungentoo <irungentoo@gmail.com>2014-10-11 18:59:09 -0400
commit0444ca18dff821943aac9bc3a59207b2d0dea33f (patch)
tree15dc5991b5ac0410069767a67fbcb03ce28ffa0b /other/bootstrap_daemon/tox-bootstrapd.c
parent3f855b2445970fb32f06f4e8f5d07c89d617024f (diff)
parent2df986f6b951aee49f403ff076f213213ce873eb (diff)
Merge branch 'master' of https://github.com/stqism/ToxCore
Diffstat (limited to 'other/bootstrap_daemon/tox-bootstrapd.c')
-rw-r--r--other/bootstrap_daemon/tox-bootstrapd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/other/bootstrap_daemon/tox-bootstrapd.c b/other/bootstrap_daemon/tox-bootstrapd.c
index e4cadb35..7e78da4e 100644
--- a/other/bootstrap_daemon/tox-bootstrapd.c
+++ b/other/bootstrap_daemon/tox-bootstrapd.c
@@ -53,7 +53,7 @@
53 53
54 54
55#define DAEMON_NAME "tox-bootstrapd" 55#define DAEMON_NAME "tox-bootstrapd"
56#define DAEMON_VERSION_NUMBER 2014081600UL // yyyymmmddvv format: yyyy year, mm month, dd day, vv version change count for that day 56#define DAEMON_VERSION_NUMBER 2014101000UL // yyyymmmddvv format: yyyy year, mm month, dd day, vv version change count for that day
57 57
58#define SLEEP_TIME_MILLISECONDS 30 58#define SLEEP_TIME_MILLISECONDS 30
59#define sleep usleep(1000*SLEEP_TIME_MILLISECONDS) 59#define sleep usleep(1000*SLEEP_TIME_MILLISECONDS)
@@ -61,7 +61,7 @@
61#define DEFAULT_PID_FILE_PATH "tox-bootstrapd.pid" 61#define DEFAULT_PID_FILE_PATH "tox-bootstrapd.pid"
62#define DEFAULT_KEYS_FILE_PATH "tox-bootstrapd.keys" 62#define DEFAULT_KEYS_FILE_PATH "tox-bootstrapd.keys"
63#define DEFAULT_PORT 33445 63#define DEFAULT_PORT 33445
64#define DEFAULT_ENABLE_IPV6 0 // 1 - true, 0 - false 64#define DEFAULT_ENABLE_IPV6 1 // 1 - true, 0 - false
65#define DEFAULT_ENABLE_LAN_DISCOVERY 1 // 1 - true, 0 - false 65#define DEFAULT_ENABLE_LAN_DISCOVERY 1 // 1 - true, 0 - false
66#define DEFAULT_ENABLE_TCP_RELAY 1 // 1 - true, 0 - false 66#define DEFAULT_ENABLE_TCP_RELAY 1 // 1 - true, 0 - false
67#define DEFAULT_TCP_RELAY_PORTS 443, 3389, 33445 // comma-separated list of ports. make sure to adjust DEFAULT_TCP_RELAY_PORTS_COUNT accordingly 67#define DEFAULT_TCP_RELAY_PORTS 443, 3389, 33445 // comma-separated list of ports. make sure to adjust DEFAULT_TCP_RELAY_PORTS_COUNT accordingly
@@ -210,7 +210,9 @@ void parse_tcp_relay_ports_config(config_t *cfg, uint16_t **tcp_relay_ports, int
210 } 210 }
211 211
212 // the loop above skips invalid ports, so we adjust the allocated memory size 212 // the loop above skips invalid ports, so we adjust the allocated memory size
213 *tcp_relay_ports = realloc(*tcp_relay_ports, (*tcp_relay_port_count) * sizeof(uint16_t)); 213 if ((*tcp_relay_port_count) * sizeof(uint16_t) > 0) {
214 *tcp_relay_ports = realloc(*tcp_relay_ports, (*tcp_relay_port_count) * sizeof(uint16_t));
215 }
214} 216}
215 217
216// Gets general config options 218// Gets general config options
@@ -616,7 +618,7 @@ int main(int argc, char *argv[])
616 pid_t pid = fork(); 618 pid_t pid = fork();
617 619
618 if (pid > 0) { 620 if (pid > 0) {
619 fprintf(pidf, "%d ", pid); 621 fprintf(pidf, "%d", pid);
620 fclose(pidf); 622 fclose(pidf);
621 syslog(LOG_DEBUG, "Forked successfully: PID: %d.\n", pid); 623 syslog(LOG_DEBUG, "Forked successfully: PID: %d.\n", pid);
622 return 0; 624 return 0;