From e69bae37c621e77b7ac63e8bc09eef7ab639b95f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 9 Oct 2021 12:23:44 +0200 Subject: Merging upstream version 1.6.3+20210924. Signed-off-by: Daniel Baumann --- src/server.h | 42 +++++++++++++----------------------------- 1 file changed, 13 insertions(+), 29 deletions(-) (limited to 'src/server.h') diff --git a/src/server.h b/src/server.h index 784d445..b122d1c 100644 --- a/src/server.h +++ b/src/server.h @@ -1,7 +1,8 @@ +#include #include #include -#include "queue.h" +#include "pty.h" // client message #define INPUT '0' @@ -15,8 +16,6 @@ #define SET_WINDOW_TITLE '1' #define SET_PREFERENCES '2' -#define MAX_READ_RETRY 2 - // url paths struct endpoints { char *ws; @@ -30,8 +29,6 @@ extern struct lws_context *context; extern struct server *server; extern struct endpoints endpoints; -typedef enum { STATE_INIT, STATE_PAUSE, STATE_KILL, STATE_EXIT } proc_state; - struct pss_http { char path[128]; char *buffer; @@ -39,46 +36,36 @@ struct pss_http { size_t len; }; -struct pty_proc { - char **args; - int argc; - - pid_t pid; - int status; - proc_state state; - - int pty; - char *pty_buffer; - ssize_t pty_len; - int err_count; - - uv_pipe_t pipe; - - LIST_ENTRY(pty_proc) entry; -}; - struct pss_tty { bool initialized; int initial_cmd_index; bool authenticated; + char user[30]; char address[50]; - char path[20]; + char path[128]; + char **args; + int argc; struct lws *wsi; char *buffer; size_t len; - struct pty_proc *proc; + pty_process *process; + pty_buf_t *pty_buf; + + int lws_close_status; }; struct server { int client_count; // client count char *prefs_json; // client preferences char *credential; // encoded basic auth credential + char *auth_header; // header name used for auth proxy char *index; // custom index.html char *command; // full command line char **argv; // command with arguments int argc; // command + arguments count + char *cwd; // working directory int sig_code; // close signal char sig_name[20]; // human readable signal string bool url_arg; // allow client to send cli arguments in URL @@ -89,8 +76,5 @@ struct server { char socket_path[255]; // UNIX domain socket path char terminal_type[30]; // terminal type to report - uv_loop_t *loop; // the libuv event loop - uv_signal_t watcher; // SIGCHLD watcher - - LIST_HEAD(proc, pty_proc) procs; // started process list + uv_loop_t *loop; // the libuv event loop }; -- cgit v1.2.3