CUBRID Engine
latest
|
#include "config.h"
#include <stdio.h>
#include <signal.h>
#include <sys/param.h>
#include <syslog.h>
#include <assert.h>
#include "porting.h"
#include "connection_globals.h"
#include "connection_defs.h"
#include "connection_cl.h"
#include "connection_less.h"
#include "connection_list_cl.h"
#include "tcp.h"
#include "transaction_cl.h"
#include "error_manager.h"
#include "client_support.h"
#include "network_interface_cl.h"
#include "network.h"
Go to the source code of this file.
Functions | |
static void | css_internal_server_shutdown (void) |
static void | css_handle_pipe_shutdown (int sig) |
static void | css_set_pipe_signal (void) |
static int | css_test_for_server_errors (CSS_MAP_ENTRY *entry, unsigned int eid) |
int | css_client_init (int sockid, const char *server_name, const char *host_name) |
unsigned int | css_send_request_to_server_with_buffer (char *host, int request, char *arg_buffer, int arg_buffer_size, char *data_buffer, int data_buffer_size) |
unsigned int | css_send_req_to_server (char *host, int request, char *arg_buffer, int arg_buffer_size, char *data_buffer, int data_buffer_size, char *reply_buffer, int reply_size) |
unsigned int | css_send_req_to_server_2_data (char *host, int request, char *arg_buffer, int arg_buffer_size, char *data1_buffer, int data1_buffer_size, char *data2_buffer, int data2_buffer_size, char *reply_buffer, int reply_size) |
unsigned int | css_send_req_to_server_no_reply (char *host, int request, char *arg_buffer, int arg_buffer_size) |
int | css_queue_receive_data_buffer (unsigned int eid, char *buffer, int buffer_size) |
unsigned int | css_send_error_to_server (char *host, unsigned int eid, char *buffer, int buffer_size) |
unsigned int | css_send_data_to_server (char *host, unsigned int eid, char *buffer, int buffer_size) |
unsigned int | css_receive_data_from_server (unsigned int eid, char **buffer, int *size) |
unsigned int | css_receive_data_from_server_with_timeout (unsigned int eid, char **buffer, int *size, int timeout) |
void | css_terminate (bool server_error) |
void | css_cleanup_client_queues (char *host_name) |
HA_SERVER_STATE | css_ha_server_state (void) |
Variables | |
static void(* | css_Previous_sigpipe_handler )(int sig_no) = NULL |
int | css_Errno = 0 |
CSS_MAP_ENTRY * | css_Client_anchor |
void css_cleanup_client_queues | ( | char * | host_name | ) |
Definition at line 675 of file client_support.c.
References css_mapping_entry::conn, css_remove_all_unexpected_packets(), css_return_open_entry(), and NULL.
Referenced by net_cleanup_client_queues().
Definition at line 138 of file client_support.c.
References css_mapping_entry::conn, css_connect_to_cubrid_server(), css_Errno, css_make_eid(), css_queue_connection(), css_remove_queued_connection_by_entry(), css_return_open_entry(), css_send_request(), css_Service_id, css_set_pipe_signal(), css_windows_startup(), er_errid(), error(), host, css_mapping_entry::id, css_conn_entry::invalidate_snapshot, NO_ERROR, NO_ERRORS, NULL, SERVER_WAS_NOT_FOUND, tm_Tran_index, and tm_Tran_invalidate_snapshot.
Referenced by net_client_init().
HA_SERVER_STATE css_ha_server_state | ( | void | ) |
Definition at line 691 of file client_support.c.
Referenced by checksumdb(), chksum_report_header(), log_does_allow_replication(), log_is_log_flush_daemon_available(), logwr_log_ha_filestat_to_string(), sboot_change_ha_mode(), server_capabilities(), xboot_register_client(), and xtran_lock_rep_read().
|
static |
Definition at line 80 of file client_support.c.
References css_find_exception_conn(), css_internal_server_shutdown(), css_Previous_sigpipe_handler, css_remove_queued_connection_by_entry(), css_return_entry_from_conn(), and NULL.
Referenced by css_set_pipe_signal().
|
static |
Definition at line 67 of file client_support.c.
Referenced by css_handle_pipe_shutdown().
int css_queue_receive_data_buffer | ( | unsigned int | eid, |
char * | buffer, | ||
int | buffer_size | ||
) |
Definition at line 432 of file client_support.c.
References css_mapping_entry::conn, css_queue_user_data_buffer(), css_return_entry_from_eid(), CSS_RID_FROM_EID, NO_ERRORS, NULL, and rc.
Referenced by net_client_check_log_header(), net_client_get_next_log_pages(), net_client_recv_copyarea(), net_client_request(), net_client_request2(), net_client_request2_no_malloc(), net_client_request_2recv_copyarea(), net_client_request_3_data(), net_client_request_3_data_recv_copyarea(), net_client_request_3recv_copyarea(), net_client_request_internal(), net_client_request_recv_copyarea(), net_client_request_recv_stream(), net_client_request_with_callback(), and net_client_request_with_logwr_context().
unsigned int css_receive_data_from_server | ( | unsigned int | eid, |
char ** | buffer, | ||
int * | size | ||
) |
Definition at line 558 of file client_support.c.
References css_receive_data_from_server_with_timeout().
Referenced by net_client_check_log_header(), net_client_get_next_log_pages(), net_client_ping_server_with_handshake(), net_client_receive_action(), net_client_recv_copyarea(), net_client_request(), net_client_request2(), net_client_request2_no_malloc(), net_client_request_2recv_copyarea(), net_client_request_3_data(), net_client_request_3_data_recv_copyarea(), net_client_request_3recv_copyarea(), net_client_request_internal(), net_client_request_recv_copyarea(), net_client_request_recv_stream(), net_client_request_with_callback(), net_client_request_with_logwr_context(), and net_consume_expected_packets().
unsigned int css_receive_data_from_server_with_timeout | ( | unsigned int | eid, |
char ** | buffer, | ||
int * | size, | ||
int | timeout | ||
) |
Definition at line 572 of file client_support.c.
References CANT_ALLOC_BUFFER, css_mapping_entry::conn, css_Errno, css_receive_data(), css_receive_error(), css_remove_queued_connection_by_entry(), css_return_entry_from_eid(), CSS_RID_FROM_EID, css_test_for_server_errors(), eid, NO_ERRORS, NULL, SERVER_ABORTED, and SERVER_WAS_NOT_FOUND.
Referenced by css_receive_data_from_server(), net_client_ping_server(), and net_client_request_with_logwr_context().
unsigned int css_send_data_to_server | ( | char * | host, |
unsigned int | eid, | ||
char * | buffer, | ||
int | buffer_size | ||
) |
Definition at line 505 of file client_support.c.
References css_mapping_entry::conn, css_Errno, css_remove_queued_connection_by_entry(), css_return_open_entry(), CSS_RID_FROM_EID, css_send_data(), css_conn_entry::invalidate_snapshot, NO_ERRORS, NULL, SERVER_WAS_NOT_FOUND, tm_Tran_index, and tm_Tran_invalidate_snapshot.
Referenced by net_client_send_data().
unsigned int css_send_error_to_server | ( | char * | host, |
unsigned int | eid, | ||
char * | buffer, | ||
int | buffer_size | ||
) |
Definition at line 467 of file client_support.c.
References assert, css_mapping_entry::conn, css_Errno, css_remove_queued_connection_by_entry(), css_return_open_entry(), CSS_RID_FROM_EID, css_send_error(), css_conn_entry::db_error, er_errid(), css_conn_entry::invalidate_snapshot, NO_ERROR, NO_ERRORS, NULL, SERVER_WAS_NOT_FOUND, tm_Tran_index, and tm_Tran_invalidate_snapshot.
Referenced by return_error_to_server().
unsigned int css_send_req_to_server | ( | char * | host, |
int | request, | ||
char * | arg_buffer, | ||
int | arg_buffer_size, | ||
char * | data_buffer, | ||
int | data_buffer_size, | ||
char * | reply_buffer, | ||
int | reply_size | ||
) |
Definition at line 260 of file client_support.c.
References assert, css_mapping_entry::conn, css_Errno, css_make_eid(), css_remove_queued_connection_by_entry(), css_return_open_entry(), host, css_mapping_entry::id, css_conn_entry::invalidate_snapshot, NET_SERVER_LS_GET_LIST_FILE_PAGE, NO_ERRORS, NULL, SERVER_WAS_NOT_FOUND, tm_Tran_index, tm_Tran_invalidate_snapshot, tran_was_latest_query_committed(), and css_conn_entry::transaction_id.
Referenced by net_client_request(), net_client_request2(), net_client_request2_no_malloc(), net_client_request_2recv_copyarea(), net_client_request_3recv_copyarea(), net_client_request_internal(), net_client_request_recv_copyarea(), and net_client_request_recv_stream().
unsigned int css_send_req_to_server_2_data | ( | char * | host, |
int | request, | ||
char * | arg_buffer, | ||
int | arg_buffer_size, | ||
char * | data1_buffer, | ||
int | data1_buffer_size, | ||
char * | data2_buffer, | ||
int | data2_buffer_size, | ||
char * | reply_buffer, | ||
int | reply_size | ||
) |
Definition at line 359 of file client_support.c.
References css_mapping_entry::conn, css_Errno, css_make_eid(), css_remove_queued_connection_by_entry(), css_return_open_entry(), css_mapping_entry::id, css_conn_entry::invalidate_snapshot, NO_ERRORS, NULL, SERVER_WAS_NOT_FOUND, tm_Tran_index, and tm_Tran_invalidate_snapshot.
Referenced by net_client_check_log_header(), net_client_request_3_data(), net_client_request_3_data_recv_copyarea(), net_client_request_with_callback(), and net_client_request_with_logwr_context().
unsigned int css_send_req_to_server_no_reply | ( | char * | host, |
int | request, | ||
char * | arg_buffer, | ||
int | arg_buffer_size | ||
) |
Definition at line 398 of file client_support.c.
References css_mapping_entry::conn, css_Errno, css_make_eid(), css_remove_queued_connection_by_entry(), css_return_open_entry(), css_mapping_entry::id, css_conn_entry::invalidate_snapshot, NO_ERRORS, NULL, SERVER_WAS_NOT_FOUND, tm_Tran_index, and tm_Tran_invalidate_snapshot.
Referenced by net_client_request_no_reply().
unsigned int css_send_request_to_server_with_buffer | ( | char * | host, |
int | request, | ||
char * | arg_buffer, | ||
int | arg_buffer_size, | ||
char * | data_buffer, | ||
int | data_buffer_size | ||
) |
Definition at line 216 of file client_support.c.
References css_mapping_entry::conn, css_Errno, css_make_eid(), css_remove_queued_connection_by_entry(), css_return_open_entry(), css_send_request_with_data_buffer(), css_mapping_entry::id, css_conn_entry::invalidate_snapshot, NO_ERRORS, NULL, SERVER_WAS_NOT_FOUND, tm_Tran_index, and tm_Tran_invalidate_snapshot.
Referenced by net_client_ping_server(), and net_client_ping_server_with_handshake().
|
static |
Definition at line 114 of file client_support.c.
References css_handle_pipe_shutdown(), css_Previous_sigpipe_handler, NULL, and os_set_signal_handler().
Referenced by css_client_init().
void css_terminate | ( | bool | server_error | ) |
Definition at line 641 of file client_support.c.
References css_mapping_entry::conn, CONN_CLOSING, css_Previous_sigpipe_handler, css_remove_queued_connection_by_entry(), css_send_close_request(), css_windows_shutdown(), NULL, os_set_signal_handler(), and css_conn_entry::status.
Referenced by boot_client_all_finalize(), boot_server_die_or_changed(), net_client_final(), and net_client_init().
|
static |
Definition at line 537 of file client_support.c.
References css_mapping_entry::conn, css_return_queued_error(), CSS_RID_FROM_EID, er_set_area_error(), free_and_init, NO_ERROR, and rc.
Referenced by css_receive_data_from_server_with_timeout().
CSS_MAP_ENTRY* css_Client_anchor |
Definition at line 55 of file client_support.c.
int css_Errno = 0 |
Definition at line 54 of file client_support.c.
Referenced by css_client_init(), css_receive_data_from_server_with_timeout(), css_send_data_to_server(), css_send_error_to_server(), css_send_req_to_server(), css_send_req_to_server_2_data(), css_send_req_to_server_no_reply(), css_send_request_to_server_with_buffer(), net_client_check_log_header(), net_client_request(), net_client_request2(), net_client_request2_no_malloc(), net_client_request_2recv_copyarea(), net_client_request_3_data(), net_client_request_3_data_recv_copyarea(), net_client_request_3recv_copyarea(), net_client_request_internal(), net_client_request_no_reply(), net_client_request_recv_copyarea(), net_client_request_recv_stream(), net_client_request_with_callback(), and net_client_request_with_logwr_context().
|
static |
Definition at line 52 of file client_support.c.
Referenced by css_handle_pipe_shutdown(), css_set_pipe_signal(), and css_terminate().