CUBRID Engine  latest
client_support.c
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 /*
20  * client_support.c - higher level of interface routines to the client
21  */
22 
23 #ident "$Id$"
24 
25 #include "config.h"
26 
27 #include <stdio.h>
28 #if !defined(WINDOWS)
29 #include <signal.h>
30 #include <sys/param.h>
31 #include <syslog.h>
32 #endif /* not WINDOWS */
33 #include <assert.h>
34 
35 #include "porting.h"
36 #include "connection_globals.h"
37 #include "connection_defs.h"
38 #include "connection_cl.h"
39 #include "connection_less.h"
40 #include "connection_list_cl.h"
41 #if defined(WINDOWS)
42 #include "wintcp.h"
43 #else /* WINDOWS */
44 #include "tcp.h"
45 #endif /* WINDOWS */
46 #include "transaction_cl.h"
47 #include "error_manager.h"
48 #include "client_support.h"
49 #include "network_interface_cl.h"
50 #include "network.h"
51 
52 static void (*css_Previous_sigpipe_handler) (int sig_no) = NULL;
53 /* TODO: M2 - remove css_Errno */
54 int css_Errno = 0;
56 
57 static void css_internal_server_shutdown (void);
58 static void css_handle_pipe_shutdown (int sig);
59 static void css_set_pipe_signal (void);
60 static int css_test_for_server_errors (CSS_MAP_ENTRY * entry, unsigned int eid);
61 
62 /*
63  * css_internal_server_shutdown() -
64  * return:
65  */
66 static void
68 {
69 #if !defined(WINDOWS)
70  syslog (LOG_ALERT, "Lost connection to server\n");
71 #endif /* not WINDOWS */
72 }
73 
74 /*
75  * css_handle_pipe_shutdown() -
76  * return:
77  * sig(in):
78  */
79 static void
81 {
82  CSS_CONN_ENTRY *conn;
83  CSS_MAP_ENTRY *entry;
84 
85  conn = css_find_exception_conn ();
86  if (conn != NULL)
87  {
88  entry = css_return_entry_from_conn (conn, css_Client_anchor);
89  if (entry != NULL)
90  {
91  css_remove_queued_connection_by_entry (entry, &css_Client_anchor);
92  }
94  }
95  else
96  {
97  /* Avoid an infinite loop by checking if the previous handle is myself */
99  {
100  (*css_Previous_sigpipe_handler) (sig);
101  }
102  }
103 }
104 
105 /*
106  * css_set_pipe_signal() - sets up the signal handling mechanism
107  * return:
108  *
109  * Note: Note that we try to find out if there are any previous handlers.
110  * If so, make note of them so that we can pass on errors on fds that
111  * we do not know.
112  */
113 static void
115 {
116 #if !defined(WINDOWS)
118  if ((css_Previous_sigpipe_handler == SIG_IGN) || (css_Previous_sigpipe_handler == SIG_ERR)
119  || (css_Previous_sigpipe_handler == SIG_DFL)
120 #if !defined(LINUX)
121  || (css_Previous_sigpipe_handler == SIG_HOLD)
122 #endif /* not LINUX */
123  )
124  {
126  }
127 #endif /* not WINDOWS */
128 }
129 
130 /*
131  * css_client_init() - initialize the network portion of the client interface
132  * return:
133  * sockid(in): sSocket number for remote host
134  * server_name(in):
135  * host_name(in):
136  */
137 int
138 css_client_init (int sockid, const char *server_name, const char *host_name)
139 {
140  CSS_CONN_ENTRY *conn;
141  int error = NO_ERROR;
142 
143 #if defined(WINDOWS)
144  (void) css_windows_startup ();
145 #endif /* WINDOWS */
146 
147  css_Service_id = sockid;
149  conn = css_connect_to_cubrid_server ((char *) host_name, (char *) server_name);
150  if (conn != NULL)
151  {
152  css_queue_connection (conn, (char *) host_name, &css_Client_anchor);
153  }
154  else
155  {
156  /* At here, er_errid () can be NO_ERROR */
157  error = er_errid ();
158  }
159 
160  return error;
161 }
162 
163 #if defined(ENABLE_UNUSED_FUNCTION)
164 /*
165  * css_send_request_to_server() - send a request to a server
166  * return: request id
167  * host(in): name of the remote host
168  * request(in): the request to send to the server.
169  * arg_buffer(in): a packed buffer containing all the arguments to be sent to
170  * the server.
171  * arg_buffer_size(in): The size of arg_buffer.
172  */
173 unsigned int
174 css_send_request_to_server (char *host, int request, char *arg_buffer, int arg_buffer_size)
175 {
176  CSS_MAP_ENTRY *entry;
177  unsigned short rid;
178 
179  entry = css_return_open_entry (host, &css_Client_anchor);
180  if (entry != NULL)
181  {
182  entry->conn->set_tran_index (tm_Tran_index);
184  css_Errno = css_send_request (entry->conn, (int) request, &rid, arg_buffer, (int) arg_buffer_size);
185  if (css_Errno != NO_ERRORS)
186  {
187  css_remove_queued_connection_by_entry (entry, &css_Client_anchor);
188  return 0;
189  }
191  }
192  else
193  {
195  return 0;
196  }
197 
198  return (css_make_eid (entry->id, rid));
199 }
200 #endif
201 
202 /*
203  * css_send_request_to_server_with_buffer() - send a request to server
204  * return:
205  * host(in): name of the remote host
206  * request(in): the request to send to the server.
207  * arg_buffer(in): a packed buffer containing all the arguments to be sent to the server.
208  * arg_buffer_size(in): The size of arg_buffer.
209  * data_buffer(in): enroll a data buffer to hold the resulting data.
210  * data_buffer_size(in): The size of the data buffer.
211  *
212  * Note: This routine will allow the client to send a request to a host and
213  * also enroll a data buffer to be filled with returned data.
214  */
215 unsigned int
216 css_send_request_to_server_with_buffer (char *host, int request, char *arg_buffer, int arg_buffer_size,
217  char *data_buffer, int data_buffer_size)
218 {
219  CSS_MAP_ENTRY *entry;
220  unsigned short rid;
221 
222  entry = css_return_open_entry (host, &css_Client_anchor);
223  if (entry == NULL)
224  {
226  return 0;
227  }
228 
229  entry->conn->set_tran_index (tm_Tran_index);
231 
232  css_Errno = css_send_request_with_data_buffer (entry->conn, request, &rid, arg_buffer, arg_buffer_size, data_buffer,
233  data_buffer_size);
234  if (css_Errno != NO_ERRORS)
235  {
236  css_remove_queued_connection_by_entry (entry, &css_Client_anchor);
237  return 0;
238  }
239 
241  return (css_make_eid (entry->id, rid));
242 }
243 
244 /*
245  * css_send_req_to_server() - send a request to server
246  * return:
247  * host(in): name of the remote host
248  * request(in): the request to send to the server.
249  * arg_buffer(in): a packed buffer containing all the arguments to be sent to the server.
250  * arg_buffer_size(in): The size of arg_buffer.
251  * data_buffer(in): additional data to send to the server
252  * data_buffer_size(in): The size of the data buffer.
253  * reply_buffer(in): enroll a data buffer to hold the resulting data.
254  * reply_buffer_size(in): The size of the reply buffer.
255  *
256  * Note: This routine will allow the client to send a request to a host and
257  * also enroll a data buffer to be filled with returned data.
258  */
259 unsigned int
260 css_send_req_to_server (char *host, int request, char *arg_buffer, int arg_buffer_size, char *data_buffer,
261  int data_buffer_size, char *reply_buffer, int reply_size)
262 {
263  CSS_MAP_ENTRY *entry;
264  unsigned short rid;
265 
266  entry = css_return_open_entry (host, &css_Client_anchor);
267  if (entry == NULL)
268  {
270  return 0;
271  }
272 
273  entry->conn->set_tran_index (tm_Tran_index);
275 
276  /* if the latest query status is committed, fetch won't be issued. */
278 
279  css_Errno = css_send_req_with_2_buffers (entry->conn, request, &rid, arg_buffer, arg_buffer_size, data_buffer,
280  data_buffer_size, reply_buffer, reply_size);
281  if (css_Errno != NO_ERRORS)
282  {
283  css_remove_queued_connection_by_entry (entry, &css_Client_anchor);
284  return 0;
285  }
286 
288  return (css_make_eid (entry->id, rid));
289 }
290 
291 #if 0
292 /*
293  * css_send_req_to_server_with_large_data() - send a request to server with
294  * large data
295  * return:
296  * host(in): name of the remote host
297  * request(in): the request to send to the server.
298  * arg_buffer(in): a packed buffer containing all the arguments to be
299  * sent to the server.
300  * arg_buffer_size(in): The size of arg_buffer.
301  * data_buffer(in): additional data to send to the server
302  * data_buffer_size(in): The size of the data buffer.
303  * reply_buffer(in): enroll a data buffer to hold the resulting data.
304  * reply_buffer_size(in): The size of the reply buffer.
305  *
306  * Note: This routine will allow the client to send a request to a host and
307  * also enroll a data buffer to be filled with returned data.
308  */
309 unsigned int
310 css_send_req_to_server_with_large_data (char *host, int request, char *arg_buffer, int arg_buffer_size,
311  char *data_buffer, INT64 data_buffer_size, char *reply_buffer, int reply_size)
312 {
313  CSS_MAP_ENTRY *entry;
314  unsigned short rid;
315 
316  entry = css_return_open_entry (host, &css_Client_anchor);
317  if (entry != NULL)
318  {
321  css_Errno =
322  css_send_req_with_large_buffer (entry->conn, request, &rid, arg_buffer, arg_buffer_size, data_buffer,
323  data_buffer_size, reply_buffer, reply_size);
324  if (css_Errno == NO_ERRORS)
325  {
327  return (css_make_eid (entry->id, rid));
328  }
329  else
330  {
331  css_remove_queued_connection_by_entry (entry, &css_Client_anchor);
332  return 0;
333  }
334  }
335 
337  return 0;
338 }
339 #endif
340 
341 /*
342  * css_send_req_to_server_2_data() - send a request to server
343  * return:
344  * host(in): name of the remote host
345  * request(in): the request to send to the server.
346  * arg_buffer(in): a packed buffer containing all the arguments to be sent to the server.
347  * arg_buffer_size(in): The size of arg_buffer.
348  * data1_buffer(in): additional data to send to the server
349  * data1_buffer_size(in): The size of the data buffer.
350  * data2_buffer(in): additional data to send to the server
351  * data2_buffer_size(in): The size of the data buffer.
352  * reply_buffer(in): enroll a data buffer to hold the resulting data.
353  * reply_buffer_size(in): The size of the reply buffer.
354  *
355  * Note: This routine will allow the client to send a request and two data
356  * buffers to the server and also enroll a data buffer to be filled with returned data.
357  */
358 unsigned int
359 css_send_req_to_server_2_data (char *host, int request, char *arg_buffer, int arg_buffer_size, char *data1_buffer,
360  int data1_buffer_size, char *data2_buffer, int data2_buffer_size, char *reply_buffer,
361  int reply_size)
362 {
363  CSS_MAP_ENTRY *entry;
364  unsigned short rid;
365 
366  entry = css_return_open_entry (host, &css_Client_anchor);
367  if (entry == NULL)
368  {
370  return 0;
371  }
372 
373  entry->conn->set_tran_index (tm_Tran_index);
375 
376  css_Errno = css_send_req_with_3_buffers (entry->conn, request, &rid, arg_buffer, arg_buffer_size, data1_buffer,
377  data1_buffer_size, data2_buffer, data2_buffer_size, reply_buffer,
378  reply_size);
379  if (css_Errno != NO_ERRORS)
380  {
381  css_remove_queued_connection_by_entry (entry, &css_Client_anchor);
382  return 0;
383  }
384 
386  return (css_make_eid (entry->id, rid));
387 }
388 
389 /*
390  * css_send_req_to_server_no_reply() - send a data request to the server and receive no reply
391  * return:
392  * host(in):
393  * request(in):
394  * arg_buffer(in):
395  * arg_buffer_size(in):
396  */
397 unsigned int
398 css_send_req_to_server_no_reply (char *host, int request, char *arg_buffer, int arg_buffer_size)
399 {
400  CSS_MAP_ENTRY *entry;
401  unsigned short rid;
402 
403  entry = css_return_open_entry (host, &css_Client_anchor);
404  if (entry == NULL)
405  {
407  return 0;
408  }
409 
410  entry->conn->set_tran_index (tm_Tran_index);
412 
413  css_Errno = css_send_request_no_reply (entry->conn, request, &rid, arg_buffer, arg_buffer_size);
414  if (css_Errno != NO_ERRORS)
415  {
416  css_remove_queued_connection_by_entry (entry, &css_Client_anchor);
417  return 0;
418  }
419 
421  return (css_make_eid (entry->id, rid));
422 }
423 
424 /*
425  * css_queue_receive_data_buffer() - queue a data buffer for the client
426  * return:
427  * eid: enquiry id
428  * buffer: data buffer to queue for expected data.
429  * buffer_size: size of data buffer
430  */
431 int
432 css_queue_receive_data_buffer (unsigned int eid, char *buffer, int buffer_size)
433 {
434  CSS_MAP_ENTRY *entry;
435  unsigned short rid;
436  int rc = NO_ERRORS;
437 
438  if (buffer && (buffer_size > 0))
439  {
440  entry = css_return_entry_from_eid (eid, css_Client_anchor);
441  if (entry != NULL)
442  {
443  rid = CSS_RID_FROM_EID (eid);
444  rc = css_queue_user_data_buffer (entry->conn, rid, buffer_size, buffer);
445  }
446  }
447 
448  if (rc != NO_ERRORS)
449  {
450  return rc;
451  }
452  else
453  {
454  return 0;
455  }
456 }
457 
458 /*
459  * css_send_error_to_server() - send an error buffer to the server
460  * return:
461  * host(in): name of the server machine
462  * eid(in): enquiry id
463  * buffer(in): data buffer to queue for expected data.
464  * buffer_size(in): size of data buffer
465  */
466 unsigned int
467 css_send_error_to_server (char *host, unsigned int eid, char *buffer, int buffer_size)
468 {
469  CSS_MAP_ENTRY *entry;
470 
471  assert (er_errid () != NO_ERROR);
472 
473  entry = css_return_open_entry (host, &css_Client_anchor);
474  if (entry == NULL)
475  {
477  return css_Errno;
478  }
479 
480  entry->conn->set_tran_index (tm_Tran_index);
482  entry->conn->db_error = er_errid ();
483 
484  css_Errno = css_send_error (entry->conn, CSS_RID_FROM_EID (eid), buffer, buffer_size);
485  if (css_Errno != NO_ERRORS)
486  {
487  css_remove_queued_connection_by_entry (entry, &css_Client_anchor);
488  return css_Errno;
489  }
490 
492  entry->conn->db_error = 0;
493  return 0;
494 }
495 
496 /*
497  * css_send_data_to_server() - send a data buffer to the server
498  * return:
499  * host(in): name of the server machine
500  * eid(in): enquiry id
501  * buffer(in): data buffer to queue for expected data.
502  * buffer_size(in): size of data buffer
503  */
504 unsigned int
505 css_send_data_to_server (char *host, unsigned int eid, char *buffer, int buffer_size)
506 {
507  CSS_MAP_ENTRY *entry;
508 
509  entry = css_return_open_entry (host, &css_Client_anchor);
510  if (entry == NULL)
511  {
513  return css_Errno;
514  }
515 
516  entry->conn->set_tran_index (tm_Tran_index);
518 
519  css_Errno = css_send_data (entry->conn, CSS_RID_FROM_EID (eid), buffer, buffer_size);
520  if (css_Errno != NO_ERRORS)
521  {
522  css_remove_queued_connection_by_entry (entry, &css_Client_anchor);
523  return css_Errno;
524  }
525 
527  return 0;
528 }
529 
530 /*
531  * css_test_for_server_errors() -
532  * return: error id from the server
533  * entry(in):
534  * eid(in):
535  */
536 static int
538 {
539  char *error_buffer;
540  int error_size, rc, errid = NO_ERROR;
541 
542  if (css_return_queued_error (entry->conn, CSS_RID_FROM_EID (eid), &error_buffer, &error_size, &rc))
543  {
544  errid = er_set_area_error (error_buffer);
545  free_and_init (error_buffer);
546  }
547  return errid;
548 }
549 
550 /*
551  * css_receive_data_from_server() - return data that was sent by the server
552  * return:
553  * eid(in): enquiry id
554  * buffer(out): data buffer to be returned
555  * size(out): size of data buffer that was returned
556  */
557 unsigned int
558 css_receive_data_from_server (unsigned int eid, char **buffer, int *size)
559 {
560  return css_receive_data_from_server_with_timeout (eid, buffer, size, -1);
561 }
562 
563 /*
564  * css_receive_data_from_server_with_timeout() - return data that was sent by the server
565  * return:
566  * eid(in): enquiry id
567  * buffer(out): data buffer to be returned
568  * size(out): size of data buffer that was returned
569  * timeout(in) : timeout in milli-second
570  */
571 unsigned int
572 css_receive_data_from_server_with_timeout (unsigned int eid, char **buffer, int *size, int timeout)
573 {
574  CSS_MAP_ENTRY *entry;
575  int rid;
576 
577  entry = css_return_entry_from_eid (eid, css_Client_anchor);
578  if (entry == NULL)
579  {
581  return css_Errno;
582  }
583 
584  rid = CSS_RID_FROM_EID (eid);
585  css_Errno = css_receive_data (entry->conn, rid, buffer, size, timeout);
587  {
588  css_test_for_server_errors (entry, eid);
589  }
590 
591  return css_Errno == NO_ERRORS ? 0 : css_Errno;
592 }
593 
594 #if defined (ENABLE_UNUSED_FUNCTION)
595 /*
596  * css_receive_error_from_server() - return error data from the server
597  * return:
598  * eid(in): enquiry id
599  * buffer(out): error buffer to be returned
600  * size(out): size of error buffer that was returned
601  */
602 unsigned int
603 css_receive_error_from_server (unsigned int eid, char **buffer, int *size)
604 {
605  CSS_MAP_ENTRY *entry;
606 
607  entry = css_return_entry_from_eid (eid, css_Client_anchor);
608  if (entry != NULL)
609  {
610  css_Errno = css_receive_error (entry->conn, CSS_RID_FROM_EID (eid), buffer, size);
611  if (css_Errno == NO_ERRORS)
612  {
613  return 0;
614  }
615  else
616  {
617  /*
618  * Normally, we disconnect upon any type of receive error. However,
619  * in the case of allocation errors, we want to continue and
620  * propagate the error.
621  */
623  {
624  css_remove_queued_connection_by_entry (entry, &css_Client_anchor);
625  }
626  return css_Errno;
627  }
628  }
629 
631  return css_Errno;
632 }
633 #endif /* ENABLE_UNUSED_FUNCTION */
634 
635 /*
636  * css_terminate() - "gracefully" terminate all requests
637  * server_error(in):
638  * return: void
639  */
640 void
641 css_terminate (bool server_error)
642 {
643  while (css_Client_anchor)
644  {
645  if (server_error && css_Client_anchor->conn)
646  {
647  css_Client_anchor->conn->status = CONN_CLOSING;
648  }
649  css_send_close_request (css_Client_anchor->conn);
650  css_remove_queued_connection_by_entry (css_Client_anchor, &css_Client_anchor);
651  }
652 
653 #if defined(WINDOWS)
655 #endif /* WINDOWS */
656 
657  /*
658  * If there was a previous signal handler. restore it at this point.
659  */
660 #if !defined(WINDOWS)
662  {
665  }
666 #endif /* not WINDOWS */
667 }
668 
669 /*
670  * css_cleanup_client_queues() -
671  * return:
672  * host_name(in):
673  */
674 void
675 css_cleanup_client_queues (char *host_name)
676 {
677  CSS_MAP_ENTRY *entry;
678 
679  entry = css_return_open_entry (host_name, &css_Client_anchor);
680  if (entry != NULL)
681  {
683  }
684 }
685 
686 /*
687  * css_ha_server_state - return the current HA server state
688  * return: one of HA_SERVER_STATE
689  */
692 {
693  return boot_change_ha_mode (HA_SERVER_STATE_NA, false, 0);
694 }
int status
unsigned short id
unsigned int css_make_eid(unsigned short entry_id, unsigned short rid)
#define NO_ERROR
Definition: error_code.h:46
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_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)
int tm_Tran_index
static void css_set_pipe_signal(void)
#define CSS_RID_FROM_EID(eid)
unsigned int css_receive_data_from_server(unsigned int eid, char **buffer, int *size)
static int eid
Definition: cas_error_log.c:61
CSS_CONN_ENTRY * conn
unsigned int css_send_req_to_server_no_reply(char *host, int request, char *arg_buffer, int arg_buffer_size)
int tm_Tran_invalidate_snapshot
int er_errid(void)
int css_return_queued_error(CSS_CONN_ENTRY *conn, unsigned short request_id, char **buffer, int *buffer_size, int *rc)
int css_send_close_request(CSS_CONN_ENTRY *conn)
static void(* css_Previous_sigpipe_handler)(int sig_no)
void css_cleanup_client_queues(char *host_name)
CSS_MAP_ENTRY * css_Client_anchor
CSS_CONN_ENTRY * css_connect_to_cubrid_server(char *host_name, char *server_name)
int css_queue_receive_data_buffer(unsigned int eid, char *buffer, int buffer_size)
int transaction_id
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)
int css_send_request(CSS_CONN_ENTRY *conn, int command, unsigned short *request_id, const char *arg_buffer, int arg_buffer_size)
#define assert(x)
static void css_handle_pipe_shutdown(int sig)
int er_set_area_error(char *server_area)
int css_client_init(int sockid, const char *server_name, const char *host_name)
unsigned int css_send_data_to_server(char *host, unsigned int eid, char *buffer, int buffer_size)
bool tran_was_latest_query_committed(void)
CSS_MAP_ENTRY * css_return_entry_from_eid(unsigned int eid, CSS_MAP_ENTRY *anchor)
#define NULL
Definition: freelistheap.h:34
CSS_MAP_ENTRY * css_return_open_entry(char *host, CSS_MAP_ENTRY **anchor)
CSS_MAP_ENTRY * css_queue_connection(CSS_CONN_ENTRY *conn, const char *host, CSS_MAP_ENTRY **anchor)
HA_SERVER_STATE boot_change_ha_mode(HA_SERVER_STATE state, bool force, int timeout)
static void error(const char *msg)
Definition: gencat.c:331
static int rc
Definition: serial.c:50
int css_receive_data(CSS_CONN_ENTRY *conn, unsigned short req_id, char **buffer, int *buffer_size, int timeout)
void css_remove_queued_connection_by_entry(CSS_MAP_ENTRY *entry, CSS_MAP_ENTRY **anchor)
int css_windows_startup(void)
Definition: wintcp.c:94
void css_terminate(bool server_error)
#define free_and_init(ptr)
Definition: memory_alloc.h:147
int css_Service_id
int css_queue_user_data_buffer(CSS_CONN_ENTRY *conn, unsigned short request_id, int size, char *buffer)
unsigned int css_receive_data_from_server_with_timeout(unsigned int eid, char **buffer, int *size, int timeout)
void css_windows_shutdown(void)
Definition: wintcp.c:140
static int css_test_for_server_errors(CSS_MAP_ENTRY *entry, unsigned int eid)
HA_SERVER_STATE css_ha_server_state(void)
int css_send_request_with_data_buffer(CSS_CONN_ENTRY *conn, int request, unsigned short *request_id, const char *arg_buffer, int arg_size, char *reply_buffer, int reply_size)
unsigned int css_send_error_to_server(char *host, unsigned int eid, char *buffer, int buffer_size)
CSS_MAP_ENTRY * css_return_entry_from_conn(CSS_CONN_ENTRY *conn, CSS_MAP_ENTRY *anchor)
int css_receive_error(CSS_CONN_ENTRY *conn, unsigned short req_id, char **buffer, int *buffer_size)
int invalidate_snapshot
int css_send_data(CSS_CONN_ENTRY *conn, unsigned short rid, const char *buffer, int buffer_size)
enum ha_server_state HA_SERVER_STATE
Definition: boot.h:126
int css_Errno
int css_send_error(CSS_CONN_ENTRY *conn, unsigned short rid, const char *buffer, int buffer_size)
int db_error
static char * host
static void css_internal_server_shutdown(void)
CSS_CONN_ENTRY * css_find_exception_conn(void)
SIGNAL_HANDLER_FUNCTION os_set_signal_handler(const int sig_no, SIGNAL_HANDLER_FUNCTION sig_handler)
Definition: porting.c:1333
void css_remove_all_unexpected_packets(CSS_CONN_ENTRY *conn)