IO thread that reads from the queues and writes them. More...
#include <dtstream.h>
Data Fields | |
| int | threadnum |
| the thread number for the dtio thread, must be first to cast thread arg to int* in checklock code. | |
| void * | event_base |
| event base, for event handling | |
| struct dt_io_list_item * | io_list |
| list of queues that is registered to get written | |
| struct dt_io_list_item * | io_list_iter |
| iterator point in the io_list, to pick from them in a round-robin fashion, instead of only from the first when busy. | |
| ub_thread_type | tid |
| thread id, of the io thread | |
| int | started |
| if the io processing has started | |
| void * | ssl_ctx |
| ssl context for the io thread, for tls connections. | |
| int | tls_use_sni |
| if SNI will be used for TLS connections. | |
| int | fd |
| file descriptor that the thread writes to | |
| void * | event |
| event structure that the thread uses | |
| int | event_added |
| the event is added | |
| int | event_added_is_write |
| event added is a write event | |
| int | check_nb_connect |
| check for nonblocking connect errors on fd | |
| void * | ssl |
| ssl for current connection, type SSL* | |
| int | ssl_handshake_done |
| true if the handshake for SSL is done, 0 if not | |
| int | ssl_brief_read |
| true if briefly the SSL wants a read event, 0 if not. | |
| int | ssl_brief_write |
| true if SSL_read is waiting for a write event. | |
| void * | cur_msg |
| the buffer that currently getting written, or NULL if no (partial) message written now | |
| size_t | cur_msg_len |
| length of the current message | |
| size_t | cur_msg_done |
| number of bytes written for the current message | |
| size_t | cur_msg_len_done |
| number of bytes of the length that have been written, for the current message length that precedes the frame | |
| lock_basic_type | wakeup_timer_lock |
| lock on wakeup_timer_enabled | |
| int | wakeup_timer_enabled |
| if wakeup timer is enabled in some thread | |
| int | commandpipe [2] |
| command pipe that stops the pipe if closed. | |
| void * | command_event |
| the event to listen to the commandpipe | |
| int | want_to_exit |
| the io thread wants to exit | |
| void * | stop_flush_event |
| in stop flush, this is nonNULL and references the stop_ev | |
| void * | reconnect_timer |
| the timer event for connection retries | |
| int | reconnect_is_added |
| if the reconnect timer is added to the event base | |
| int | reconnect_timeout |
| the current reconnection timeout, it is increased with exponential backoff, in msec | |
| int | upstream_is_unix |
| If the log server is connected to over unix domain sockets, eg. | |
| int | upstream_is_tcp |
| if the log server is connected to over TCP. | |
| int | upstream_is_tls |
| if the log server is connected to over TLS. | |
| int | is_bidirectional |
| Perform bidirectional Frame Streams handshake before sending messages. | |
| int | ready_frame_sent |
| Set if the READY control frame has been sent. | |
| int | accept_frame_received |
| Set if valid ACCEPT frame is received. | |
| struct dt_frame_read_buf | read_frame |
| (partially) read frame | |
| char * | socket_path |
| the file path for unix socket (or NULL) | |
| char * | ip_str |
| the ip address and port number (or NULL) | |
| char * | tls_server_name |
| is the TLS upstream authenticated by name, if nonNULL, we use the same cert bundle as used by other TLS streams. | |
| int | use_client_certs |
| are client certificates in use | |
| char * | client_key_file |
| client cert files: the .key file | |
| char * | client_cert_file |
| client cert files: the .pem file | |
IO thread that reads from the queues and writes them.
| struct dt_io_list_item* dt_io_thread::io_list_iter |
iterator point in the io_list, to pick from them in a round-robin fashion, instead of only from the first when busy.
if NULL it means start at the start of the list.
Referenced by dt_io_thread_register_queue(), dt_io_thread_unregister_queue(), and dtio_find_msg().
| void* dt_io_thread::ssl_ctx |
ssl context for the io thread, for tls connections.
type SSL_CTX*
Referenced by dt_io_thread_apply_cfg(), dt_io_thread_delete(), and dtio_setup_ssl().
| int dt_io_thread::ssl_brief_read |
true if briefly the SSL wants a read event, 0 if not.
This happens during negotiation, we then do not want to write, but wait for a read event.
Referenced by dtio_output_cb(), and dtio_setup_ssl().
| int dt_io_thread::ssl_brief_write |
true if SSL_read is waiting for a write event.
Set back to 0 after single write event is handled.
Referenced by dtio_output_cb().
| int dt_io_thread::commandpipe[2] |
command pipe that stops the pipe if closed.
Used to quit the program. [0] is read, [1] is written to.
Referenced by dt_io_thread_start(), dt_io_thread_stop(), dtio_desetup(), dtio_setup_cmd(), and dtio_wakeup().
| int dt_io_thread::upstream_is_unix |
If the log server is connected to over unix domain sockets, eg.
a file is named that is created to log onto.
Referenced by dt_io_thread_apply_cfg(), and dtio_open_output().
| int dt_io_thread::upstream_is_tcp |
if the log server is connected to over TCP.
The ip address and port are used
Referenced by dt_io_thread_apply_cfg(), and dtio_open_output().
| int dt_io_thread::upstream_is_tls |
if the log server is connected to over TLS.
ip address, port, and client certificates can be used for authentication.
Referenced by dt_io_thread_apply_cfg(), and dtio_open_output().