summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-transport/socket/src/socket.h
diff options
context:
space:
mode:
Diffstat (limited to 'rpc/rpc-transport/socket/src/socket.h')
-rw-r--r--rpc/rpc-transport/socket/src/socket.h108
1 files changed, 47 insertions, 61 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.h b/rpc/rpc-transport/socket/src/socket.h
index 27db0ed427b..8a2eda70605 100644
--- a/rpc/rpc-transport/socket/src/socket.h
+++ b/rpc/rpc-transport/socket/src/socket.h
@@ -14,6 +14,7 @@
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/x509v3.h>
+#include <openssl/x509_vfy.h>
#ifdef HAVE_OPENSSL_DH_H
#include <openssl/dh.h>
#endif
@@ -21,13 +22,7 @@
#include <openssl/ecdh.h>
#endif
-#include "gf-event.h"
#include "rpc-transport.h"
-#include "logging.h"
-#include "dict.h"
-#include "mem-pool.h"
-#include "globals.h"
-#include "refcount.h"
#ifndef MAX_IOVEC
#define MAX_IOVEC 16
@@ -108,12 +103,13 @@ struct ioq {
};
};
- uint32_t fraghdr;
struct iovec vector[MAX_IOVEC];
- int count;
struct iovec *pending_vector;
+ int count;
int pending_count;
struct iobref *iobref;
+ uint32_t fraghdr;
+ char _pad[4];
};
typedef struct {
@@ -169,49 +165,30 @@ struct gf_sock_incoming_frag {
#define GF_SOCKET_RA_MAX 1024
struct gf_sock_incoming {
- sp_rpcrecord_state_t record_state;
- struct gf_sock_incoming_frag frag;
char *proghdr_base_addr;
struct iobuf *iobuf;
size_t iobuf_size;
+ struct gf_sock_incoming_frag frag;
struct iovec vector[2];
- int count;
struct iovec payload_vector;
struct iobref *iobref;
rpc_request_info_t *request_info;
struct iovec *pending_vector;
+ int count;
int pending_count;
- uint32_t fraghdr;
- char complete_record;
- msg_type_t msg_type;
size_t total_bytes_read;
size_t ra_read;
size_t ra_max;
size_t ra_served;
char *ra_buf;
+ uint32_t fraghdr;
+ msg_type_t msg_type;
+ sp_rpcrecord_state_t record_state;
+ char _pad[4];
};
-typedef enum {
- OT_IDLE, /* Uninitialized or termination complete. */
- OT_SPAWNING, /* Past pthread_create but not in thread yet. */
- OT_RUNNING, /* Poller thread running normally. */
- OT_CALLBACK, /* Poller thread in the middle of a callback. */
- OT_PLEASE_DIE, /* Poller termination requested. */
-} ot_state_t;
-
typedef struct {
- int32_t sock;
- int32_t idx;
- int32_t gen;
- /* -1 = not connected. 0 = in progress. 1 = connected */
- char connected;
- /* 1 = connect failed for reasons other than EINPROGRESS/ENOENT
- see socket_connect for details */
- char connect_failed;
- char bio;
- char connect_finish_log;
- char submit_log;
union {
struct list_head ioq;
struct {
@@ -219,37 +196,60 @@ typedef struct {
struct ioq *ioq_prev;
};
};
- struct gf_sock_incoming incoming;
- pthread_mutex_t in_lock;
pthread_mutex_t out_lock;
pthread_mutex_t cond_lock;
pthread_cond_t cond;
int windowsize;
- char lowlat;
- char nodelay;
int keepalive;
int keepaliveidle;
int keepaliveintvl;
int keepalivecnt;
int timeout;
+ int log_ctr;
+ int shutdown_log_ctr;
+ /* ssl_error_required is used only during the SSL connection setup
+ * phase.
+ * It holds the error code returned by SSL_get_error() and is used to
+ * arm the epoll event set for the required event for the specific fd.
+ */
+ int ssl_error_required;
+ int ssl_session_id;
+
+ GF_REF_DECL; /* refcount to keep track of socket_poller
+ threads */
+ struct {
+ pthread_mutex_t lock;
+ pthread_cond_t cond;
+ uint64_t in_progress;
+ } notify;
+ int32_t sock;
+ int32_t idx;
+ int32_t gen;
uint32_t backlog;
- gf_boolean_t read_fail_log;
- gf_boolean_t ssl_enabled; /* outbound I/O */
- gf_boolean_t mgmt_ssl; /* outbound mgmt */
- mgmt_ssl_t srvr_ssl;
- gf_boolean_t use_ssl;
SSL_METHOD *ssl_meth;
SSL_CTX *ssl_ctx;
- int ssl_session_id;
BIO *ssl_sbio;
SSL *ssl_ssl;
char *ssl_own_cert;
char *ssl_private_key;
char *ssl_ca_list;
- pthread_t thread;
- int pipe[2];
+ char *crl_path;
+ struct gf_sock_incoming incoming;
+ mgmt_ssl_t srvr_ssl;
+ /* -1 = not connected. 0 = in progress. 1 = connected */
+ char connected;
+ /* 1 = connect failed for reasons other than EINPROGRESS/ENOENT
+ see socket_connect for details */
+ char connect_failed;
+ char bio;
+ char connect_finish_log;
+ char submit_log;
+ char nodelay;
+ gf_boolean_t read_fail_log;
+ gf_boolean_t ssl_enabled; /* outbound I/O */
+ gf_boolean_t mgmt_ssl; /* outbound mgmt */
gf_boolean_t is_server;
- int log_ctr;
+ gf_boolean_t use_ssl;
gf_boolean_t ssl_accepted; /* To indicate SSL_accept() */
gf_boolean_t ssl_connected; /* or SSL_connect() has been
* been completed on this socket.
@@ -270,21 +270,7 @@ typedef struct {
* socket_event_handler() for
* newly accepted socket
*/
-
- /* ssl_error_required is used only during the SSL connection setup
- * phase.
- * It holds the error code returned by SSL_get_error() and is used to
- * arm the epoll event set for the required event for the specific fd.
- */
- int ssl_error_required;
-
- GF_REF_DECL; /* refcount to keep track of socket_poller
- threads */
- struct {
- pthread_mutex_t lock;
- pthread_cond_t cond;
- uint64_t in_progress;
- } notify;
+ char _pad[4];
} socket_private_t;
#endif