CUBRID Engine
latest
|
#include <assert.h>
#include <signal.h>
#include <string.h>
#include "porting.h"
#include "shard_proxy_io.h"
#include "shard_proxy_handler.h"
#include "shard_proxy_function.h"
#include "cas_protocol.h"
#include "cas_error.h"
#include "shard_shm.h"
#include "broker_acl.h"
Go to the source code of this file.
Macros | |
#define | min(a, b) ((a) < (b) ? (a) : (b)) |
#define | max(a, b) ((a) > (b) ? (a) : (b)) |
#define | PROC_TYPE_CLIENT 0 |
#define | PROC_TYPE_CAS 1 |
#define | PROC_TYPE_BROKER 2 |
#define | READ_TYPE 1 |
#define | WRITE_TYPE 2 |
#define | CLIENT_READ_ERROR(i) io_error(i, PROC_TYPE_CLIENT, READ_TYPE) |
#define | CLIENT_WRITE_ERROR(i) io_error(i, PROC_TYPE_CLIENT, WRITE_TYPE) |
#define | CAS_READ_ERROR(i) io_error(i, PROC_TYPE_CAS, READ_TYPE) |
#define | CAS_WRITE_ERROR(i) io_error(i, PROC_TYPE_CAS, WRITE_TYPE) |
#define | MAX_NUM_NEW_CLIENT 5 |
#define | PROXY_START_PORT 1 |
#define | GET_CLIENT_PORT(broker_port, proxy_index) (broker_port) + PROXY_START_PORT + (proxy_index) |
#define | GET_CAS_PORT(broker_port, proxy_index, proxy_max_count) (broker_port) + PROXY_START_PORT + (proxy_max_count) + (proxy_index) |
Typedefs | |
typedef T_CAS_IO *(* | T_FUNC_FIND_CAS) (int shard_id, int cas_id, int ctx_cid, unsigned int ctx_uid) |
Functions | |
void | proxy_term (void) |
const char * | rel_build_number (void) |
static int | shard_io_set_fl (int fd, int flags) |
static void | proxy_socket_io_clear (T_SOCKET_IO *sock_io_p) |
static int | proxy_socket_io_initialize (void) |
static void | proxy_socket_io_destroy (void) |
static T_SOCKET_IO * | proxy_socket_io_add (SOCKET fd, bool from_cas) |
static T_SOCKET_IO * | proxy_socket_io_find (SOCKET fd) |
static int | proxy_socket_io_new_client (SOCKET lsnr_fd) |
static int | proxy_process_client_register (T_SOCKET_IO *sock_io_p) |
static int | proxy_process_client_request (T_SOCKET_IO *sock_io_p) |
static int | proxy_process_client_conn_error (T_SOCKET_IO *sock_io_p) |
static int | proxy_process_client_write_error (T_SOCKET_IO *sock_io_p) |
static int | proxy_process_client_read_error (T_SOCKET_IO *sock_io_p) |
static int | proxy_process_client_message (T_SOCKET_IO *sock_io_p) |
static int | proxy_process_cas_register (T_SOCKET_IO *sock_io_p) |
static int | proxy_process_cas_response (T_SOCKET_IO *sock_io_p) |
static int | proxy_process_cas_conn_error (T_SOCKET_IO *sock_io_p) |
static int | proxy_process_cas_write_error (T_SOCKET_IO *sock_io_p) |
static int | proxy_process_cas_read_error (T_SOCKET_IO *sock_io_p) |
static int | proxy_process_cas_message (T_SOCKET_IO *sock_io_p) |
static int | proxy_socket_io_write_internal (T_SOCKET_IO *sock_io_p) |
static void | proxy_socket_io_write_to_cas (T_SOCKET_IO *sock_io_p) |
static void | proxy_socket_io_write_to_client (T_SOCKET_IO *sock_io_p) |
static int | proxy_socket_io_read_internal (T_SOCKET_IO *sock_io_p) |
static void | proxy_socket_io_read_from_cas_next (T_SOCKET_IO *sock_io_p) |
static void | proxy_socket_io_read_from_cas_first (T_SOCKET_IO *sock_io_p) |
static void | proxy_socket_io_read_from_cas (T_SOCKET_IO *sock_io_p) |
static void | proxy_socket_io_read_from_client_next (T_SOCKET_IO *sock_io_p) |
static void | proxy_socket_io_read_from_client_first (T_SOCKET_IO *sock_io_p) |
static void | proxy_socket_io_read_from_client (T_SOCKET_IO *sock_io_p) |
static void | proxy_socket_io_write (T_SOCKET_IO *sock_io_p) |
static void | proxy_socket_io_write_error (T_SOCKET_IO *sock_io_p) |
static void | proxy_socket_io_read (T_SOCKET_IO *sock_io_p) |
static void | proxy_socket_io_read_error (T_SOCKET_IO *sock_io_p) |
static int | proxy_client_io_initialize (void) |
static void | proxy_client_io_destroy (void) |
static T_CLIENT_IO * | proxy_client_io_new (SOCKET fd, char *driver_info) |
static int | proxy_cas_io_initialize (int shard_id, T_CAS_IO **cas_io_pp, int size) |
static int | proxy_shard_io_initialize (void) |
static void | proxy_shard_io_destroy (void) |
static T_SHARD_IO * | proxy_shard_io_find (int shard_id) |
static T_CAS_IO * | proxy_cas_io_new (int shard_id, int cas_id, SOCKET fd) |
static void | proxy_cas_io_free (int shard_id, int cas_id) |
static T_CAS_IO * | proxy_cas_io_find_by_fd (int shard_id, int cas_id, SOCKET fd) |
static int | proxy_client_add_waiter_by_shard (T_SHARD_IO *shard_io_p, int ctx_cid, int ctx_uid, int timeout) |
static void | proxy_client_check_waiter_and_wakeup (T_SHARD_IO *shard_io_p, T_CAS_IO *cas_io_p) |
static SOCKET | proxy_io_connect_to_broker (void) |
static int | proxy_io_register_to_broker (void) |
static int | proxy_io_unixd_lsnr (char *unixd_sock_name) |
static int | proxy_io_cas_lsnr (void) |
static SOCKET | proxy_io_accept (SOCKET lsnr_fd) |
static SOCKET | proxy_io_cas_accept (SOCKET lsnr_fd) |
static void | proxy_init_net_buf (T_NET_BUF *net_buf) |
static int | proxy_io_make_ex_get_int (char *driver_info, char **buffer, int *argv) |
static void | proxy_set_conn_info (int func_code, int ctx_cid, int ctx_uid, int shard_id, int cas_id) |
static T_CAS_IO * | proxy_find_idle_cas_by_asc (int shard_id, int cas_id, int ctx_cid, unsigned int ctx_uid) |
static T_CAS_IO * | proxy_find_idle_cas_by_desc (int shard_id, int cas_id, int ctx_cid, unsigned int ctx_uid) |
static T_CAS_IO * | proxy_find_idle_cas_by_conn_info (int shard_id, int cas_id, int ctx_cid, unsigned int ctx_uid) |
static T_CAS_IO * | proxy_cas_alloc_by_shard_and_cas_id (int client_id, int shard_id, int cas_id, int ctx_cid, unsigned int ctx_uid) |
static T_CAS_IO * | proxy_cas_alloc_anything (int client_id, int shard_id, int cas_id, int ctx_cid, unsigned int ctx_uid, T_FUNC_FIND_CAS function) |
static int | proxy_check_authorization (T_PROXY_CONTEXT *ctx_p, const char *db_name, const char *db_user, const char *db_passwd) |
void | init_msg_header (MSG_HEADER *header) |
void | set_data_length (char *buffer, int length) |
int | get_data_length (char *buffer) |
int | get_msg_length (char *buffer) |
static int | get_dbinfo_length (char *driver_info) |
int | net_decode_str (char *msg, int msg_size, char *func_code, void ***ret_argv) |
char * | proxy_dup_msg (char *msg) |
void | proxy_set_con_status_in_tran (char *msg) |
void | proxy_set_con_status_out_tran (char *msg) |
void | proxy_set_force_out_tran (char *msg) |
void | proxy_unset_force_out_tran (char *msg) |
int | proxy_make_net_buf (T_NET_BUF *net_buf, int size, T_BROKER_VERSION client_version) |
int | proxy_io_make_error_msg (char *driver_info, char **buffer, int error_ind, int error_code, const char *error_msg, char is_in_tran) |
int | proxy_io_make_no_error (char *driver_info, char **buffer) |
int | proxy_io_make_con_close_ok (char *driver_info, char **buffer) |
int | proxy_io_make_end_tran_ok (char *driver_info, char **buffer) |
int | proxy_io_make_check_cas_ok (char *driver_info, char **buffer) |
int | proxy_io_make_set_db_parameter_ok (char *driver_info, char **buffer) |
int | proxy_io_make_ex_get_isolation_level (char *driver_info, char **buffer, void *argv) |
int | proxy_io_make_ex_get_lock_timeout (char *driver_info, char **buffer, void *argv) |
int | proxy_io_make_end_tran_request (char *driver_info, char **buffer, bool commit) |
int | proxy_io_make_end_tran_abort (char *driver_info, char **buffer) |
int | proxy_io_make_close_req_handle_ok (char *driver_info, char **buffer, bool is_in_tran) |
int | proxy_io_make_close_req_handle_out_tran_ok (char *driver_info, char **buffer) |
int | proxy_io_make_cursor_close_out_tran_ok (char *driver_info, char **buffer) |
int | proxy_io_make_get_db_version (char *driver_info, char **buffer) |
int | proxy_io_make_client_conn_ok (char *driver_info, char **buffer) |
int | proxy_io_make_client_proxy_alive (char *driver_info, char **buffer) |
int | proxy_io_make_client_dbinfo_ok (char *driver_info, char **buffer) |
int | proxy_io_make_client_acl_fail (char *driver_info, char **buffer) |
int | proxy_io_make_shard_info (char *driver_info, char **buffer) |
int | proxy_io_make_check_cas (char *driver_info, char **buffer) |
void | proxy_io_buffer_clear (T_IO_BUFFER *io_buffer) |
int | proxy_socket_io_delete (SOCKET fd) |
int | proxy_io_set_established_by_ctx (T_PROXY_CONTEXT *ctx_p) |
int | proxy_socket_set_write_event (T_SOCKET_IO *sock_io_p, T_PROXY_EVENT *event_p) |
char * | proxy_str_client_io (T_CLIENT_IO *cli_io_p) |
void | proxy_client_io_free (T_CLIENT_IO *cli_io_p) |
void | proxy_client_io_free_by_ctx (int client_id, int ctx_cid, int ctx_uid) |
T_CLIENT_IO * | proxy_client_io_find_by_ctx (int client_id, int ctx_cid, unsigned int ctx_uid) |
T_CLIENT_IO * | proxy_client_io_find_by_fd (int client_id, SOCKET fd) |
int | proxy_client_io_write (T_CLIENT_IO *cli_io_p, T_PROXY_EVENT *event_p) |
int | proxy_cas_io_write (T_CAS_IO *cas_io_p, T_PROXY_EVENT *event_p) |
char * | proxy_str_cas_io (T_CAS_IO *cas_io_p) |
void | proxy_cas_io_free_by_ctx (int shard_id, int cas_id, int ctx_cid, int unsigned ctx_uid) |
T_CAS_IO * | proxy_cas_find_io_by_ctx (int shard_id, int cas_id, int ctx_cid, unsigned int ctx_uid) |
T_CAS_IO * | proxy_cas_alloc_by_ctx (int client_id, int shard_id, int cas_id, int ctx_cid, unsigned int ctx_uid, int timeout, int func_code) |
void | proxy_cas_release_by_ctx (int shard_id, int cas_id, int ctx_cid, unsigned int ctx_uid) |
int | proxy_io_initialize (void) |
void | proxy_io_destroy (void) |
int | proxy_io_close_all_fd (void) |
int | proxy_io_process (void) |
char * | proxy_get_driver_info_by_ctx (T_PROXY_CONTEXT *ctx_p) |
char * | proxy_get_driver_info_by_fd (T_SOCKET_IO *sock_io_p) |
void | proxy_available_cas_wait_timer (void) |
int | proxy_convert_error_code (int error_ind, int error_code, char *driver_info, T_BROKER_VERSION client_version, bool to_new) |
Variables | |
T_SHM_APPL_SERVER * | shm_as_p |
T_SHM_PROXY * | shm_proxy_p |
T_PROXY_INFO * | proxy_info_p |
T_SHM_SHARD_USER * | shm_user_p |
T_SHM_SHARD_CONN * | shm_conn_p |
int | proxy_id |
T_PROXY_HANDLER | proxy_Handler |
T_PROXY_CONTEXT | proxy_Context |
bool | proxy_Keep_running |
int | maxfd = 0 |
fd_set | rset |
fd_set | wset |
fd_set | allset |
fd_set | wnewset |
fd_set | wallset |
SOCKET | broker_conn_fd = INVALID_SOCKET |
SOCKET | cas_lsnr_fd = INVALID_SOCKET |
T_SOCKET_IO_GLOBAL | proxy_Socket_io |
T_CLIENT_IO_GLOBAL | proxy_Client_io |
T_SHARD_IO_GLOBAL | proxy_Shard_io |
int | cas_info_size = CAS_INFO_SIZE |
#define CAS_READ_ERROR | ( | i | ) | io_error(i, PROC_TYPE_CAS, READ_TYPE) |
Definition at line 71 of file shard_proxy_io.c.
#define CAS_WRITE_ERROR | ( | i | ) | io_error(i, PROC_TYPE_CAS, WRITE_TYPE) |
Definition at line 72 of file shard_proxy_io.c.
#define CLIENT_READ_ERROR | ( | i | ) | io_error(i, PROC_TYPE_CLIENT, READ_TYPE) |
Definition at line 69 of file shard_proxy_io.c.
#define CLIENT_WRITE_ERROR | ( | i | ) | io_error(i, PROC_TYPE_CLIENT, WRITE_TYPE) |
Definition at line 70 of file shard_proxy_io.c.
#define GET_CAS_PORT | ( | broker_port, | |
proxy_index, | |||
proxy_max_count | |||
) | (broker_port) + PROXY_START_PORT + (proxy_max_count) + (proxy_index) |
Definition at line 78 of file shard_proxy_io.c.
Referenced by proxy_io_cas_lsnr().
#define GET_CLIENT_PORT | ( | broker_port, | |
proxy_index | |||
) | (broker_port) + PROXY_START_PORT + (proxy_index) |
Definition at line 77 of file shard_proxy_io.c.
Referenced by proxy_io_cas_lsnr().
#define max | ( | a, | |
b | |||
) | ((a) > (b) ? (a) : (b)) |
Definition at line 50 of file shard_proxy_io.c.
Referenced by btree_find_oid_from_ovfl(), btree_insert_object_ordered_by_oid(), classobj_cache_constraint_list(), classobj_drop_prop(), classobj_get_prop(), classobj_print_props(), classobj_put_prop(), createdb(), db_json_value_get_depth(), disk_extend(), disk_rv_undo_format(), ehash_dir_locate(), fetch_set_internal(), find_all_triggers(), fpcache_initialize(), get_property_list(), cubscan::json_table::scanner::get_tree_height(), get_user_trigger_objects(), ini_getuint_max(), main(), mq_check_cycle(), mq_updatable(), or_cl_get_prop_nocopy(), or_class_tde_algorithm(), orc_subclasses_from_record(), partition_prune_range(), property_list_size(), proxy_io_cas_lsnr(), proxy_io_register_to_broker(), proxy_socket_io_add(), pruningset_union(), put_property_list(), query_info_add(), query_info_print(), shard_metadata_bsearch_key(), shard_metadata_bsearch_range(), sort_func(), sysprm_generate_new_value(), tr_dump_selective_triggers(), tr_status_as_string(), tr_update_user_cache(), trigger_table_add(), trigger_table_drop(), trigger_table_find(), trigger_table_rename(), util_bsearch(), and xcache_initialize().
#define MAX_NUM_NEW_CLIENT 5 |
Definition at line 74 of file shard_proxy_io.c.
#define min | ( | a, | |
b | |||
) | ((a) < (b) ? (a) : (b)) |
Definition at line 47 of file shard_proxy_io.c.
Referenced by adj_ar_reset(), brief_monitor(), btree_find_oid_from_ovfl(), btree_insert_object_ordered_by_oid(), cubload::semantic_helper::clear(), createdb(), db_date_dbval(), db_date_diff(), db_new_time(), db_string_datetime(), db_string_time(), db_string_timestamp(), db_time_dbval(), db_time_to_string(), db_timestamp_encode_utc(), fmt_minute_value(), fmt_time_value(), string_buffer::hex_dump(), ini_getuint(), jsp_pack_datetime_argument(), jsp_pack_time_argument(), jsp_pack_timestamp_argument(), ko_time_string(), local_am_pm_string(), cubthread::looper::looper(), main(), partition_prune_range(), qexec_schema_get_type_desc(), query_info_add(), query_info_print(), set_time_argument(), shard_metadata_bsearch_key(), shard_metadata_bsearch_range(), sort_exphase_merge(), sort_exphase_merge_elim_dup(), str_to_offset_rule_until(), sysprm_generate_new_value(), tm_encode(), tr_check_recursivity(), tz_explain_tz_id(), tz_str_to_seconds(), tz_zone_info_to_str(), cubpacking::unpacker::unpack_buffer_with_length(), us_time_string(), and util_bsearch().
#define PROC_TYPE_BROKER 2 |
Definition at line 64 of file shard_proxy_io.c.
#define PROC_TYPE_CAS 1 |
Definition at line 63 of file shard_proxy_io.c.
#define PROC_TYPE_CLIENT 0 |
Definition at line 62 of file shard_proxy_io.c.
#define PROXY_START_PORT 1 |
Definition at line 76 of file shard_proxy_io.c.
#define READ_TYPE 1 |
Definition at line 66 of file shard_proxy_io.c.
#define WRITE_TYPE 2 |
Definition at line 67 of file shard_proxy_io.c.
typedef T_CAS_IO*(* T_FUNC_FIND_CAS) (int shard_id, int cas_id, int ctx_cid, unsigned int ctx_uid) |
Definition at line 90 of file shard_proxy_io.c.
int get_data_length | ( | char * | buffer | ) |
Definition at line 238 of file shard_proxy_io.c.
References assert, and ntohl().
Referenced by get_msg_length(), and proxy_handler_process_client_request().
|
static |
Definition at line 256 of file shard_proxy_io.c.
References CAS_MAKE_PROTO_VER, CAS_MAKE_VER, SRV_CON_DB_INFO_SIZE, SRV_CON_DB_INFO_SIZE_PRIOR_8_2_0, and SRV_CON_DB_INFO_SIZE_PRIOR_8_4_0.
Referenced by proxy_socket_io_read_from_client_first().
int get_msg_length | ( | char * | buffer | ) |
Definition at line 250 of file shard_proxy_io.c.
References get_data_length(), and MSG_HEADER_SIZE.
Referenced by fn_proxy_cas_prepare(), proxy_client_execute_internal(), proxy_dup_msg(), proxy_process_cas_register(), proxy_send_prepared_stmt_to_client(), proxy_socket_io_read_internal(), and shard_stmt_save_prepare_request().
void init_msg_header | ( | MSG_HEADER * | header | ) |
Definition at line 215 of file shard_proxy_io.c.
References MSG_HEADER::buf, CAS_INFO_ADDITIONAL_FLAG, CAS_INFO_FLAG_MASK_NEW_SESSION_ID, CAS_INFO_RESERVED_1, CAS_INFO_RESERVED_2, CAS_INFO_RESERVED_DEFAULT, CAS_INFO_STATUS, CAS_INFO_STATUS_INACTIVE, MSG_HEADER::info_ptr, MSG_HEADER::msg_body_size_ptr, and MSG_HEADER_MSG_SIZE.
Referenced by proxy_init_net_buf().
int net_decode_str | ( | char * | msg, |
int | msg_size, | ||
char * | func_code, | ||
void *** | ret_argv | ||
) |
Definition at line 272 of file shard_proxy_io.c.
References argc, argv, CAS_ER_COMMUNICATION, CAS_ER_NO_MORE_MEMORY, FREE_MEM, ntohl(), NULL, and REALLOC.
void proxy_available_cas_wait_timer | ( | void | ) |
Definition at line 4545 of file shard_proxy_io.c.
References t_shard_io_global::ent, i, t_shard_io_global::max_shard, NULL, PROXY_DEBUG_LOG, proxy_waiter_timeout(), t_shard_io::shard_id, shard_queue_peek_value(), shard_shm_find_shard_info(), t_shard_info::waiter_count, and t_shard_io::waitq.
Referenced by proxy_timer_process().
|
static |
Definition at line 4762 of file shard_proxy_io.c.
References assert, t_cas_io::ctx_cid, t_cas_io::ctx_uid, t_shard_io::cur_num_cas, t_shard_io_global::ent, t_cas_io::fd, i, INVALID_SOCKET, t_cas_io::is_in_tran, t_shard_io_global::max_shard, NULL, t_shard_io::num_cas_in_tran, PROXY_DEBUG_LOG, PROXY_INVALID_CONTEXT, PROXY_LOG, PROXY_LOG_MODE_SHARD_DETAIL, and t_shard_io::shard_id.
Referenced by proxy_cas_alloc_by_ctx().
T_CAS_IO* proxy_cas_alloc_by_ctx | ( | int | client_id, |
int | shard_id, | ||
int | cas_id, | ||
int | ctx_cid, | ||
unsigned int | ctx_uid, | ||
int | timeout, | ||
int | func_code | ||
) |
Definition at line 3612 of file shard_proxy_io.c.
References assert, CAS_FC_CHECK_CAS, t_cas_io::cas_id, t_cas_io::ctx_cid, t_cas_io::ctx_uid, t_shard_io::cur_num_cas, t_shard_io_global::ent, error(), t_cas_io::is_in_tran, t_shard_io::max_num_cas, t_shard_io_global::max_shard, NULL, proxy_cas_alloc_anything(), proxy_cas_alloc_by_shard_and_cas_id(), proxy_client_add_waiter_by_shard(), proxy_find_idle_cas_by_asc(), proxy_find_idle_cas_by_conn_info(), proxy_find_idle_cas_by_desc(), PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_set_conn_info(), t_cas_io::shard_id, shard_shm_get_client_info(), shard_shm_set_as_client_info_with_db_param(), and SHARD_TEMPORARY_UNAVAILABLE.
Referenced by fn_proxy_client_close_req_handle(), fn_proxy_client_cursor(), fn_proxy_client_cursor_close(), fn_proxy_client_fetch(), fn_proxy_client_prepare(), fn_proxy_client_prepare_and_execute(), proxy_client_execute_internal(), proxy_send_request_to_cas(), proxy_send_request_to_cas_with_new_event(), and proxy_wakeup_context_by_shard().
|
static |
Definition at line 4616 of file shard_proxy_io.c.
References assert, CAS_IO_CONNECTED, t_cas_io::ctx_cid, t_cas_io::ctx_uid, t_shard_io::cur_num_cas, t_shard_io::ent, t_shard_io_global::ent, t_cas_io::is_in_tran, t_shard_io::max_num_cas, NULL, t_shard_io::num_cas_in_tran, PROXY_DEBUG_LOG, PROXY_INVALID_CONTEXT, PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_str_cas_io(), t_shard_io::shard_id, and t_cas_io::status.
Referenced by proxy_cas_alloc_by_ctx().
T_CAS_IO* proxy_cas_find_io_by_ctx | ( | int | shard_id, |
int | cas_id, | ||
int | ctx_cid, | ||
unsigned int | ctx_uid | ||
) |
Definition at line 3581 of file shard_proxy_io.c.
References t_cas_io::ctx_cid, t_cas_io::ctx_uid, t_shard_io::ent, t_shard_io_global::ent, t_cas_io::is_in_tran, t_shard_io::max_num_cas, t_shard_io_global::max_shard, NULL, PROXY_DEBUG_LOG, PROXY_LOG, PROXY_LOG_MODE_ERROR, and proxy_str_cas_io().
Definition at line 3556 of file shard_proxy_io.c.
References assert, t_shard_io::ent, t_shard_io_global::ent, t_cas_io::fd, INVALID_SOCKET, t_shard_io_global::max_shard, NULL, and PROXY_DEBUG_LOG.
Referenced by proxy_process_cas_conn_error(), and proxy_process_cas_response().
|
static |
Definition at line 3426 of file shard_proxy_io.c.
References assert, t_cas_io::cas_id, CAS_IO_NOT_CONNECTED, t_cas_io::ctx_cid, t_cas_io::ctx_uid, t_shard_io::cur_num_cas, t_shard_io::ent, t_shard_io_global::ent, ENTER_FUNC, EXIT_FUNC, t_cas_io::fd, INVALID_SOCKET, t_cas_io::is_in_tran, t_shard_io::max_num_cas, t_shard_io_global::max_shard, t_shard_io::num_cas_in_tran, PROXY_DEBUG_LOG, PROXY_INVALID_CONTEXT, PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_socket_io_delete(), t_cas_io::shard_id, t_shard_io::shard_id, shard_stmt_del_all_srv_h_id_for_shard_cas(), and t_cas_io::status.
Referenced by proxy_process_cas_conn_error(), proxy_process_cas_register(), and proxy_process_cas_response().
void proxy_cas_io_free_by_ctx | ( | int | shard_id, |
int | cas_id, | ||
int | ctx_cid, | ||
int unsigned | ctx_uid | ||
) |
Definition at line 3486 of file shard_proxy_io.c.
References assert, t_cas_io::cas_id, CAS_IO_NOT_CONNECTED, t_cas_io::ctx_cid, t_cas_io::ctx_uid, t_shard_io::cur_num_cas, t_shard_io::ent, t_shard_io_global::ent, ENTER_FUNC, EXIT_FUNC, t_cas_io::fd, INVALID_SOCKET, t_cas_io::is_in_tran, t_shard_io::max_num_cas, t_shard_io_global::max_shard, t_shard_io::num_cas_in_tran, PROXY_DEBUG_LOG, PROXY_INVALID_CONTEXT, PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_socket_io_delete(), proxy_str_cas_io(), t_cas_io::shard_id, t_shard_io::shard_id, shard_stmt_del_all_srv_h_id_for_shard_cas(), and t_cas_io::status.
Referenced by proxy_context_free_shard().
|
static |
Definition at line 3172 of file shard_proxy_io.c.
References assert, t_cas_io::cas_id, t_cas_io::ctx_cid, t_cas_io::ctx_uid, t_cas_io::fd, i, INVALID_SOCKET, t_cas_io::is_in_tran, NULL, PROXY_INVALID_CONTEXT, and t_cas_io::shard_id.
Referenced by proxy_shard_io_initialize().
Definition at line 3378 of file shard_proxy_io.c.
References assert, CAS_IO_NOT_CONNECTED, t_cas_io::ctx_cid, t_cas_io::ctx_uid, t_shard_io::cur_num_cas, t_shard_io::ent, t_shard_io_global::ent, t_cas_io::fd, INVALID_SOCKET, t_cas_io::is_in_tran, t_shard_io::max_num_cas, t_shard_io_global::max_shard, NULL, PROXY_INVALID_CONTEXT, PROXY_LOG, PROXY_LOG_MODE_ERROR, PROXY_LOG_MODE_SHARD_DETAIL, proxy_shard_io_print(), proxy_str_cas_io(), and t_cas_io::status.
Referenced by proxy_process_cas_register().
int proxy_cas_io_write | ( | T_CAS_IO * | cas_io_p, |
T_PROXY_EVENT * | event_p | ||
) |
Definition at line 3204 of file shard_proxy_io.c.
References assert, error(), t_cas_io::fd, NULL, PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_socket_io_find(), proxy_socket_set_write_event(), proxy_str_cas_io(), and proxy_str_event().
Referenced by fn_proxy_client_close_req_handle(), fn_proxy_client_cursor(), fn_proxy_client_cursor_close(), fn_proxy_client_fetch(), fn_proxy_client_prepare(), fn_proxy_client_prepare_and_execute(), proxy_client_execute_internal(), proxy_send_request_to_cas(), and proxy_send_request_to_cas_with_new_event().
void proxy_cas_release_by_ctx | ( | int | shard_id, |
int | cas_id, | ||
int | ctx_cid, | ||
unsigned int | ctx_uid | ||
) |
Definition at line 3719 of file shard_proxy_io.c.
References assert, t_cas_io::ctx_cid, t_cas_io::ctx_uid, t_shard_io::ent, t_shard_io_global::ent, ENTER_FUNC, EXIT_FUNC, t_cas_io::is_in_tran, t_shard_io::max_num_cas, t_shard_io_global::max_shard, t_shard_io::num_cas_in_tran, proxy_client_check_waiter_and_wakeup(), PROXY_DEBUG_LOG, PROXY_INVALID_CONTEXT, PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_str_cas_io(), and t_shard_io::shard_id.
Referenced by proxy_handler_process_cas_response().
|
static |
Definition at line 4829 of file shard_proxy_io.c.
References t_proxy_info::appl_server, APPL_SERVER_CAS_MYSQL, assert, CAS_ER_NOT_AUTHORIZED_CLIENT, t_shard_user::db_name, t_shard_user::db_password, t_shard_user::db_user, DBMS_ERROR_INDICATOR, t_proxy_info::fixed_shard_user, NULL, proxy_context_set_error_with_msg(), PROXY_LOG, PROXY_LOG_MODE_ERROR, and shard_metadata_get_shard_user().
Referenced by proxy_process_client_register().
|
static |
Definition at line 3777 of file shard_proxy_io.c.
References assert, ENTER_FUNC, error(), EXIT_FUNC, NULL, PROXY_DEBUG_LOG, proxy_waiter_comp_fn(), proxy_waiter_new(), t_shard_io::shard_id, shard_queue_ordered_enqueue(), shard_shm_find_shard_info(), t_shard_info::waiter_count, and t_shard_io::waitq.
Referenced by proxy_cas_alloc_by_ctx().
|
static |
Definition at line 3816 of file shard_proxy_io.c.
References assert, t_cas_io::cas_id, ENTER_FUNC, error(), EXIT_FUNC, FREE_MEM, NULL, PROXY_DEBUG_LOG, PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_wakeup_context_by_shard(), t_cas_io::shard_id, t_shard_io::shard_id, shard_queue_dequeue(), shard_shm_find_shard_info(), t_shard_info::waiter_count, and t_shard_io::waitq.
Referenced by proxy_cas_release_by_ctx(), and proxy_process_cas_register().
|
static |
Definition at line 2938 of file shard_proxy_io.c.
References t_client_io::client_id, t_client_io::ctx_cid, t_client_io::ctx_uid, t_client_io_global::cur_client, t_client_io_global::ent, t_client_io::fd, FREE_MEM, t_client_io_global::freeq, i, t_client_io::is_busy, t_client_io_global::max_client, t_client_io_global::max_context, NULL, proxy_client_io_print(), PROXY_LOG, PROXY_LOG_MODE_SCHEDULE_DETAIL, and shard_cqueue_destroy().
Referenced by proxy_client_io_initialize(), and proxy_io_destroy().
T_CLIENT_IO* proxy_client_io_find_by_ctx | ( | int | client_id, |
int | ctx_cid, | ||
unsigned int | ctx_uid | ||
) |
Definition at line 3100 of file shard_proxy_io.c.
References t_client_io::ctx_cid, t_client_io::ctx_uid, t_client_io_global::ent, t_client_io::is_busy, t_client_io_global::max_context, NULL, PROXY_LOG, and PROXY_LOG_MODE_ERROR.
Referenced by proxy_client_io_free_by_ctx(), proxy_get_driver_info_by_ctx(), proxy_io_set_established_by_ctx(), and proxy_send_response_to_client().
T_CLIENT_IO* proxy_client_io_find_by_fd | ( | int | client_id, |
SOCKET | fd | ||
) |
Definition at line 3124 of file shard_proxy_io.c.
References assert, t_client_io_global::ent, t_client_io::fd, t_client_io::is_busy, t_client_io_global::max_context, NULL, PROXY_LOG, and PROXY_LOG_MODE_ERROR.
Referenced by proxy_context_find_by_socket_client_io(), and proxy_get_driver_info_by_fd().
void proxy_client_io_free | ( | T_CLIENT_IO * | cli_io_p | ) |
Definition at line 3049 of file shard_proxy_io.c.
References assert, t_client_io::ctx_cid, t_client_io::ctx_uid, t_client_io_global::cur_client, t_proxy_info::cur_client, t_client_io::driver_info, error(), t_client_io::fd, t_client_io_global::freeq, INVALID_SOCKET, t_client_io::is_busy, PROXY_INVALID_CONTEXT, proxy_socket_io_delete(), shard_cqueue_enqueue(), and SRV_CON_CLIENT_INFO_SIZE.
Referenced by proxy_client_io_free_by_ctx(), proxy_client_io_new(), and proxy_context_find_by_socket_client_io().
void proxy_client_io_free_by_ctx | ( | int | client_id, |
int | ctx_cid, | ||
int | ctx_uid | ||
) |
Definition at line 3083 of file shard_proxy_io.c.
References NULL, proxy_client_io_find_by_ctx(), and proxy_client_io_free().
Referenced by proxy_context_free_client().
|
static |
Definition at line 2884 of file shard_proxy_io.c.
References t_client_io::client_id, t_client_io::ctx_cid, t_client_io::ctx_uid, t_client_io_global::cur_client, t_client_io_global::ent, error(), t_client_io::fd, t_client_io_global::freeq, i, INVALID_SOCKET, t_client_io::is_busy, t_client_io_global::max_client, t_shm_proxy::max_client, t_client_io_global::max_context, t_shm_proxy::max_context, NULL, proxy_client_io_destroy(), PROXY_INVALID_CONTEXT, PROXY_LOG, PROXY_LOG_MODE_ERROR, shard_cqueue_enqueue(), and shard_cqueue_initialize().
Referenced by proxy_io_initialize().
|
static |
Definition at line 2995 of file shard_proxy_io.c.
References CAS_ER_MAX_CLIENT_EXCEEDED, t_proxy_context::cid, t_client_io::client_id, t_proxy_context::client_id, t_client_io::ctx_cid, t_client_io::ctx_uid, t_client_io_global::cur_client, t_proxy_info::cur_client, DBMS_ERROR_INDICATOR, t_client_io::driver_info, t_client_io::fd, t_client_io_global::freeq, t_client_io::is_busy, t_client_io_global::max_client, NULL, proxy_client_io_free(), proxy_client_io_print(), proxy_context_new(), proxy_context_set_error_with_msg(), PROXY_LOG, PROXY_LOG_MODE_ERROR, PROXY_LOG_MODE_SHARD_DETAIL, proxy_str_client_io(), shard_cqueue_dequeue(), SRV_CON_CLIENT_INFO_SIZE, and t_proxy_context::uid.
Referenced by proxy_socket_io_new_client().
int proxy_client_io_write | ( | T_CLIENT_IO * | cli_io_p, |
T_PROXY_EVENT * | event_p | ||
) |
Definition at line 3144 of file shard_proxy_io.c.
References assert, error(), t_client_io::fd, NULL, PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_socket_io_find(), proxy_socket_set_write_event(), proxy_str_client_io(), and proxy_str_event().
Referenced by proxy_send_response_to_client().
int proxy_convert_error_code | ( | int | error_ind, |
int | error_code, | ||
char * | driver_info, | ||
T_BROKER_VERSION | client_version, | ||
bool | to_new | ||
) |
Definition at line 4885 of file shard_proxy_io.c.
References assert, CAS_CONV_ERROR_TO_NEW, CAS_CONV_ERROR_TO_OLD, cas_di_understand_renewed_error_code(), CAS_ER_NOT_AUTHORIZED_CLIENT, CAS_ERROR_INDICATOR, CAS_MAKE_VER, CLOSE_SOCKET, DOES_CLIENT_MATCH_THE_PROTOCOL, error(), INVALID_SOCKET, t_shard_info::max_appl_server, t_proxy_info::max_context, t_proxy_info::max_shard, NO_ERROR, NULL, PROTOCOL_V2, PROXY_CONV_ERR_TO_NEW, PROXY_LOG, PROXY_LOG_MODE_ERROR, and shard_shm_find_shard_info().
Referenced by proxy_io_make_error_msg(), and proxy_is_invalid_statement().
char* proxy_dup_msg | ( | char * | msg | ) |
Definition at line 440 of file shard_proxy_io.c.
References get_msg_length(), and p.
Referenced by fn_proxy_cas_prepare(), proxy_client_execute_internal(), proxy_send_prepared_stmt_to_client(), and shard_stmt_save_prepare_request().
|
static |
Definition at line 4666 of file shard_proxy_io.c.
References CAS_IO_CONNECTED, t_shard_io::cur_num_cas, t_shard_io::ent, t_shard_io_global::ent, i, t_cas_io::is_in_tran, NULL, and t_cas_io::status.
Referenced by proxy_cas_alloc_by_ctx().
|
static |
Definition at line 4714 of file shard_proxy_io.c.
References t_proxy_info::appl_server, APPL_SERVER_CAS_MYSQL, assert, CAS_IO_CONNECTED, t_shard_io::cur_num_cas, t_proxy_context::database_passwd, t_appl_server_info::database_passwd, t_proxy_context::database_user, t_appl_server_info::database_user, t_shard_io::ent, t_shard_io_global::ent, i, t_cas_io::is_in_tran, NULL, proxy_context_find(), shard_shm_get_as_info(), and t_cas_io::status.
Referenced by proxy_cas_alloc_by_ctx().
|
static |
Definition at line 4690 of file shard_proxy_io.c.
References CAS_IO_CONNECTED, t_shard_io::cur_num_cas, t_shard_io::ent, t_shard_io_global::ent, i, t_cas_io::is_in_tran, NULL, and t_cas_io::status.
Referenced by proxy_cas_alloc_by_ctx().
char* proxy_get_driver_info_by_ctx | ( | T_PROXY_CONTEXT * | ctx_p | ) |
Definition at line 4485 of file shard_proxy_io.c.
References assert, BROKER_RENEWED_ERROR_CODE, BROKER_SUPPORT_HOLDABLE_RESULT, CAS_CLIENT_JDBC, CAS_PROTO_INDICATOR, t_proxy_context::cid, t_proxy_context::client_id, CURRENT_PROTOCOL, NULL, proxy_client_io_find_by_ctx(), SRV_CON_CLIENT_INFO_SIZE, and t_proxy_context::uid.
Referenced by fn_proxy_cas_check_cas(), fn_proxy_cas_prepare(), fn_proxy_cas_prepare_and_execute(), fn_proxy_cas_schema_info(), fn_proxy_client_check_cas(), fn_proxy_client_execute(), fn_proxy_client_execute_array(), fn_proxy_client_get_db_parameter(), fn_proxy_client_prepare(), fn_proxy_client_prepare_and_execute(), fn_proxy_client_schema_info(), fn_proxy_client_set_db_parameter(), proxy_cas_execute_internal(), proxy_context_send_error(), proxy_handler_process_client_request(), proxy_send_request_to_cas_with_new_event(), and proxy_send_response_to_client_with_new_event().
char* proxy_get_driver_info_by_fd | ( | T_SOCKET_IO * | sock_io_p | ) |
Definition at line 4515 of file shard_proxy_io.c.
References assert, BROKER_RENEWED_ERROR_CODE, BROKER_SUPPORT_HOLDABLE_RESULT, CAS_CLIENT_JDBC, CAS_PROTO_INDICATOR, t_socket_io::client_id, CURRENT_PROTOCOL, t_socket_io::fd, t_socket_io::id, NULL, proxy_client_io_find_by_fd(), and SRV_CON_CLIENT_INFO_SIZE.
Referenced by proxy_process_client_register(), and proxy_socket_io_read_from_client_first().
|
static |
Definition at line 530 of file shard_proxy_io.c.
References assert, MSG_HEADER::buf, CAS_INFO_ADDITIONAL_FLAG, CAS_INFO_FLAG_MASK_AUTOCOMMIT, CAS_INFO_FLAG_MASK_NEW_SESSION_ID, CAS_INFO_SIZE, CAS_INFO_STATUS, CAS_INFO_STATUS_INACTIVE, t_shm_appl_server::cci_default_autocommit, t_net_buf::data, t_net_buf::data_size, htonl(), MSG_HEADER::info_ptr, init_msg_header(), MSG_HEADER::msg_body_size_ptr, and NET_BUF_HEADER_MSG_SIZE.
Referenced by proxy_io_make_check_cas(), proxy_io_make_client_proxy_alive(), proxy_io_make_close_req_handle_ok(), proxy_io_make_end_tran_request(), proxy_io_make_error_msg(), proxy_io_make_ex_get_int(), proxy_io_make_get_db_version(), and proxy_io_make_shard_info().
Definition at line 4110 of file shard_proxy_io.c.
References IS_INVALID_SOCKET, and shard_sock_addr.
Referenced by proxy_io_cas_accept().
void proxy_io_buffer_clear | ( | T_IO_BUFFER * | io_buffer | ) |
Definition at line 1123 of file shard_proxy_io.c.
References assert, t_io_buffer::data, FREE_MEM, t_io_buffer::length, and t_io_buffer::offset.
Referenced by proxy_event_free().
Definition at line 4135 of file shard_proxy_io.c.
References proxy_io_accept().
Referenced by proxy_io_process().
|
static |
Definition at line 4038 of file shard_proxy_io.c.
References allset, broker_port, cas_lsnr_fd, CLOSE_SOCKET, error(), GET_CAS_PORT, GET_CLIENT_PORT, IS_INVALID_SOCKET, max, maxfd, t_shm_proxy::num_proxy, t_proxy_info::port_name, t_proxy_info::proxy_id, proxy_io_unixd_lsnr(), PROXY_LOG, PROXY_LOG_MODE_ERROR, PROXY_LOG_MODE_NOTICE, and shard_io_set_fl().
Referenced by proxy_io_initialize().
int proxy_io_close_all_fd | ( | void | ) |
Definition at line 4254 of file shard_proxy_io.c.
References broker_conn_fd, cas_lsnr_fd, CLOSE_SOCKET, t_socket_io_global::ent, t_socket_io::fd, i, INVALID_SOCKET, and t_socket_io_global::max_socket.
Referenced by proxy_io_destroy().
|
static |
Definition at line 3858 of file shard_proxy_io.c.
References CLOSESOCKET, NULL, t_shm_appl_server::port_name, PROXY_LOG, PROXY_LOG_MODE_NOTICE, and strlen.
Referenced by proxy_io_register_to_broker().
void proxy_io_destroy | ( | void | ) |
Definition at line 4239 of file shard_proxy_io.c.
References FREE_MEM, proxy_client_io_destroy(), proxy_io_close_all_fd(), proxy_shard_io_destroy(), and proxy_socket_io_destroy().
Referenced by proxy_term().
int proxy_io_initialize | ( | void | ) |
Definition at line 4149 of file shard_proxy_io.c.
References allset, assert, broker_port, t_shm_appl_server::broker_port, error(), INVALID_SOCKET, NULL, proxy_client_io_initialize(), proxy_io_cas_lsnr(), proxy_io_register_to_broker(), PROXY_LOG, PROXY_LOG_MODE_ERROR, PROXY_RESERVED_FD, proxy_shard_io_initialize(), proxy_socket_io_initialize(), and wnewset.
Referenced by main().
int proxy_io_make_check_cas | ( | char * | driver_info, |
char ** | buffer | ||
) |
Definition at line 1089 of file shard_proxy_io.c.
References assert, CAS_FC_CHECK_CAS, CAS_MAKE_PROTO_VER, t_net_buf::data, t_net_buf::data_size, error(), MSG_HEADER_SIZE, net_buf_cp_byte(), NULL, proxy_init_net_buf(), PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_make_net_buf(), proxy_set_force_out_tran(), and set_data_length().
Referenced by proxy_process_client_register().
int proxy_io_make_check_cas_ok | ( | char * | driver_info, |
char ** | buffer | ||
) |
Definition at line 682 of file shard_proxy_io.c.
References proxy_io_make_no_error().
Referenced by fn_proxy_client_check_cas().
int proxy_io_make_client_acl_fail | ( | char * | driver_info, |
char ** | buffer | ||
) |
Definition at line 1025 of file shard_proxy_io.c.
References CAS_ER_NOT_AUTHORIZED_CLIENT, DBMS_ERROR_INDICATOR, and proxy_io_make_error_msg().
int proxy_io_make_client_conn_ok | ( | char * | driver_info, |
char ** | buffer | ||
) |
Definition at line 878 of file shard_proxy_io.c.
References NULL.
Referenced by proxy_socket_io_new_client().
int proxy_io_make_client_dbinfo_ok | ( | char * | driver_info, |
char ** | buffer | ||
) |
Definition at line 922 of file shard_proxy_io.c.
References t_proxy_info::appl_server, APPL_SERVER_CAS_MYSQL, APPL_SERVER_CAS_MYSQL51, APPL_SERVER_CAS_ORACLE, assert, broker_info, BROKER_INFO_SIZE, cas_bi_make_broker_info(), CAS_CONNECTION_REPLY_SIZE, CAS_CONNECTION_REPLY_SIZE_PRIOR_PROTOCOL_V3, CAS_CONNECTION_REPLY_SIZE_V3, CAS_DBMS_CUBRID, CAS_INFO_SIZE, cas_info_size, CAS_MAKE_PROTO_VER, CAS_PID_SIZE, CAS_PROXY_DBMS_CUBRID, CAS_PROXY_DBMS_MYSQL, CAS_PROXY_DBMS_ORACLE, t_shm_appl_server::cci_pconnect, DOES_CLIENT_UNDERSTAND_THE_PROTOCOL, DRIVER_SESSION_SIZE, htonl(), NULL, p, PROTOCOL_SIZE, PROTOCOL_V3, PROTOCOL_V4, PROTOCOL_V5, PROXY_CONNECTION_REPLY_SIZE, proxy_id, SESSION_ID_SIZE, and t_shm_appl_server::statement_pooling.
Referenced by fn_proxy_cas_check_cas(), and proxy_process_client_register().
int proxy_io_make_client_proxy_alive | ( | char * | driver_info, |
char ** | buffer | ||
) |
Definition at line 893 of file shard_proxy_io.c.
References assert, CAS_MAKE_PROTO_VER, t_net_buf::data, t_net_buf::data_size, error(), MSG_HEADER_SIZE, NULL, proxy_init_net_buf(), PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_make_net_buf(), and set_data_length().
Referenced by proxy_process_client_register().
int proxy_io_make_close_req_handle_ok | ( | char * | driver_info, |
char ** | buffer, | ||
bool | is_in_tran | ||
) |
Definition at line 765 of file shard_proxy_io.c.
References assert, CAS_INFO_STATUS, CAS_INFO_STATUS_ACTIVE, CAS_INFO_STATUS_INACTIVE, CAS_MAKE_PROTO_VER, t_net_buf::data, t_net_buf::data_size, error(), MSG_HEADER_MSG_SIZE, MSG_HEADER_SIZE, net_buf_cp_int(), NULL, p, proxy_init_net_buf(), proxy_io_make_close_req_handle_ok(), PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_make_net_buf(), set_data_length(), and SHARD_NET_BUF_ALLOC_SIZE.
Referenced by proxy_io_make_close_req_handle_ok(), proxy_io_make_close_req_handle_out_tran_ok(), and proxy_io_make_cursor_close_out_tran_ok().
int proxy_io_make_close_req_handle_out_tran_ok | ( | char * | driver_info, |
char ** | buffer | ||
) |
Definition at line 820 of file shard_proxy_io.c.
References proxy_io_make_close_req_handle_ok().
Referenced by fn_proxy_client_close_req_handle().
int proxy_io_make_con_close_ok | ( | char * | driver_info, |
char ** | buffer | ||
) |
Definition at line 670 of file shard_proxy_io.c.
References proxy_io_make_no_error().
Referenced by fn_proxy_cas_end_tran(), and fn_proxy_client_con_close().
int proxy_io_make_cursor_close_out_tran_ok | ( | char * | driver_info, |
char ** | buffer | ||
) |
Definition at line 826 of file shard_proxy_io.c.
References proxy_io_make_close_req_handle_ok().
Referenced by fn_proxy_client_cursor_close().
int proxy_io_make_end_tran_abort | ( | char * | driver_info, |
char ** | buffer | ||
) |
Definition at line 759 of file shard_proxy_io.c.
References proxy_io_make_end_tran_request().
Referenced by fn_proxy_client_con_close(), and fn_proxy_client_conn_error().
int proxy_io_make_end_tran_ok | ( | char * | driver_info, |
char ** | buffer | ||
) |
Definition at line 676 of file shard_proxy_io.c.
References proxy_io_make_no_error().
Referenced by fn_proxy_client_end_tran().
int proxy_io_make_end_tran_request | ( | char * | driver_info, |
char ** | buffer, | ||
bool | commit | ||
) |
Definition at line 706 of file shard_proxy_io.c.
References assert, CAS_FC_END_TRAN, CAS_MAKE_PROTO_VER, t_net_buf::data, t_net_buf::data_size, error(), MSG_HEADER_SIZE, net_buf_cp_byte(), net_buf_cp_int(), NET_SIZE_BYTE, NULL, proxy_init_net_buf(), proxy_io_make_end_tran_request(), PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_make_net_buf(), set_data_length(), SHARD_NET_BUF_ALLOC_SIZE, and tran_commit().
Referenced by proxy_io_make_end_tran_abort(), and proxy_io_make_end_tran_request().
int proxy_io_make_error_msg | ( | char * | driver_info, |
char ** | buffer, | ||
int | error_ind, | ||
int | error_code, | ||
const char * | error_msg, | ||
char | is_in_tran | ||
) |
Definition at line 601 of file shard_proxy_io.c.
References assert, CAS_MAKE_PROTO_VER, CAS_MAKE_VER, CAS_NO_ERROR, t_net_buf::data, t_net_buf::data_size, error(), MSG_HEADER_SIZE, net_buf_cp_int(), net_buf_cp_str(), NULL, PROXY_CONV_ERR_TO_OLD, proxy_convert_error_code(), PROXY_DEBUG_LOG, proxy_init_net_buf(), PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_make_net_buf(), proxy_set_con_status_in_tran(), set_data_length(), SHARD_NET_BUF_ALLOC_SIZE, and strlen.
Referenced by fn_proxy_cas_prepare(), proxy_context_send_error(), proxy_io_make_client_acl_fail(), and proxy_io_make_no_error().
|
static |
Definition at line 560 of file shard_proxy_io.c.
References assert, CAS_MAKE_PROTO_VER, t_net_buf::data, t_net_buf::data_size, error(), MSG_HEADER_SIZE, net_buf_cp_int(), NULL, proxy_init_net_buf(), PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_make_net_buf(), set_data_length(), and SHARD_NET_BUF_ALLOC_SIZE.
Referenced by proxy_io_make_ex_get_isolation_level(), and proxy_io_make_ex_get_lock_timeout().
int proxy_io_make_ex_get_isolation_level | ( | char * | driver_info, |
char ** | buffer, | ||
void * | argv | ||
) |
Definition at line 694 of file shard_proxy_io.c.
References proxy_io_make_ex_get_int().
Referenced by fn_proxy_client_get_db_parameter().
int proxy_io_make_ex_get_lock_timeout | ( | char * | driver_info, |
char ** | buffer, | ||
void * | argv | ||
) |
Definition at line 700 of file shard_proxy_io.c.
References proxy_io_make_ex_get_int().
Referenced by fn_proxy_client_get_db_parameter().
int proxy_io_make_get_db_version | ( | char * | driver_info, |
char ** | buffer | ||
) |
Definition at line 832 of file shard_proxy_io.c.
References assert, CAS_MAKE_PROTO_VER, t_net_buf::data, t_net_buf::data_size, error(), MSG_HEADER_SIZE, net_buf_cp_byte(), net_buf_cp_int(), net_buf_cp_str(), NULL, p, proxy_init_net_buf(), PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_make_net_buf(), rel_build_number(), set_data_length(), SHARD_NET_BUF_ALLOC_SIZE, and strlen.
Referenced by fn_proxy_client_get_db_version().
int proxy_io_make_no_error | ( | char * | driver_info, |
char ** | buffer | ||
) |
Definition at line 664 of file shard_proxy_io.c.
References CAS_NO_ERROR, NULL, and proxy_io_make_error_msg().
Referenced by proxy_io_make_check_cas_ok(), proxy_io_make_con_close_ok(), proxy_io_make_end_tran_ok(), and proxy_io_make_set_db_parameter_ok().
int proxy_io_make_set_db_parameter_ok | ( | char * | driver_info, |
char ** | buffer | ||
) |
Definition at line 688 of file shard_proxy_io.c.
References proxy_io_make_no_error().
Referenced by fn_proxy_client_set_db_parameter().
int proxy_io_make_shard_info | ( | char * | driver_info, |
char ** | buffer | ||
) |
Definition at line 1035 of file shard_proxy_io.c.
References assert, CAS_MAKE_PROTO_VER, t_net_buf::data, t_net_buf::data_size, t_shard_conn::db_conn_info, t_shard_conn::db_name, error(), t_proxy_info::max_shard, MSG_HEADER_SIZE, net_buf_cp_int(), net_buf_cp_str(), NULL, t_shm_shard_conn::num_shard_conn, proxy_init_net_buf(), PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_make_net_buf(), set_data_length(), t_shm_shard_conn::shard_conn, and strlen.
Referenced by fn_proxy_get_shard_info().
int proxy_io_process | ( | void | ) |
Definition at line 4300 of file shard_proxy_io.c.
References allset, assert, broker_conn_fd, cas_lsnr_fd, CLOSE_SOCKET, t_socket_io_global::ent, i, IS_INVALID_SOCKET, t_socket_io_global::max_socket, maxfd, NULL, PROXY_DEBUG_LOG, proxy_io_cas_accept(), PROXY_IO_FROM_CAS, proxy_Keep_running, PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_socket_io_add(), proxy_socket_io_new_client(), proxy_socket_io_read(), proxy_socket_io_read_error(), proxy_socket_io_write(), rset, sock_fd, wallset, wnewset, and wset.
Referenced by main().
|
static |
Definition at line 3899 of file shard_proxy_io.c.
References allset, broker_conn_fd, CLOSE_SOCKET, CLOSESOCKET, error(), htonl(), htons(), INVALID_SOCKET, IS_INVALID_SOCKET, max, maxfd, proxy_id, proxy_io_connect_to_broker(), PROXY_LOG, PROXY_LOG_MODE_ERROR, PROXY_LOG_MODE_NOTICE, shard_io_set_fl(), and WRITESOCKET.
Referenced by proxy_io_initialize().
int proxy_io_set_established_by_ctx | ( | T_PROXY_CONTEXT * | ctx_p | ) |
Definition at line 1425 of file shard_proxy_io.c.
References assert, t_proxy_context::cid, t_proxy_context::client_id, EXIT_FUNC, t_client_io::fd, NULL, proxy_client_io_find_by_ctx(), PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_socket_io_find(), SOCK_IO_ESTABLISHED, t_socket_io::status, and t_proxy_context::uid.
Referenced by fn_proxy_cas_check_cas().
|
static |
Definition at line 3995 of file shard_proxy_io.c.
References CLOSESOCKET, and strlen.
Referenced by proxy_io_cas_lsnr().
int proxy_make_net_buf | ( | T_NET_BUF * | net_buf, |
int | size, | ||
T_BROKER_VERSION | client_version | ||
) |
Definition at line 513 of file shard_proxy_io.c.
References t_net_buf::alloc_size, t_net_buf::data, MALLOC, net_buf_init(), NULL, PROXY_LOG, and PROXY_LOG_MODE_ERROR.
Referenced by proxy_io_make_check_cas(), proxy_io_make_client_proxy_alive(), proxy_io_make_close_req_handle_ok(), proxy_io_make_end_tran_request(), proxy_io_make_error_msg(), proxy_io_make_ex_get_int(), proxy_io_make_get_db_version(), and proxy_io_make_shard_info().
|
static |
Definition at line 2237 of file shard_proxy_io.c.
References allset, assert, t_cas_io::cas_id, CAS_IO_CLOSE_WAIT, t_proxy_handler::cas_rcv_q, t_proxy_context::cid, t_cas_io::ctx_cid, t_cas_io::ctx_uid, ENTER_FUNC, error(), EXIT_FUNC, t_socket_io::fd, t_socket_io::from_cas, t_socket_io::id, INVALID_SOCKET, t_cas_io::is_in_tran, NULL, proxy_cas_io_find_by_fd(), proxy_cas_io_free(), proxy_context_find(), proxy_context_free(), PROXY_DEBUG_LOG, PROXY_EVENT_CAS_CONN_ERROR, proxy_event_free(), PROXY_EVENT_FROM_CAS, proxy_event_new(), proxy_event_set_context(), PROXY_INVALID_CONTEXT, PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_socket_io_delete(), proxy_str_cas_io(), proxy_str_context(), proxy_str_event(), t_socket_io::shard, t_cas_io::shard_id, shard_queue_enqueue(), SOCK_IO_CLOSE_WAIT, t_socket_io::status, t_cas_io::status, t_proxy_context::uid, and wnewset.
Referenced by proxy_process_cas_read_error(), and proxy_process_cas_write_error().
|
static |
Definition at line 2389 of file shard_proxy_io.c.
References assert, error(), proxy_process_cas_register(), proxy_process_cas_response(), SOCK_IO_ESTABLISHED, SOCK_IO_REG_WAIT, and t_socket_io::status.
Referenced by proxy_socket_io_read_from_cas_next().
|
static |
Definition at line 2356 of file shard_proxy_io.c.
References assert, CLOSE_SOCKET, error(), t_socket_io::fd, INVALID_SOCKET, NULL, proxy_event_free(), proxy_process_cas_conn_error(), and t_socket_io::read_event.
Referenced by proxy_socket_io_read_error().
|
static |
Definition at line 2062 of file shard_proxy_io.c.
References assert, t_proxy_event::buffer, CAS_IO_CONNECTED, t_io_buffer::data, ENTER_FUNC, EXIT_FUNC, t_socket_io::fd, t_socket_io::from_cas, get_msg_length(), t_socket_io::id, MSG_HEADER_SIZE, ntohl(), NULL, t_io_buffer::offset, p, proxy_cas_io_free(), proxy_cas_io_new(), proxy_client_check_waiter_and_wakeup(), PROXY_DEBUG_LOG, proxy_event_free(), PROXY_EVENT_FROM_CAS, PROXY_INVALID_CAS, PROXY_INVALID_SHARD, PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_shard_io_find(), proxy_socket_io_delete(), proxy_str_cas_io(), read_buffer(), t_socket_io::read_event, t_socket_io::shard, t_shard_io::shard_id, SOCK_IO_ESTABLISHED, t_socket_io::status, and t_cas_io::status.
Referenced by proxy_process_cas_message().
|
static |
Definition at line 2150 of file shard_proxy_io.c.
References assert, t_cas_io::cas_id, t_proxy_handler::cas_rcv_q, t_proxy_context::cid, t_cas_io::ctx_cid, t_cas_io::ctx_uid, ENTER_FUNC, error(), EXIT_FUNC, t_socket_io::fd, t_socket_io::from_cas, t_socket_io::id, t_cas_io::is_in_tran, NULL, proxy_cas_io_find_by_fd(), proxy_cas_io_free(), proxy_context_find(), proxy_context_free(), PROXY_EVENT_CAS_RESPONSE, proxy_event_free(), PROXY_EVENT_FROM_CAS, proxy_event_set_context(), proxy_event_set_type_from(), PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_socket_io_delete(), proxy_str_cas_io(), proxy_str_context(), proxy_str_event(), t_socket_io::read_event, t_socket_io::shard, t_cas_io::shard_id, shard_queue_enqueue(), SOCK_IO_IDLE, t_socket_io::status, and t_proxy_context::uid.
Referenced by proxy_process_cas_message().
|
static |
Definition at line 2333 of file shard_proxy_io.c.
References CLOSE_SOCKET, error(), t_socket_io::fd, INVALID_SOCKET, NULL, proxy_event_free(), proxy_process_cas_conn_error(), t_socket_io::read_event, and t_socket_io::write_event.
Referenced by proxy_socket_io_write_error().
|
static |
Definition at line 1917 of file shard_proxy_io.c.
References allset, assert, t_proxy_context::cid, t_proxy_handler::cli_rcv_q, ENTER_FUNC, error(), EXIT_FUNC, t_socket_io::fd, t_socket_io::from_cas, NULL, proxy_context_find_by_socket_client_io(), proxy_context_free(), PROXY_EVENT_CLIENT_CONN_ERROR, proxy_event_free(), PROXY_EVENT_FROM_CLIENT, proxy_event_new(), proxy_event_set_context(), PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_str_context(), proxy_str_event(), shard_queue_enqueue(), SOCK_IO_CLOSE_WAIT, t_socket_io::status, t_proxy_context::uid, and wnewset.
Referenced by proxy_process_client_read_error(), and proxy_process_client_write_error().
|
static |
Definition at line 2038 of file shard_proxy_io.c.
References assert, error(), proxy_process_client_register(), proxy_process_client_request(), SOCK_IO_ESTABLISHED, SOCK_IO_REG_WAIT, and t_socket_io::status.
Referenced by proxy_socket_io_read_from_client_next().
|
static |
Definition at line 2005 of file shard_proxy_io.c.
References assert, CLOSE_SOCKET, error(), t_socket_io::fd, INVALID_SOCKET, NULL, proxy_event_free(), proxy_process_client_conn_error(), and t_socket_io::read_event.
Referenced by proxy_socket_io_read_error().
|
static |
Definition at line 1609 of file shard_proxy_io.c.
References t_shm_appl_server::access_control, access_control_check_right(), t_shm_appl_server::access_log, assert, t_proxy_event::buffer, CAS_ER_NOT_AUTHORIZED_CLIENT, CAS_MAKE_PROTO_VER, CAS_MAKE_VER, CAS_NO_ERROR, CAS_PROTO_TO_VER_STR, CAS_PROTO_VER_MASK, CAS_VER_TO_MAJOR, CAS_VER_TO_MINOR, CAS_VER_TO_PATCH, t_proxy_event::cid, t_proxy_handler::cli_rcv_q, t_socket_io::client_id, t_io_buffer::data, db_name, DBMS_ERROR_INDICATOR, DOES_CLIENT_UNDERSTAND_THE_PROTOCOL, t_client_info::driver_version, ENTER_FUNC, error(), EXIT_FUNC, t_socket_io::fd, t_proxy_info::fixed_shard_user, HEALTH_CHECK_DUMMY_DB, t_socket_io::id, t_socket_io::ip_addr, NULL, t_proxy_info::num_connect_rejected, ON, PROTOCOL_V1, PROTOCOL_V5, proxy_access_log(), proxy_check_authorization(), proxy_context_clear_error(), proxy_context_find_by_socket_client_io(), proxy_context_free(), proxy_context_send_error(), proxy_context_set_error_with_msg(), PROXY_DEBUG_LOG, PROXY_EVENT_CLIENT_REQUEST, proxy_event_free(), PROXY_EVENT_FROM_CLIENT, PROXY_EVENT_IO_WRITE, proxy_event_new_with_rsp(), proxy_event_set_context(), proxy_get_driver_info_by_fd(), proxy_io_make_check_cas(), proxy_io_make_client_dbinfo_ok(), proxy_io_make_client_proxy_alive(), PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_socket_io_read_error(), proxy_socket_set_write_event(), proxy_str_context(), proxy_str_event(), read_buffer(), t_socket_io::read_event, shard_queue_enqueue(), shard_shm_get_client_info(), SOCK_IO_ESTABLISHED, SRV_CON_DBNAME_SIZE, SRV_CON_DBPASSWD_SIZE, SRV_CON_DBSESS_ID_SIZE, SRV_CON_DBUSER_SIZE, SRV_CON_URL_SIZE, SRV_CON_VER_STR_MAX_SIZE, t_socket_io::status, strlen, and strncpy_bufsize.
Referenced by proxy_process_client_message().
|
static |
Definition at line 1871 of file shard_proxy_io.c.
References assert, t_proxy_context::cid, t_proxy_handler::cli_rcv_q, ENTER_FUNC, error(), EXIT_FUNC, t_socket_io::from_cas, NULL, proxy_context_find_by_socket_client_io(), proxy_context_free(), PROXY_EVENT_CLIENT_REQUEST, proxy_event_free(), PROXY_EVENT_FROM_CLIENT, proxy_event_set_context(), proxy_event_set_type_from(), PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_str_context(), proxy_str_event(), t_socket_io::read_event, shard_queue_enqueue(), and t_proxy_context::uid.
Referenced by proxy_process_client_message().
|
static |
Definition at line 1982 of file shard_proxy_io.c.
References CLOSE_SOCKET, error(), t_socket_io::fd, INVALID_SOCKET, NULL, proxy_event_free(), proxy_process_client_conn_error(), and t_socket_io::write_event.
Referenced by proxy_socket_io_write_error().
void proxy_set_con_status_in_tran | ( | char * | msg | ) |
Definition at line 457 of file shard_proxy_io.c.
References assert, CAS_INFO_STATUS, CAS_INFO_STATUS_ACTIVE, and MSG_HEADER_INFO_SIZE.
Referenced by fn_proxy_cas_prepare(), fn_proxy_client_check_cas(), and proxy_io_make_error_msg().
void proxy_set_con_status_out_tran | ( | char * | msg | ) |
Definition at line 471 of file shard_proxy_io.c.
References assert, CAS_INFO_STATUS, CAS_INFO_STATUS_INACTIVE, and MSG_HEADER_INFO_SIZE.
|
static |
Definition at line 4575 of file shard_proxy_io.c.
References t_proxy_info::appl_server, APPL_SERVER_CAS_MYSQL, assert, CAS_FC_CHECK_CAS, t_proxy_context::database_passwd, t_appl_server_info::database_passwd, t_proxy_context::database_user, t_appl_server_info::database_user, t_appl_server_info::force_reconnect, NULL, proxy_context_find(), shard_shm_get_as_info(), shard_stmt_del_all_srv_h_id_for_shard_cas(), and strncpy_bufsize.
Referenced by proxy_cas_alloc_by_ctx().
void proxy_set_force_out_tran | ( | char * | msg | ) |
Definition at line 485 of file shard_proxy_io.c.
References assert, CAS_INFO_ADDITIONAL_FLAG, CAS_INFO_FLAG_MASK_FORCE_OUT_TRAN, and MSG_HEADER_INFO_SIZE.
Referenced by fn_proxy_client_check_cas(), fn_proxy_client_prepare(), and proxy_io_make_check_cas().
|
static |
Definition at line 3280 of file shard_proxy_io.c.
References t_cas_io::cas_id, t_shard_io::cur_num_cas, t_shard_io::ent, t_shard_io_global::ent, t_cas_io::fd, FREE_MEM, i, t_cas_io::is_in_tran, IS_INVALID_SOCKET, t_shard_io::max_num_cas, t_shard_io_global::max_shard, t_shard_io::num_cas_in_tran, PROXY_LOG, PROXY_LOG_MODE_SCHEDULE_DETAIL, proxy_shard_io_print(), t_cas_io::shard_id, t_shard_io::shard_id, shard_queue_destroy(), and t_shard_io::waitq.
Referenced by proxy_io_destroy(), and proxy_shard_io_initialize().
|
static |
Definition at line 3362 of file shard_proxy_io.c.
References t_shard_io_global::ent, t_shard_io_global::max_shard, NULL, and PROXY_DEBUG_LOG.
Referenced by proxy_process_cas_register().
|
static |
Definition at line 3232 of file shard_proxy_io.c.
References t_shard_io::cur_num_cas, t_shard_io::ent, t_shard_io_global::ent, error(), i, t_shard_info::max_appl_server, t_shard_io::max_num_cas, t_shard_io_global::max_shard, t_proxy_info::max_shard, NULL, t_shard_io::num_cas_in_tran, proxy_cas_io_initialize(), proxy_shard_io_destroy(), t_shard_io::shard_id, shard_queue_initialize(), shard_shm_find_shard_info(), and t_shard_io::waitq.
Referenced by proxy_io_initialize().
|
static |
Definition at line 1305 of file shard_proxy_io.c.
References allset, assert, CLOSE_SOCKET, t_socket_io_global::cur_socket, t_socket_io_global::ent, error(), t_socket_io::fd, t_socket_io::from_cas, t_socket_io::id, INVALID_SOCKET, t_socket_io::ip_addr, max, t_socket_io_global::max_socket, maxfd, NULL, PROXY_INVALID_CAS, PROXY_INVALID_SHARD, proxy_Keep_running, PROXY_LOG, PROXY_LOG_MODE_ERROR, PROXY_LOG_MODE_SHARD_DETAIL, proxy_socket_io_print(), t_socket_io::read_event, t_socket_io::shard, shard_io_set_fl(), SOCK_IO_IDLE, SOCK_IO_REG_WAIT, t_socket_io::status, and t_socket_io::write_event.
Referenced by proxy_io_process(), and proxy_socket_io_new_client().
|
static |
Definition at line 1135 of file shard_proxy_io.c.
References assert, ENTER_FUNC, EXIT_FUNC, t_socket_io::fd, t_socket_io::from_cas, t_socket_io::id, INVALID_SOCKET, t_socket_io::ip_addr, NULL, PROXY_DEBUG_LOG, proxy_event_free(), PROXY_EVENT_FROM_CAS, PROXY_EVENT_FROM_CLIENT, PROXY_INVALID_CAS, PROXY_INVALID_SHARD, t_socket_io::read_event, t_socket_io::shard, SOCK_IO_IDLE, t_socket_io::status, and t_socket_io::write_event.
Referenced by proxy_socket_io_delete(), proxy_socket_io_destroy(), and proxy_socket_io_initialize().
int proxy_socket_io_delete | ( | SOCKET | fd | ) |
Definition at line 1383 of file shard_proxy_io.c.
References allset, assert, CLOSE_SOCKET, t_socket_io_global::cur_socket, t_socket_io_global::ent, ENTER_FUNC, EXIT_FUNC, t_socket_io::fd, INVALID_SOCKET, t_socket_io_global::max_socket, PROXY_DEBUG_LOG, PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_socket_io_clear(), SOCK_IO_CLOSE_WAIT, t_socket_io::status, and wnewset.
Referenced by proxy_cas_io_free(), proxy_cas_io_free_by_ctx(), proxy_client_io_free(), proxy_context_find_by_socket_client_io(), proxy_process_cas_conn_error(), proxy_process_cas_register(), proxy_process_cas_response(), and proxy_socket_io_new_client().
|
static |
Definition at line 1216 of file shard_proxy_io.c.
References allset, t_socket_io::client_id, CLOSE_SOCKET, t_socket_io_global::cur_socket, t_socket_io_global::ent, t_socket_io::fd, FREE_MEM, t_socket_io::from_cas, i, t_socket_io::id, INVALID_SOCKET, t_socket_io::ip_addr, IS_INVALID_SOCKET, t_socket_io_global::max_socket, NULL, PROXY_INVALID_CAS, PROXY_INVALID_SHARD, PROXY_LOG, PROXY_LOG_MODE_SCHEDULE_DETAIL, proxy_socket_io_clear(), proxy_socket_io_print(), t_socket_io::shard, SOCK_IO_CLOSE_WAIT, t_socket_io::status, and wnewset.
Referenced by proxy_io_destroy().
|
static |
Definition at line 1449 of file shard_proxy_io.c.
References assert, t_socket_io_global::ent, NULL, SOCK_IO_IDLE, and t_socket_io::status.
Referenced by proxy_cas_io_write(), proxy_client_io_write(), and proxy_io_set_established_by_ctx().
|
static |
Definition at line 1176 of file shard_proxy_io.c.
References t_socket_io_global::cur_socket, t_socket_io_global::ent, i, MAX_FD, t_socket_io_global::max_socket, NULL, PROXY_LOG, PROXY_LOG_MODE_ERROR, and proxy_socket_io_clear().
Referenced by proxy_io_initialize().
|
static |
Definition at line 1501 of file shard_proxy_io.c.
References BROKER_RENEWED_ERROR_CODE, BROKER_SUPPORT_HOLDABLE_RESULT, CAS_PROTO_UNPACK_NET_VER, t_socket_io::client_id, t_client_io::client_id, t_client_info::client_id, t_client_info::client_ip, CLOSE_SOCKET, t_client_info::connect_time, t_client_io::driver_info, t_client_info::driver_info, ENTER_FUNC, error(), EXIT_FUNC, t_socket_io::id, t_socket_io::ip_addr, NULL, t_proxy_info::num_connect_requests, PROTOCOL_V4, proxy_client_io_new(), proxy_event_free(), PROXY_EVENT_FROM_CLIENT, PROXY_EVENT_IO_WRITE, proxy_event_new_with_rsp(), PROXY_IO_FROM_CLIENT, proxy_io_make_client_conn_ok(), proxy_Keep_running, PROXY_LOG, PROXY_LOG_MODE_ERROR, proxy_socket_io_add(), proxy_socket_io_delete(), proxy_socket_io_read_error(), proxy_socket_set_write_event(), proxy_str_event(), recv_fd(), shard_shm_get_client_info(), SRV_CON_CLIENT_INFO_SIZE, SRV_CON_MSG_IDX_FUNCTION_FLAG, SRV_CON_MSG_IDX_PROTO_VERSION, and WRITESOCKET.
Referenced by proxy_io_process().
|
static |
Definition at line 2821 of file shard_proxy_io.c.
References assert, t_socket_io::fd, t_socket_io::from_cas, NULL, PROXY_DEBUG_LOG, PROXY_EVENT_IO_READ, proxy_event_new(), proxy_socket_io_read_error(), proxy_socket_io_read_from_cas(), proxy_socket_io_read_from_client(), t_socket_io::read_event, SOCK_IO_CLOSE_WAIT, t_socket_io::status, and t_proxy_event::type.
Referenced by proxy_io_process().
|
static |
Definition at line 2867 of file shard_proxy_io.c.
References assert, t_socket_io::from_cas, proxy_process_cas_read_error(), and proxy_process_client_read_error().
Referenced by proxy_io_process(), proxy_process_client_register(), proxy_socket_io_new_client(), proxy_socket_io_read(), proxy_socket_io_read_from_cas_first(), proxy_socket_io_read_from_cas_next(), proxy_socket_io_read_from_client_next(), and proxy_socket_io_read_internal().
|
static |
Definition at line 2652 of file shard_proxy_io.c.
References assert, t_proxy_event::buffer, t_io_buffer::length, proxy_socket_io_read_from_cas_first(), proxy_socket_io_read_from_cas_next(), and t_socket_io::read_event.
Referenced by proxy_socket_io_read().
|
static |
Definition at line 2632 of file shard_proxy_io.c.
References assert, error(), MSG_HEADER_SIZE, proxy_event_alloc_buffer(), proxy_socket_io_read_error(), proxy_socket_io_read_from_cas_next(), and t_socket_io::read_event.
Referenced by proxy_socket_io_read_from_cas().
|
static |
Definition at line 2610 of file shard_proxy_io.c.
References assert, error(), proxy_event_io_read_complete(), proxy_process_cas_message(), proxy_socket_io_read_error(), proxy_socket_io_read_internal(), and t_socket_io::read_event.
Referenced by proxy_socket_io_read_from_cas(), and proxy_socket_io_read_from_cas_first().
|
static |
Definition at line 2726 of file shard_proxy_io.c.
References assert, t_proxy_event::buffer, t_io_buffer::length, proxy_socket_io_read_from_client_first(), proxy_socket_io_read_from_client_next(), and t_socket_io::read_event.
Referenced by proxy_socket_io_read().
|
static |
Definition at line 2696 of file shard_proxy_io.c.
References assert, error(), get_dbinfo_length(), MSG_HEADER_SIZE, proxy_event_alloc_buffer(), proxy_get_driver_info_by_fd(), proxy_socket_io_read_from_client_next(), proxy_socket_io_write_error(), t_socket_io::read_event, SOCK_IO_REG_WAIT, and t_socket_io::status.
Referenced by proxy_socket_io_read_from_client().
|
static |
Definition at line 2674 of file shard_proxy_io.c.
References assert, error(), proxy_event_io_read_complete(), proxy_process_client_message(), proxy_socket_io_read_error(), proxy_socket_io_read_internal(), and t_socket_io::read_event.
Referenced by proxy_socket_io_read_from_client(), and proxy_socket_io_read_from_client_first().
|
static |
Definition at line 2542 of file shard_proxy_io.c.
References assert, t_proxy_event::buffer, t_io_buffer::data, error(), t_socket_io::fd, get_msg_length(), t_io_buffer::length, MSG_HEADER_SIZE, t_io_buffer::offset, PROXY_DEBUG_LOG, proxy_event_realloc_buffer(), proxy_socket_io_read_error(), read_buffer(), t_socket_io::read_event, and READSOCKET.
Referenced by proxy_socket_io_read_from_cas_next(), and proxy_socket_io_read_from_client_next().
|
static |
Definition at line 2748 of file shard_proxy_io.c.
References assert, t_socket_io::fd, t_socket_io::from_cas, NULL, PROXY_DEBUG_LOG, proxy_event_free(), proxy_socket_io_write_to_cas(), proxy_socket_io_write_to_client(), SOCK_IO_CLOSE_WAIT, SOCK_IO_IDLE, t_socket_io::status, wnewset, and t_socket_io::write_event.
Referenced by proxy_io_process().
|
static |
Definition at line 2804 of file shard_proxy_io.c.
References assert, t_socket_io::from_cas, proxy_process_cas_write_error(), and proxy_process_client_write_error().
Referenced by proxy_socket_io_read_from_client_first(), proxy_socket_io_write_to_cas(), and proxy_socket_io_write_to_client().
|
static |
Definition at line 2413 of file shard_proxy_io.c.
References assert, t_proxy_event::buffer, t_io_buffer::data, error(), t_socket_io::fd, t_io_buffer::length, NULL, t_io_buffer::offset, p, proxy_event_free(), wnewset, t_socket_io::write_event, and WRITESOCKET.
Referenced by proxy_socket_io_write_to_cas(), and proxy_socket_io_write_to_client().
|
static |
Definition at line 2493 of file shard_proxy_io.c.
References assert, proxy_socket_io_write_error(), and proxy_socket_io_write_internal().
Referenced by proxy_socket_io_write().
|
static |
Definition at line 2509 of file shard_proxy_io.c.
References assert, t_socket_io::client_id, t_proxy_context::free_on_client_io_write, t_socket_io::id, NULL, proxy_context_find_by_socket_client_io(), proxy_context_free(), proxy_socket_io_write_error(), proxy_socket_io_write_internal(), shard_shm_get_client_info(), shard_shm_init_client_info(), and t_socket_io::write_event.
Referenced by proxy_socket_io_write().
int proxy_socket_set_write_event | ( | T_SOCKET_IO * | sock_io_p, |
T_PROXY_EVENT * | event_p | ||
) |
Definition at line 1460 of file shard_proxy_io.c.
References assert, t_proxy_event::buffer, error(), t_socket_io::fd, NULL, t_io_buffer::offset, proxy_event_free(), wnewset, and t_socket_io::write_event.
Referenced by proxy_cas_io_write(), proxy_client_io_write(), proxy_process_client_register(), and proxy_socket_io_new_client().
char* proxy_str_cas_io | ( | T_CAS_IO * | cas_io_p | ) |
Definition at line 3344 of file shard_proxy_io.c.
References t_cas_io::cas_id, t_cas_io::ctx_cid, t_cas_io::ctx_uid, t_cas_io::fd, t_cas_io::is_in_tran, NULL, t_cas_io::shard_id, and t_cas_io::status.
Referenced by proxy_cas_alloc_by_shard_and_cas_id(), proxy_cas_find_io_by_ctx(), proxy_cas_io_free_by_ctx(), proxy_cas_io_new(), proxy_cas_io_write(), proxy_cas_release_by_ctx(), proxy_client_execute_internal(), proxy_process_cas_conn_error(), proxy_process_cas_register(), proxy_process_cas_response(), proxy_send_request_to_cas(), and proxy_send_request_to_cas_with_new_event().
char* proxy_str_client_io | ( | T_CLIENT_IO * | cli_io_p | ) |
Definition at line 2979 of file shard_proxy_io.c.
References t_client_io::client_id, t_client_io::ctx_cid, t_client_io::ctx_uid, t_client_io::fd, t_client_io::is_busy, and NULL.
Referenced by proxy_client_io_new(), proxy_client_io_write(), proxy_context_find_by_socket_client_io(), and proxy_send_response_to_client().
void proxy_term | ( | void | ) |
Definition at line 65 of file shard_proxy.c.
References proxy_access_log_close(), proxy_handler_destroy(), proxy_io_destroy(), proxy_log_close(), shard_stmt_destroy(), and SLEEP_MILISEC.
Referenced by cleanup(), and main().
void proxy_unset_force_out_tran | ( | char * | msg | ) |
Definition at line 499 of file shard_proxy_io.c.
References assert, CAS_INFO_ADDITIONAL_FLAG, CAS_INFO_FLAG_MASK_FORCE_OUT_TRAN, and MSG_HEADER_INFO_SIZE.
Referenced by proxy_client_execute_internal(), and proxy_handler_process_client_request().
const char* rel_build_number | ( | void | ) |
Definition at line 161 of file release_string.c.
References build_number.
Referenced by boot_restart_server(), db_get_database_version(), jsp_start_server(), proxy_io_make_get_db_version(), rel_copy_version_string(), ux_get_db_version(), and xboot_initialize_server().
void set_data_length | ( | char * | buffer, |
int | length | ||
) |
Definition at line 228 of file shard_proxy_io.c.
References assert, and htonl().
Referenced by proxy_io_make_check_cas(), proxy_io_make_client_proxy_alive(), proxy_io_make_close_req_handle_ok(), proxy_io_make_end_tran_request(), proxy_io_make_error_msg(), proxy_io_make_ex_get_int(), proxy_io_make_get_db_version(), proxy_io_make_shard_info(), and shard_stmt_save_prepare_request().
|
static |
Definition at line 326 of file shard_proxy_io.c.
References PROXY_LOG, and PROXY_LOG_MODE_ERROR.
Referenced by proxy_io_cas_lsnr(), proxy_io_register_to_broker(), and proxy_socket_io_add().
fd_set allset |
Definition at line 191 of file shard_proxy_io.c.
Referenced by proxy_io_cas_lsnr(), proxy_io_initialize(), proxy_io_process(), proxy_io_register_to_broker(), proxy_listener_thr_f(), proxy_process_cas_conn_error(), proxy_process_client_conn_error(), proxy_socket_io_add(), proxy_socket_io_delete(), and proxy_socket_io_destroy().
SOCKET broker_conn_fd = INVALID_SOCKET |
Definition at line 199 of file shard_proxy_io.c.
Referenced by proxy_io_close_all_fd(), proxy_io_process(), and proxy_io_register_to_broker().
int cas_info_size = CAS_INFO_SIZE |
Definition at line 208 of file shard_proxy_io.c.
Referenced by proxy_io_make_client_dbinfo_ok().
SOCKET cas_lsnr_fd = INVALID_SOCKET |
Definition at line 201 of file shard_proxy_io.c.
Referenced by proxy_io_cas_lsnr(), proxy_io_close_all_fd(), and proxy_io_process().
int maxfd = 0 |
Definition at line 190 of file shard_proxy_io.c.
Referenced by check_cas_log(), proxy_io_cas_lsnr(), proxy_io_process(), proxy_io_register_to_broker(), proxy_socket_io_add(), read_from_client_with_timeout(), and write_to_client_with_timeout().
T_CLIENT_IO_GLOBAL proxy_Client_io |
Definition at line 204 of file shard_proxy_io.c.
T_PROXY_CONTEXT proxy_Context |
Definition at line 55 of file shard_proxy_handler.c.
T_PROXY_HANDLER proxy_Handler |
Definition at line 54 of file shard_proxy_handler.c.
Referenced by proxy_handler_process().
int proxy_id |
Definition at line 45 of file shard_proxy.c.
Referenced by proxy_io_make_client_dbinfo_ok(), and proxy_io_register_to_broker().
T_PROXY_INFO* proxy_info_p |
Definition at line 48 of file shard_proxy.c.
bool proxy_Keep_running |
Definition at line 57 of file shard_proxy.c.
Referenced by main(), proxy_io_process(), proxy_socket_io_add(), and proxy_socket_io_new_client().
T_SHARD_IO_GLOBAL proxy_Shard_io |
Definition at line 205 of file shard_proxy_io.c.
T_SOCKET_IO_GLOBAL proxy_Socket_io |
Definition at line 203 of file shard_proxy_io.c.
fd_set rset |
Definition at line 191 of file shard_proxy_io.c.
Referenced by proxy_io_process(), and proxy_listener_thr_f().
T_SHM_APPL_SERVER* shm_as_p |
Definition at line 43 of file shard_proxy.c.
T_SHM_SHARD_CONN* shm_conn_p |
Definition at line 52 of file shard_proxy.c.
Referenced by admin_getid_cmd(), metadata_monitor(), shard_metadata_dump_internal(), shard_metadata_get_conn(), shard_metadata_initialize(), shard_metadata_read_conn(), shard_shm_initialize_shm_proxy(), and shard_shm_set_shard_conn_info().
T_SHM_PROXY* shm_proxy_p |
Definition at line 109 of file broker_admin_pub.c.
T_SHM_SHARD_USER* shm_user_p |
Definition at line 50 of file shard_proxy.c.
Referenced by metadata_monitor(), shard_metadata_dump_internal(), shard_metadata_get_shard_user_from_shm(), shard_metadata_get_user(), shard_metadata_initialize(), shard_metadata_read_user(), and shard_shm_set_shard_conn_info().
fd_set wallset |
Definition at line 191 of file shard_proxy_io.c.
Referenced by proxy_io_process().
fd_set wnewset |
Definition at line 191 of file shard_proxy_io.c.
Referenced by proxy_io_initialize(), proxy_io_process(), proxy_process_cas_conn_error(), proxy_process_client_conn_error(), proxy_socket_io_delete(), proxy_socket_io_destroy(), proxy_socket_io_write(), proxy_socket_io_write_internal(), and proxy_socket_set_write_event().
fd_set wset |
Definition at line 191 of file shard_proxy_io.c.
Referenced by proxy_io_process().