Compare commits

..

7 Commits

Author SHA1 Message Date
angt
efd5e0bb36 Remove down-timeout and use timeout for send-timeout 2016-04-08 14:38:07 +00:00
angt
ade4617d53 Update mud 2016-04-08 13:00:52 +00:00
angt
64a5fd8227 Update mud 2016-04-05 14:23:45 +00:00
angt
eba968797c Add {down,send,pong}-timeout and time-tolerance option 2016-04-05 14:17:07 +00:00
angt
d60f28a7fe Update mud 2016-04-05 06:42:03 +00:00
angt
32069eb104 Print tun device on STARTED and STOPPED too 2016-04-04 20:05:33 +00:00
angt
a6adcefc25 Update mud 2016-04-04 16:48:11 +00:00
2 changed files with 25 additions and 15 deletions

2
mud

Submodule mud updated: a1ba274fbf...cd9fb7ce34

View File

@@ -242,6 +242,8 @@ int main (int argc, char **argv)
gt.timeout = 5000; gt.timeout = 5000;
long time_tolerance = 0;
struct option opts[] = { struct option opts[] = {
{ "host", &host, option_str }, { "host", &host, option_str },
{ "port", &port, option_str }, { "port", &port, option_str },
@@ -252,6 +254,7 @@ int main (int argc, char **argv)
{ "multiqueue", NULL, option_option }, { "multiqueue", NULL, option_option },
{ "statefile", &statefile, option_str }, { "statefile", &statefile, option_str },
{ "timeout", &gt.timeout, option_long }, { "timeout", &gt.timeout, option_long },
{ "time-tolerance", &time_tolerance, option_long },
{ "version", NULL, option_option }, { "version", NULL, option_option },
{ NULL }, { NULL },
}; };
@@ -305,6 +308,11 @@ int main (int argc, char **argv)
mud_set_key(mud, gt.key, sizeof(gt.key)); mud_set_key(mud, gt.key, sizeof(gt.key));
mud_set_send_timeout_msec(mud, gt.timeout);
if (time_tolerance > 0)
mud_set_time_tolerance_sec(mud, time_tolerance);
if (bind_list) { if (bind_list) {
char tmp[1024]; char tmp[1024];
char *name = &tmp[0]; char *name = &tmp[0];
@@ -362,13 +370,15 @@ int main (int argc, char **argv)
if (mud_is_up(mud)) { if (mud_is_up(mud)) {
if (!started) { if (!started) {
state("STARTED", NULL); state("STARTED", tun_name);
started = 1; started = 1;
} }
} else if (started) { } else {
state("STOPPED", NULL); if (started) {
state("STOPPED", tun_name);
started = 0; started = 0;
} }
}
if (FD_ISSET(tun_fd, &rfds)) { if (FD_ISSET(tun_fd, &rfds)) {
while (1) { while (1) {