mirror of
https://github.com/schoebel/mars
synced 2024-12-18 04:34:48 +00:00
server: minimum SS_CONNECTED
This commit is contained in:
parent
0856f56918
commit
68621e26da
@ -1067,6 +1067,13 @@ void check_bricks(void)
|
||||
continue;
|
||||
brick_yield();
|
||||
if (mars_socket_is_alive(handler_socket)) {
|
||||
if (!running_brick->shutdown_jiffies) {
|
||||
running_brick->shutdown_jiffies = jiffies;
|
||||
continue;
|
||||
}
|
||||
/* Minimum connection duration, for better sysadmin detection */
|
||||
if (running_brick->shutdown_jiffies + 3 * HZ <= jiffies)
|
||||
continue;
|
||||
mars_shutdown_socket(handler_socket);
|
||||
/* only once per round */
|
||||
break;
|
||||
|
@ -62,6 +62,7 @@ struct server_brick {
|
||||
struct task_struct *handler_thread;
|
||||
struct task_struct *cb_thread;
|
||||
void *delegated_brick;
|
||||
unsigned long shutdown_jiffies;
|
||||
wait_queue_head_t startup_event;
|
||||
wait_queue_head_t cb_event;
|
||||
struct mutex cb_mutex;
|
||||
|
Loading…
Reference in New Issue
Block a user