Compare commits

..

3 Commits

Author SHA1 Message Date
angt
a3b78a3868 Update mud 2016-03-30 14:36:52 +00:00
Adrien Gallouët
80d4c2814f Update README.md 2016-03-24 18:52:18 +01:00
angt
b0d5007bfb Restore STARTED and STOPPED states 2016-03-24 14:45:15 +00:00
3 changed files with 13 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
# Glorytun
# π₁(Glorytun)=ℤ²
Small, Simple and Stupid VPN over [mud](https://github.com/angt/mud).

2
mud

Submodule mud updated: 11903da862...6b3001e6d8

View File

@@ -342,6 +342,7 @@ int main (int argc, char **argv)
fd_set rfds;
FD_ZERO(&rfds);
int started = 0;
unsigned char buf[2048];
while (!gt.quit) {
@@ -364,6 +365,16 @@ int main (int argc, char **argv)
return 1;
}
if (mud_is_up(mud)) {
if (!started) {
state("STARTED", NULL);
started = 1;
}
} else if (started) {
state("STOPPED", NULL);
started = 0;
}
if (FD_ISSET(tun_fd, &rfds)) {
while (1) {
const ssize_t r = tun_read(tun_fd, buf, sizeof(buf));