mirror of
https://github.com/samba-team/samba.git
synced 2025-08-30 17:49:30 +03:00
oops, added wait_keyboard back, but _this_ time wrapped it with
HAVE_READLINE
(This used to be commit af05710d0b
)
This commit is contained in:
@ -257,6 +257,37 @@ static void do_command(struct client_info *info, char *tok, char *line)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef HAVE_LIBREADLINE
|
||||||
|
/****************************************************************************
|
||||||
|
wait for keyboard activity, swallowing network packets
|
||||||
|
****************************************************************************/
|
||||||
|
static void wait_keyboard(void)
|
||||||
|
{
|
||||||
|
fd_set fds;
|
||||||
|
struct timeval timeout;
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
FD_ZERO(&fds);
|
||||||
|
FD_SET(cli->fd,&fds);
|
||||||
|
FD_SET(fileno(stdin),&fds);
|
||||||
|
|
||||||
|
timeout.tv_sec = 20;
|
||||||
|
timeout.tv_usec = 0;
|
||||||
|
sys_select(MAX(cli->fd,fileno(stdin))+1,&fds,&timeout);
|
||||||
|
|
||||||
|
if (FD_ISSET(fileno(stdin),&fds))
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* We deliberately use receive_smb instead of
|
||||||
|
client_receive_smb as we want to receive
|
||||||
|
session keepalives and then drop them here.
|
||||||
|
*/
|
||||||
|
if (FD_ISSET(cli->fd,&fds))
|
||||||
|
receive_smb(cli->fd,cli->inbuf,0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
process commands from the client
|
process commands from the client
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -340,7 +371,6 @@ static BOOL process( struct client_info *info, char *cmd_str)
|
|||||||
/* Copy read line to samba buffer */
|
/* Copy read line to samba buffer */
|
||||||
|
|
||||||
pstrcpy(line, rl_line_buffer);
|
pstrcpy(line, rl_line_buffer);
|
||||||
pstrcat(line, "\n");
|
|
||||||
|
|
||||||
/* Add to history */
|
/* Add to history */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user