Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct tls_uv_connection_state_private_members {
- server_state_t* server;
- uv_tcp_t* handle;
- SSL *ssl;
- BIO *read, *write;
- struct {
- tls_uv_connection_state_t** prev_holder;
- tls_uv_connection_state_t* next;
- int in_queue;
- size_t pending_writes_count;
- uv_buf_t* pending_writes_buffer;
- } pending;
- size_t used_buffer, to_scan;
- int flags;
- };
- #define RESERVED_SIZE (64 - sizeof(struct tls_uv_connection_state_private_members))
- #define MSG_SIZE (8192 - sizeof(struct tls_uv_connection_state_private_members) - 64 - RESERVED_SIZE)
- // This struct is exactly 8KB in size, this
- // means it is two OS pages and is easy to work with
- typedef struct tls_uv_connection_state {
- struct tls_uv_connection_state_private_members;
- char reserved[RESERVED_SIZE];
- char user_data[64]; // location for user data, 64 bytes aligned, 64 in size
- char buffer[MSG_SIZE];
- } tls_uv_connection_state_t;
- static_assert(offsetof(tls_uv_connection_state_t, user_data) % 64 == 0, "tls_uv_connection_state_t.user should be 64 bytes aligned");
- static_assert(sizeof(tls_uv_connection_state_t) == 8192, "tls_uv_connection_state_t should be 8KB");
Add Comment
Please, Sign In to add comment