mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-08-21 14:03:11 -07:00
Fix Session Quitting on Error
This commit is contained in:
parent
f6702b1955
commit
c34ce875ba
2 changed files with 5 additions and 1 deletions
|
@ -141,6 +141,8 @@ static void *ctrl_thread_func(void *user)
|
|||
ctrl->recv_buf_size += received;
|
||||
}
|
||||
|
||||
close(ctrl->sock);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -193,7 +193,7 @@ static void *session_thread_func(void *arg)
|
|||
chiaki_mutex_lock(&session->state_mutex);
|
||||
|
||||
#define QUIT(quit_label) do { \
|
||||
chiaki_mutex_lock(&session->state_mutex); \
|
||||
chiaki_mutex_unlock(&session->state_mutex); \
|
||||
goto quit_label; } while(0)
|
||||
|
||||
#define CHECK_STOP(quit_label) do { \
|
||||
|
@ -309,6 +309,8 @@ quit_ctrl:
|
|||
|
||||
ChiakiEvent quit_event;
|
||||
quit:
|
||||
|
||||
CHIAKI_LOGI(&session->log, "Session has quit");
|
||||
quit_event.type = CHIAKI_EVENT_QUIT;
|
||||
quit_event.quit.reason = session->quit_reason;
|
||||
session_send_event(session, &quit_event);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue