mirror of
https://github.com/tmate-io/tmate-ssh-server.git
synced 2020-11-18 19:53:51 -08:00
Now all timers are events, there is no longer any need to wake up every 50 ms -
only wake up when an event happens.
This commit is contained in:
parent
b58bf49e91
commit
38e13942ac
7
server.c
7
server.c
@ -207,15 +207,10 @@ error:
|
|||||||
void
|
void
|
||||||
server_loop(void)
|
server_loop(void)
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
|
||||||
|
|
||||||
memset(&tv, 0, sizeof tv);
|
|
||||||
tv.tv_usec = POLL_TIMEOUT * 1000;
|
|
||||||
|
|
||||||
while (!server_should_shutdown()) {
|
while (!server_should_shutdown()) {
|
||||||
server_update_socket();
|
server_update_socket();
|
||||||
|
|
||||||
event_loopexit(&tv);
|
event_loopexit(NULL);
|
||||||
event_loop(EVLOOP_ONCE);
|
event_loop(EVLOOP_ONCE);
|
||||||
|
|
||||||
server_window_loop();
|
server_window_loop();
|
||||||
|
3
tmux.h
3
tmux.h
@ -62,9 +62,6 @@ extern char **environ;
|
|||||||
/* Escape timer period, in milliseconds. */
|
/* Escape timer period, in milliseconds. */
|
||||||
#define ESCAPE_PERIOD 500
|
#define ESCAPE_PERIOD 500
|
||||||
|
|
||||||
/* Maximum poll timeout (when attached). */
|
|
||||||
#define POLL_TIMEOUT 50
|
|
||||||
|
|
||||||
/* Maximum data to buffer for output before suspending reading from panes. */
|
/* Maximum data to buffer for output before suspending reading from panes. */
|
||||||
#define BACKOFF_THRESHOLD 1024
|
#define BACKOFF_THRESHOLD 1024
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user