0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-09 12:48:43 +00:00

Fix birdcl async message handling

Fix handling of async messafe in the bird light client. The async message
may occure at the any moment so we need the client to liste for the
message from server when it waits for user input.
This commit is contained in:
Tomas Hlavacek 2013-04-06 22:07:32 +02:00
parent ce13485374
commit 568d9c9fae

View File

@ -36,7 +36,7 @@ static int once;
extern char *server_path; extern char *server_path;
extern int server_fd; extern int server_fd;
extern int nstate; extern int cstate;
extern int num_lines, skip_input, interactive; extern int num_lines, skip_input, interactive;
static int term_lns=25; static int term_lns=25;
@ -123,7 +123,7 @@ run_init_cmd(void)
return; return;
} }
if (!init_cmd && once && (nstate == STATE_CMD_USER)) if (!init_cmd && once && (cstate == STATE_PROMPT))
{ {
/* Initial command is finished and we want to exit */ /* Initial command is finished and we want to exit */
cleanup(); cleanup();
@ -332,7 +332,7 @@ server_got_reply(char *x)
if (x[4] == ' ') if (x[4] == ' ')
{ {
nstate = STATE_CMD_USER; cstate = STATE_PROMPT;
skip_input = 0; skip_input = 0;
return; return;
} }
@ -362,10 +362,10 @@ select_loop(void)
{ {
FD_ZERO(&select_fds); FD_ZERO(&select_fds);
if (nstate != STATE_CMD_USER) if (cstate != STATE_CMD_USER)
FD_SET(server_fd, &select_fds); FD_SET(server_fd, &select_fds);
if (nstate != STATE_CMD_SERVER) if (cstate != STATE_CMD_SERVER)
{ {
FD_SET(0, &select_fds); FD_SET(0, &select_fds);
if (interactive) if (interactive)