Merge branch '0.1' - getting 0.1 bugfix

This commit is contained in:
Andrew Pamment 2016-04-10 09:02:15 +10:00
commit 4ce8c5cfe0
2 changed files with 10 additions and 1 deletions

4
bbs.c
View File

@ -19,6 +19,7 @@ struct user_record *gUser;
int gSocket;
int usertimeout;
int timeoutpaused;
struct fido_addr *parse_fido_addr(const char *str) {
struct fido_addr *ret = (struct fido_addr *)malloc(sizeof(struct fido_addr));
@ -89,7 +90,9 @@ void timer_handler(int signum) {
}
if (timeoutpaused == 0) {
usertimeout--;
}
if (usertimeout <= 0) {
s_putstring(gSocket, "\r\n\r\nTimeout waiting for input..\r\n");
disconnect(gSocket);
@ -682,6 +685,7 @@ void runbbs(int socket, char *config_path) {
gUser = NULL;
gSocket = socket;
usertimeout = 10;
timeoutpaused = 0;
memset (&sa, 0, sizeof (sa));
sa.sa_handler = &timer_handler;

View File

@ -23,6 +23,8 @@ extern int mynode;
int running_door_pid = 0;
int running_door = 0;
extern int timeoutpaused;
void doorchld_handler(int s)
{
// waitpid() might overwrite errno, so we save and restore it:
@ -136,6 +138,8 @@ void rundoor(int socket, struct user_record *user, char *cmd, int stdio) {
struct winsize ws;
struct sigaction sa;
timeoutpaused = 1;
if (write_door32sys(socket, user) != 0) {
return;
}
@ -223,6 +227,7 @@ void rundoor(int socket, struct user_record *user, char *cmd, int stdio) {
sprintf(buffer, "%s %d %d", cmd, mynode, socket);
system(buffer);
}
timeoutpaused = 0;
}
int door_menu(int socket, struct user_record *user) {