File tree Expand file tree Collapse file tree 2 files changed +25
-23
lines changed
Expand file tree Collapse file tree 2 files changed +25
-23
lines changed Original file line number Diff line number Diff line change 1010
1111typedef struct client_t {
1212#define BUFFER_SIZE 655365
13- int fd ;
14- unsigned char buffer [65536 ]; // adjust if we expect larger frames
15- size_t buf_used ; // bytes currently in buffer
16- ssize_t
17- frame_need ; // -1 until we know; else total frame size (2 + core_len)
18- char ip_str [INET6_ADDRSTRLEN ]; // TODO: Remove this in the future
13+ char * command_type ;
14+ char * config_file_path ;
15+ char * command ;
16+ char * uds_socket_path ; // Unix domain socket path
1917 char * ip_address ;
18+ size_t buf_used ; // bytes currently in buffer
19+ ssize_t frame_need ; // -1 until we know; else total frame size (2 + core_len)
2020 int port ;
21- char * uds_socket_path ; // Unix domain socket path
21+ int fd ;
2222 enum socket_domain
2323 socket_domain ; // The socket domain we are using (Unix Domain or TCP/IP)
24+
25+ unsigned char buffer [65536 ]; // adjust if we expect larger frames
26+ char ip_str [INET6_ADDRSTRLEN ]; // TODO: Remove this in the future
2427 bool benchmark_mode ;
25- char * command_type ;
26- char * config_file_path ;
2728 bool interactive_mode ;
2829 bool verbose ; // print additional information during runtime
29- } client_t ;
30+ } client_t __attribute__(( aligned ( 64 ))) ;
3031
3132client_t * init_client (int client_fd , struct sockaddr_storage ss ,
3233 enum socket_domain socket_domain );
Original file line number Diff line number Diff line change @@ -16,25 +16,26 @@ typedef struct {
1616} db_t ;
1717
1818typedef struct server_t {
19- bool daemonize ;
19+ list_t * clients ;
20+ char * config_file_path ;
21+ db_t * database ;
22+ char * uds_socket_path ; // Unix domain socket path
23+ counter_t metrics ;
2024 int port ;
2125 int fd ;
2226 int event_loop_fd ;
27+ int event_loop_max_events ;
28+ int32_t num_disconnected_clients ;
2329 pid_t pid ;
24- bool is_logging_enabled ;
25- bool verbose ;
26- bool show_logo ;
27- list_t * clients ;
2830 u_int32_t num_clients ;
29- int32_t num_disconnected_clients ;
30- int event_loop_max_events ;
31- char * uds_socket_path ; // Unix domain socket path
3231 enum socket_domain socket_domain ;
33- bool use_io_uring ;
34- char * config_file_path ;
35- db_t * database ;
36- counter_t metrics ;
3732 event_loop_dispatcher_kind event_dispatcher_kind ;
38- } server_t ;
33+ bool use_io_uring ;
34+ bool is_logging_enabled ;
35+ bool verbose ;
36+ bool show_logo ;
37+ bool daemonize ;
38+ } server_t __attribute__((aligned (128 )));
39+ ;
3940
4041#endif // SERVER_H
You can’t perform that action at this time.
0 commit comments