mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 22:43:04 +01:00
Trying to fix the interface again.
Sorry for going back and forth with constness, but in some cases it was impossible to ensure that input params aren't overwritten, thus I took const away to avoid making promises that can't be met (see the case of fetch that uses a supposedly input-only param to return data). Overwriting memory that was declared const initially is a serious error in C++ with undefined outcome so we better do not lie.
This commit is contained in:
parent
a12f246b7c
commit
b2e8da134f
@ -86,10 +86,6 @@
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/inet.h>
|
||||
/* EKU: SINIX-Z does not define INADDR_NONE */
|
||||
#ifndef INADDR_NONE
|
||||
#define INADDR_NONE (unsigned long)-1
|
||||
#endif
|
||||
#endif // !WIN_NT
|
||||
|
||||
#if (defined DARWIN || defined HPUX)
|
||||
@ -282,11 +278,11 @@ static bool_t inet_putbytes(XDR*, const SCHAR*, u_int);
|
||||
static bool_t inet_read(XDR *);
|
||||
static bool_t inet_setpostn(XDR *, u_int);
|
||||
static rem_port* inet_try_connect( PACKET*,
|
||||
RDB,
|
||||
Firebird::PathName&,
|
||||
Rdb*,
|
||||
const Firebird::PathName&,
|
||||
const TEXT*,
|
||||
ISC_STATUS*,
|
||||
Firebird::ClumpletReader &);
|
||||
Firebird::ClumpletReader&);
|
||||
static bool_t inet_write(XDR *, int);
|
||||
#if !(defined WIN_NT)
|
||||
static int parse_hosts(const TEXT*, const TEXT*, const TEXT*);
|
||||
@ -365,7 +361,7 @@ static int INET_max_clients;
|
||||
static Firebird::GlobalPtr<Firebird::Mutex> port_mutex;
|
||||
|
||||
|
||||
rem_port* INET_analyze(Firebird::PathName& file_name,
|
||||
rem_port* INET_analyze(const Firebird::PathName& file_name,
|
||||
ISC_STATUS* status_vector,
|
||||
const TEXT* node_name,
|
||||
const TEXT* user_string,
|
||||
@ -391,7 +387,7 @@ rem_port* INET_analyze(Firebird::PathName& file_name,
|
||||
/* We need to establish a connection to a remote server. Allocate the necessary
|
||||
blocks and get ready to go. */
|
||||
|
||||
RDB rdb = new Rdb;
|
||||
Rdb* rdb = new Rdb;
|
||||
PACKET* packet = &rdb->rdb_packet;
|
||||
|
||||
/* Pick up some user identification information */
|
||||
@ -430,7 +426,7 @@ rem_port* INET_analyze(Firebird::PathName& file_name,
|
||||
P_CNCT* cnct = &packet->p_cnct;
|
||||
|
||||
cnct->p_cnct_user_id.cstr_length = user_id.getBufferLength();
|
||||
cnct->p_cnct_user_id.cstr_address = const_cast<UCHAR*>(user_id.getBuffer());
|
||||
cnct->p_cnct_user_id.cstr_address = user_id.getBuffer();
|
||||
|
||||
static const p_cnct::p_cnct_repeat protocols_to_try1[] =
|
||||
{
|
||||
@ -464,7 +460,7 @@ rem_port* INET_analyze(Firebird::PathName& file_name,
|
||||
/* try again with next set of known protocols */
|
||||
|
||||
cnct->p_cnct_user_id.cstr_length = user_id.getBufferLength();
|
||||
cnct->p_cnct_user_id.cstr_address = const_cast<UCHAR*>(user_id.getBuffer());
|
||||
cnct->p_cnct_user_id.cstr_address = user_id.getBuffer();
|
||||
|
||||
static const p_cnct::p_cnct_repeat protocols_to_try2[] =
|
||||
{
|
||||
@ -492,7 +488,7 @@ rem_port* INET_analyze(Firebird::PathName& file_name,
|
||||
/* try again with next set of known protocols */
|
||||
|
||||
cnct->p_cnct_user_id.cstr_length = user_id.getBufferLength();
|
||||
cnct->p_cnct_user_id.cstr_address = const_cast<UCHAR*>(user_id.getBuffer());
|
||||
cnct->p_cnct_user_id.cstr_address = user_id.getBuffer();
|
||||
|
||||
static const p_cnct::p_cnct_repeat protocols_to_try3[] =
|
||||
{
|
||||
@ -2449,7 +2445,7 @@ static int xdrinet_create(
|
||||
**************************************/
|
||||
|
||||
xdrs->x_public = (caddr_t) port;
|
||||
xdrs->x_base = xdrs->x_private = (SCHAR *) buffer;
|
||||
xdrs->x_base = xdrs->x_private = reinterpret_cast<SCHAR*>(buffer);
|
||||
xdrs->x_handy = length;
|
||||
xdrs->x_ops = (xdr_t::xdr_ops *) & inet_ops;
|
||||
xdrs->x_op = x_op;
|
||||
@ -2865,8 +2861,8 @@ static bool_t inet_setpostn( XDR * xdrs, u_int bytecount)
|
||||
|
||||
static rem_port* inet_try_connect(
|
||||
PACKET* packet,
|
||||
RDB rdb,
|
||||
Firebird::PathName& file_name,
|
||||
Rdb* rdb,
|
||||
const Firebird::PathName& file_name,
|
||||
const TEXT* node_name,
|
||||
ISC_STATUS* status_vector,
|
||||
Firebird::ClumpletReader& dpb)
|
||||
@ -2891,8 +2887,7 @@ static rem_port* inet_try_connect(
|
||||
cnct->p_cnct_cversion = CONNECT_VERSION2;
|
||||
cnct->p_cnct_client = ARCHITECTURE;
|
||||
cnct->p_cnct_file.cstr_length = file_name.length();
|
||||
cnct->p_cnct_file.cstr_address =
|
||||
reinterpret_cast<UCHAR*>(file_name.begin());
|
||||
cnct->p_cnct_file.cstr_address = reinterpret_cast<const UCHAR*>(file_name.c_str());
|
||||
|
||||
/* If we can't talk to a server, punt. Let somebody else generate
|
||||
an error. status_vector will have the network error info. */
|
||||
|
@ -31,7 +31,7 @@ namespace Firebird
|
||||
class ClumpletReader;
|
||||
};
|
||||
|
||||
rem_port* INET_analyze(Firebird::PathName&, ISC_STATUS*, const TEXT*, const TEXT*,
|
||||
rem_port* INET_analyze(const Firebird::PathName&, ISC_STATUS*, const TEXT*, const TEXT*,
|
||||
bool, Firebird::ClumpletReader&);
|
||||
rem_port* INET_connect(const TEXT*, struct packet*, ISC_STATUS*, USHORT,
|
||||
Firebird::ClumpletReader*);
|
||||
|
@ -30,9 +30,8 @@ extern "C" {
|
||||
|
||||
ISC_STATUS REM_attach_database(ISC_STATUS*, SSHORT, const SCHAR*, struct Rdb**,
|
||||
SSHORT, const SCHAR*, const UCHAR*);
|
||||
ISC_STATUS REM_attach_service(ISC_STATUS *, USHORT, TEXT *, struct Rdb **, USHORT, SCHAR *);
|
||||
ISC_STATUS REM_blob_info(ISC_STATUS*, struct Rbl**, SSHORT, const SCHAR*,
|
||||
SSHORT, SCHAR*);
|
||||
ISC_STATUS REM_blob_info(ISC_STATUS*, struct Rbl**, SSHORT, const UCHAR*,
|
||||
SSHORT, UCHAR*);
|
||||
ISC_STATUS REM_cancel_blob(ISC_STATUS *, struct Rbl **);
|
||||
ISC_STATUS REM_cancel_events(ISC_STATUS *, struct Rdb **, SLONG *);
|
||||
ISC_STATUS REM_close_blob(ISC_STATUS *, struct Rbl **);
|
||||
@ -44,29 +43,28 @@ ISC_STATUS REM_create_blob2(ISC_STATUS*, struct Rdb**, struct Rtr**,
|
||||
struct Rbl**, BID, USHORT, const UCHAR*);
|
||||
ISC_STATUS REM_create_database(ISC_STATUS*, SSHORT, const SCHAR*, struct Rdb**,
|
||||
SSHORT, const SCHAR*, SSHORT, const UCHAR*);
|
||||
ISC_STATUS REM_database_info(ISC_STATUS*, struct Rdb**, SSHORT, const SCHAR*,
|
||||
SSHORT, SCHAR*);
|
||||
ISC_STATUS REM_database_info(ISC_STATUS*, struct Rdb**, SSHORT, const UCHAR*,
|
||||
SSHORT, UCHAR*);
|
||||
ISC_STATUS REM_ddl(ISC_STATUS*, struct Rdb**, struct Rtr**,
|
||||
USHORT, const UCHAR*);
|
||||
ISC_STATUS REM_detach_database(ISC_STATUS *, struct Rdb **);
|
||||
ISC_STATUS REM_detach_service(ISC_STATUS *, struct Rdb **);
|
||||
ISC_STATUS REM_drop_database(ISC_STATUS *, struct Rdb **);
|
||||
ISC_STATUS REM_allocate_statement(ISC_STATUS *, struct Rdb **, struct Rsr **);
|
||||
ISC_STATUS REM_execute(ISC_STATUS*, struct Rtr**, struct Rsr**, USHORT, const UCHAR*, USHORT, USHORT, const UCHAR*);
|
||||
ISC_STATUS REM_execute2(ISC_STATUS*, struct Rtr**, struct Rsr**, USHORT, const UCHAR*, USHORT, USHORT, const UCHAR*, USHORT, UCHAR*, USHORT, USHORT, UCHAR*);
|
||||
ISC_STATUS REM_execute(ISC_STATUS*, struct Rtr**, struct Rsr**, USHORT, const UCHAR*, USHORT, USHORT, UCHAR*);
|
||||
ISC_STATUS REM_execute2(ISC_STATUS*, struct Rtr**, struct Rsr**, USHORT, const UCHAR*, USHORT, USHORT, UCHAR*, USHORT, UCHAR*, USHORT, USHORT, UCHAR*);
|
||||
ISC_STATUS REM_execute_immediate(ISC_STATUS*, struct Rdb**, struct Rtr**,
|
||||
USHORT, const TEXT*, USHORT, USHORT, const UCHAR*, USHORT, USHORT, UCHAR*);
|
||||
USHORT, const TEXT*, USHORT, USHORT, UCHAR*, USHORT, USHORT, UCHAR*);
|
||||
ISC_STATUS REM_execute_immediate2(ISC_STATUS*, struct Rdb**, struct Rtr**,
|
||||
USHORT, const TEXT*, USHORT, USHORT, const UCHAR*, USHORT, USHORT, const UCHAR*,
|
||||
USHORT, const TEXT*, USHORT, USHORT, UCHAR*, USHORT, USHORT, UCHAR*,
|
||||
USHORT, UCHAR*, USHORT, USHORT, UCHAR*);
|
||||
ISC_STATUS REM_fetch(ISC_STATUS*, struct Rsr**, USHORT, const UCHAR*, USHORT,
|
||||
ISC_STATUS REM_fetch(ISC_STATUS*, struct Rsr**, USHORT, UCHAR*, USHORT,
|
||||
USHORT, UCHAR*);
|
||||
ISC_STATUS REM_free_statement(ISC_STATUS *, struct Rsr **, USHORT);
|
||||
ISC_STATUS REM_insert(ISC_STATUS *, struct Rsr **, USHORT, UCHAR *, USHORT, USHORT, UCHAR *);
|
||||
ISC_STATUS REM_prepare(ISC_STATUS *, struct Rtr **, struct Rsr **, USHORT, TEXT *, USHORT, USHORT, SCHAR *, USHORT, SCHAR *);
|
||||
ISC_STATUS REM_insert(ISC_STATUS*, struct Rsr**, USHORT, const UCHAR*, USHORT, USHORT, UCHAR*);
|
||||
ISC_STATUS REM_prepare(ISC_STATUS*, struct Rtr**, struct Rsr**, USHORT, const TEXT*, USHORT, USHORT, const UCHAR*, USHORT, UCHAR*);
|
||||
ISC_STATUS REM_set_cursor_name(ISC_STATUS*, struct Rsr**, const TEXT*, USHORT);
|
||||
ISC_STATUS REM_sql_info(ISC_STATUS*, struct Rsr**, SSHORT, const SCHAR*,
|
||||
SSHORT, SCHAR*);
|
||||
ISC_STATUS REM_sql_info(ISC_STATUS*, struct Rsr**, SSHORT, const UCHAR*,
|
||||
SSHORT, UCHAR*);
|
||||
ISC_STATUS REM_get_segment(ISC_STATUS *, struct Rbl **, USHORT *, USHORT, UCHAR *);
|
||||
ISC_STATUS REM_get_slice(ISC_STATUS*, struct Rdb**, struct Rtr**, BID, USHORT,
|
||||
const UCHAR*, USHORT, const UCHAR*, SLONG, UCHAR*, SLONG*);
|
||||
@ -78,7 +76,6 @@ ISC_STATUS REM_put_slice(ISC_STATUS*, struct Rdb**, struct Rtr**, BID, USHORT,
|
||||
const UCHAR*, USHORT, const UCHAR*, SLONG, UCHAR*);
|
||||
ISC_STATUS REM_que_events(ISC_STATUS*, struct Rdb**, SLONG*, SSHORT,
|
||||
const UCHAR*, FPTR_EVENT_CALLBACK, void*);
|
||||
ISC_STATUS REM_query_service(ISC_STATUS *, struct Rdb **, USHORT, SCHAR *, USHORT, SCHAR *, USHORT, SCHAR *);
|
||||
#ifdef SCROLLABLE_CURSORS
|
||||
ISC_STATUS REM_receive(ISC_STATUS*, struct Rrq**, USHORT, USHORT, UCHAR*, SSHORT, USHORT, ULONG);
|
||||
#else
|
||||
@ -94,20 +91,20 @@ ISC_STATUS REM_seek_blob(ISC_STATUS *, struct Rbl **, SSHORT, SLONG, SLONG *);
|
||||
ISC_STATUS REM_send(ISC_STATUS *, struct Rrq **, USHORT, USHORT, UCHAR *, SSHORT);
|
||||
ISC_STATUS REM_start_and_send(ISC_STATUS *, struct Rrq **, struct Rtr **, USHORT, USHORT, UCHAR *, SSHORT);
|
||||
ISC_STATUS REM_start_request(ISC_STATUS *, struct Rrq **, struct Rtr **, USHORT);
|
||||
ISC_STATUS REM_start_transaction(ISC_STATUS *, struct Rtr **, SSHORT, struct Rdb **, SSHORT, UCHAR *);
|
||||
ISC_STATUS REM_start_transaction(ISC_STATUS*, struct Rtr**, SSHORT, struct Rdb**, SSHORT, const UCHAR*);
|
||||
ISC_STATUS REM_transact_request(ISC_STATUS*, struct Rdb**, struct Rtr**,
|
||||
USHORT, const UCHAR*, USHORT, const UCHAR*, USHORT, UCHAR*);
|
||||
USHORT, UCHAR*, USHORT, UCHAR*, USHORT, UCHAR*);
|
||||
ISC_STATUS REM_transaction_info(ISC_STATUS*, struct Rtr**, SSHORT,
|
||||
const UCHAR*, SSHORT, UCHAR*);
|
||||
ISC_STATUS REM_unwind_request(ISC_STATUS *, struct Rrq **, USHORT);
|
||||
|
||||
ISC_STATUS REM_rollback_retaining(ISC_STATUS *, RTR *);
|
||||
ISC_STATUS REM_service_attach(ISC_STATUS*, USHORT, const TEXT*, RDB*, USHORT,
|
||||
const SCHAR*);
|
||||
ISC_STATUS REM_service_detach(ISC_STATUS *, RDB *);
|
||||
ISC_STATUS REM_service_query(ISC_STATUS*, RDB*, ULONG*, USHORT, const SCHAR*,
|
||||
USHORT, const SCHAR*, USHORT, SCHAR*);
|
||||
ISC_STATUS REM_service_start(ISC_STATUS*, RDB*, ULONG*, USHORT, const SCHAR*);
|
||||
ISC_STATUS REM_rollback_retaining(ISC_STATUS*, Rtr**);
|
||||
ISC_STATUS REM_service_attach(ISC_STATUS*, USHORT, const TEXT*, Rdb**, USHORT,
|
||||
const UCHAR*);
|
||||
ISC_STATUS REM_service_detach(ISC_STATUS *, Rdb**);
|
||||
ISC_STATUS REM_service_query(ISC_STATUS*, Rdb**, ULONG*, USHORT, const UCHAR*,
|
||||
USHORT, const UCHAR*, USHORT, UCHAR*);
|
||||
ISC_STATUS REM_service_start(ISC_STATUS*, Rdb**, ULONG*, USHORT, const UCHAR*);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -100,7 +100,7 @@ static xdr_t::xdr_ops wnet_ops =
|
||||
};
|
||||
|
||||
|
||||
rem_port* WNET_analyze(Firebird::PathName& file_name,
|
||||
rem_port* WNET_analyze(const Firebird::PathName& file_name,
|
||||
ISC_STATUS* status_vector,
|
||||
const TEXT* node_name,
|
||||
const TEXT* user_string,
|
||||
@ -151,8 +151,7 @@ rem_port* WNET_analyze(Firebird::PathName& file_name,
|
||||
cnct->p_cnct_cversion = CONNECT_VERSION2;
|
||||
cnct->p_cnct_client = ARCHITECTURE;
|
||||
cnct->p_cnct_file.cstr_length = file_name.length();
|
||||
cnct->p_cnct_file.cstr_address =
|
||||
reinterpret_cast<UCHAR*>(file_name.begin());
|
||||
cnct->p_cnct_file.cstr_address = reinterpret_cast<const UCHAR*>(file_name.c_str());
|
||||
|
||||
/* Note: prior to V3.1E a receivers could not in truth handle more
|
||||
then 5 protocol descriptions; however, this restriction does not
|
||||
@ -161,7 +160,7 @@ rem_port* WNET_analyze(Firebird::PathName& file_name,
|
||||
/* If we want user verification, we can't speak anything less than version 7 */
|
||||
|
||||
cnct->p_cnct_user_id.cstr_length = user_id.getBufferLength();
|
||||
cnct->p_cnct_user_id.cstr_address = const_cast<UCHAR*>(user_id.getBuffer());
|
||||
cnct->p_cnct_user_id.cstr_address = user_id.getBuffer();
|
||||
|
||||
static const p_cnct::p_cnct_repeat protocols_to_try1[] =
|
||||
{
|
||||
@ -201,12 +200,12 @@ rem_port* WNET_analyze(Firebird::PathName& file_name,
|
||||
cnct->p_cnct_cversion = CONNECT_VERSION2;
|
||||
cnct->p_cnct_client = ARCHITECTURE;
|
||||
cnct->p_cnct_file.cstr_length = file_name.length();
|
||||
cnct->p_cnct_file.cstr_address = (UCHAR *) file_name.c_str();
|
||||
cnct->p_cnct_file.cstr_address = reinterpret_cast<const UCHAR*>(file_name.c_str());
|
||||
|
||||
/* try again with next set of known protocols */
|
||||
|
||||
cnct->p_cnct_user_id.cstr_length = user_id.getBufferLength();
|
||||
cnct->p_cnct_user_id.cstr_address = const_cast<UCHAR*>(user_id.getBuffer());
|
||||
cnct->p_cnct_user_id.cstr_address = user_id.getBuffer();
|
||||
|
||||
static const p_cnct::p_cnct_repeat protocols_to_try2[] =
|
||||
{
|
||||
@ -239,12 +238,12 @@ rem_port* WNET_analyze(Firebird::PathName& file_name,
|
||||
cnct->p_cnct_cversion = CONNECT_VERSION2;
|
||||
cnct->p_cnct_client = ARCHITECTURE;
|
||||
cnct->p_cnct_file.cstr_length = file_name.length();
|
||||
cnct->p_cnct_file.cstr_address = (UCHAR *) file_name.c_str();
|
||||
cnct->p_cnct_file.cstr_address = reinterpret_cast<const UCHAR*>(file_name.c_str());
|
||||
|
||||
/* try again with next set of known protocols */
|
||||
|
||||
cnct->p_cnct_user_id.cstr_length = user_id.getBufferLength();
|
||||
cnct->p_cnct_user_id.cstr_address = const_cast<UCHAR*>(user_id.getBuffer());
|
||||
cnct->p_cnct_user_id.cstr_address = user_id.getBuffer();
|
||||
|
||||
static const p_cnct::p_cnct_repeat protocols_to_try3[] =
|
||||
{
|
||||
@ -900,7 +899,7 @@ static int send_partial( rem_port* port, PACKET * packet)
|
||||
static int xdrwnet_create(
|
||||
XDR * xdrs,
|
||||
rem_port* port,
|
||||
UCHAR * buffer, USHORT length, enum xdr_op x_op)
|
||||
UCHAR* buffer, USHORT length, enum xdr_op x_op)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -914,7 +913,7 @@ static int xdrwnet_create(
|
||||
**************************************/
|
||||
|
||||
xdrs->x_public = (caddr_t) port;
|
||||
xdrs->x_base = xdrs->x_private = (SCHAR *) buffer;
|
||||
xdrs->x_base = xdrs->x_private = reinterpret_cast<SCHAR*>(buffer);
|
||||
xdrs->x_handy = length;
|
||||
xdrs->x_ops = &wnet_ops;
|
||||
xdrs->x_op = x_op;
|
||||
@ -1425,7 +1424,7 @@ static int packet_send( rem_port* port, const SCHAR* buffer, SSHORT buffer_lengt
|
||||
return wnet_error(port, "WriteFile truncated", isc_net_write_err, ERRNO);
|
||||
|
||||
#if defined(DEBUG) && defined(WNET_trace)
|
||||
packet_print("send", (UCHAR*)buffer, buffer_length);
|
||||
packet_print("send", reinterpret_cast<const UCHAR*>(buffer), buffer_length);
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
|
@ -31,7 +31,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
rem_port* WNET_analyze(Firebird::PathName&, ISC_STATUS*, const TEXT*, const TEXT*, bool);
|
||||
rem_port* WNET_analyze(const Firebird::PathName&, ISC_STATUS*, const TEXT*, const TEXT*, bool);
|
||||
rem_port* WNET_connect(const TEXT*, struct packet*, ISC_STATUS*, USHORT);
|
||||
rem_port* WNET_reconnect(HANDLE, ISC_STATUS*);
|
||||
rem_port* WNET_server(void*);
|
||||
|
@ -222,7 +222,7 @@ REM_MSG PARSE_messages(const UCHAR* blr, USHORT blr_length)
|
||||
#endif
|
||||
next->msg_next = message;
|
||||
message = next;
|
||||
message->msg_address = (UCHAR *) format;
|
||||
message->msg_address = reinterpret_cast<UCHAR*>(format);
|
||||
message->msg_number = msg_number;
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ static bool_t xdr_slice(XDR*, lstring*, USHORT, const UCHAR*);
|
||||
static bool_t xdr_status_vector(XDR *, ISC_STATUS *, TEXT * strings[]);
|
||||
static bool_t xdr_sql_blr(XDR *, SLONG, CSTRING *, int, SQL_STMT_TYPE);
|
||||
static bool_t xdr_sql_message(XDR *, SLONG);
|
||||
static bool_t xdr_trrq_blr(XDR *, CSTRING *);
|
||||
static bool_t xdr_trrq_blr(XDR*, CSTRING*);
|
||||
static bool_t xdr_trrq_message(XDR *, USHORT);
|
||||
|
||||
#ifdef NOT_USED_OR_REPLACED
|
||||
@ -299,10 +299,10 @@ bool_t xdr_protocol(XDR* xdrs, PACKET* p)
|
||||
MAP(xdr_short,
|
||||
reinterpret_cast<SSHORT&>(connect->p_cnct_cversion));
|
||||
MAP(xdr_enum, reinterpret_cast<xdr_op&>(connect->p_cnct_client));
|
||||
MAP(xdr_cstring, connect->p_cnct_file);
|
||||
MAP(xdr_cstring_const, connect->p_cnct_file);
|
||||
MAP(xdr_short, reinterpret_cast<SSHORT&>(connect->p_cnct_count));
|
||||
|
||||
MAP(xdr_cstring, connect->p_cnct_user_id);
|
||||
MAP(xdr_cstring_const, connect->p_cnct_user_id);
|
||||
|
||||
const size_t CNCT_VERSIONS = FB_NELEM(connect->p_cnct_versions);
|
||||
for (i = 0, tail = connect->p_cnct_versions;
|
||||
@ -359,8 +359,8 @@ bool_t xdr_protocol(XDR* xdrs, PACKET* p)
|
||||
attach = &p->p_atch;
|
||||
MAP(xdr_short,
|
||||
reinterpret_cast<SSHORT&>(attach->p_atch_database));
|
||||
MAP(xdr_cstring, attach->p_atch_file);
|
||||
MAP(xdr_cstring, attach->p_atch_dpb);
|
||||
MAP(xdr_cstring_const, attach->p_atch_file);
|
||||
MAP(xdr_cstring_const, attach->p_atch_dpb);
|
||||
DEBUG_PRINTSIZE(xdrs, p->p_operation);
|
||||
return P_TRUE(xdrs, p);
|
||||
|
||||
@ -368,7 +368,7 @@ bool_t xdr_protocol(XDR* xdrs, PACKET* p)
|
||||
compile = &p->p_cmpl;
|
||||
MAP(xdr_short,
|
||||
reinterpret_cast<SSHORT&>(compile->p_cmpl_database));
|
||||
MAP(xdr_cstring, compile->p_cmpl_blr);
|
||||
MAP(xdr_cstring_const, compile->p_cmpl_blr);
|
||||
DEBUG_PRINTSIZE(xdrs, p->p_operation);
|
||||
return P_TRUE(xdrs, p);
|
||||
|
||||
@ -491,7 +491,7 @@ bool_t xdr_protocol(XDR* xdrs, PACKET* p)
|
||||
transaction = &p->p_sttr;
|
||||
MAP(xdr_short,
|
||||
reinterpret_cast<SSHORT&>(transaction->p_sttr_database));
|
||||
MAP(xdr_cstring, transaction->p_sttr_tpb);
|
||||
MAP(xdr_cstring_const, transaction->p_sttr_tpb);
|
||||
DEBUG_PRINTSIZE(xdrs, p->p_operation);
|
||||
return P_TRUE(xdrs, p);
|
||||
|
||||
@ -505,11 +505,10 @@ bool_t xdr_protocol(XDR* xdrs, PACKET* p)
|
||||
MAP(xdr_short, reinterpret_cast<SSHORT&>(info->p_info_object));
|
||||
MAP(xdr_short,
|
||||
reinterpret_cast<SSHORT&>(info->p_info_incarnation));
|
||||
MAP(xdr_cstring, info->p_info_items);
|
||||
MAP(xdr_cstring_const, info->p_info_items);
|
||||
if (p->p_operation == op_service_info)
|
||||
MAP(xdr_cstring, info->p_info_recv_items);
|
||||
MAP(xdr_short,
|
||||
reinterpret_cast<SSHORT&>(info->p_info_buffer_length));
|
||||
MAP(xdr_cstring_const, info->p_info_recv_items);
|
||||
MAP(xdr_short, reinterpret_cast<SSHORT&>(info->p_info_buffer_length));
|
||||
DEBUG_PRINTSIZE(xdrs, p->p_operation);
|
||||
return P_TRUE(xdrs, p);
|
||||
|
||||
@ -518,7 +517,7 @@ bool_t xdr_protocol(XDR* xdrs, PACKET* p)
|
||||
MAP(xdr_short, reinterpret_cast<SSHORT&>(info->p_info_object));
|
||||
MAP(xdr_short,
|
||||
reinterpret_cast<SSHORT&>(info->p_info_incarnation));
|
||||
MAP(xdr_cstring, info->p_info_items);
|
||||
MAP(xdr_cstring_const, info->p_info_items);
|
||||
DEBUG_PRINTSIZE(xdrs, p->p_operation);
|
||||
return P_TRUE(xdrs, p);
|
||||
|
||||
@ -544,7 +543,7 @@ bool_t xdr_protocol(XDR* xdrs, PACKET* p)
|
||||
prepare = &p->p_prep;
|
||||
MAP(xdr_short,
|
||||
reinterpret_cast<SSHORT&>(prepare->p_prep_transaction));
|
||||
MAP(xdr_cstring, prepare->p_prep_data);
|
||||
MAP(xdr_cstring_const, prepare->p_prep_data);
|
||||
DEBUG_PRINTSIZE(xdrs, p->p_operation);
|
||||
return P_TRUE(xdrs, p);
|
||||
|
||||
@ -554,7 +553,7 @@ bool_t xdr_protocol(XDR* xdrs, PACKET* p)
|
||||
P_EVENT* event = &p->p_event;
|
||||
MAP(xdr_short,
|
||||
reinterpret_cast<SSHORT&>(event->p_event_database));
|
||||
MAP(xdr_cstring, event->p_event_items);
|
||||
MAP(xdr_cstring_const, event->p_event_items);
|
||||
|
||||
// Nickolay Samofatov: these values are parsed, but are ignored by the client.
|
||||
// Values are useful only for debugging, anyway since upper words of pointers
|
||||
@ -689,8 +688,8 @@ bool_t xdr_protocol(XDR* xdrs, PACKET* p)
|
||||
reinterpret_cast<SSHORT&>(prep_stmt->p_sqlst_statement));
|
||||
MAP(xdr_short,
|
||||
reinterpret_cast<SSHORT&>(prep_stmt->p_sqlst_SQL_dialect));
|
||||
MAP(xdr_cstring, prep_stmt->p_sqlst_SQL_str);
|
||||
MAP(xdr_cstring, prep_stmt->p_sqlst_items);
|
||||
MAP(xdr_cstring_const, prep_stmt->p_sqlst_SQL_str);
|
||||
MAP(xdr_cstring_const, prep_stmt->p_sqlst_items);
|
||||
MAP(xdr_short,
|
||||
reinterpret_cast<SSHORT&>(prep_stmt->p_sqlst_buffer_length));
|
||||
DEBUG_PRINTSIZE(xdrs, p->p_operation);
|
||||
@ -761,7 +760,7 @@ bool_t xdr_protocol(XDR* xdrs, PACKET* p)
|
||||
sqlcur = &p->p_sqlcur;
|
||||
MAP(xdr_short,
|
||||
reinterpret_cast<SSHORT&>(sqlcur->p_sqlcur_statement));
|
||||
MAP(xdr_cstring, sqlcur->p_sqlcur_cursor_name);
|
||||
MAP(xdr_cstring_const, sqlcur->p_sqlcur_cursor_name);
|
||||
MAP(xdr_short, reinterpret_cast<SSHORT&>(sqlcur->p_sqlcur_type));
|
||||
DEBUG_PRINTSIZE(xdrs, p->p_operation);
|
||||
return P_TRUE(xdrs, p);
|
||||
@ -779,7 +778,7 @@ bool_t xdr_protocol(XDR* xdrs, PACKET* p)
|
||||
case op_update_account_info:
|
||||
{
|
||||
p_update_account *stuff = &p->p_account_update;
|
||||
MAP(xdr_short, reinterpret_cast < SSHORT & >(stuff->p_account_database));
|
||||
MAP(xdr_short, reinterpret_cast<SSHORT&>(stuff->p_account_database));
|
||||
MAP(xdr_cstring_const, stuff->p_account_apb);
|
||||
DEBUG_PRINTSIZE(xdrs, p->p_operation);
|
||||
|
||||
@ -789,10 +788,10 @@ bool_t xdr_protocol(XDR* xdrs, PACKET* p)
|
||||
case op_authenticate_user:
|
||||
{
|
||||
p_authenticate *stuff = &p->p_authenticate_user;
|
||||
MAP(xdr_short, reinterpret_cast < SSHORT & >(stuff->p_auth_database));
|
||||
MAP(xdr_short, reinterpret_cast<SSHORT&>(stuff->p_auth_database));
|
||||
MAP(xdr_cstring_const, stuff->p_auth_dpb);
|
||||
MAP(xdr_cstring, stuff->p_auth_items);
|
||||
MAP(xdr_short, reinterpret_cast < SSHORT & >(stuff->p_auth_buffer_length));
|
||||
MAP(xdr_short, reinterpret_cast<SSHORT&>(stuff->p_auth_buffer_length));
|
||||
DEBUG_PRINTSIZE(xdrs, p->p_operation);
|
||||
|
||||
return P_TRUE(xdrs, p);
|
||||
@ -1221,9 +1220,7 @@ static bool_t xdr_longs( XDR* xdrs, CSTRING* cstring)
|
||||
* Pass a vector of longs.
|
||||
*
|
||||
**************************************/
|
||||
if (!xdr_short
|
||||
(xdrs,
|
||||
reinterpret_cast<SSHORT*>(&cstring->cstr_length)))
|
||||
if (!xdr_short(xdrs, reinterpret_cast<SSHORT*>(&cstring->cstr_length)))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@ -1435,8 +1432,7 @@ static bool_t xdr_slice(
|
||||
}
|
||||
|
||||
slice->lstr_allocated = slice->lstr_length;
|
||||
DEBUG_XDR_ALLOC(xdrs, slice, slice->lstr_address,
|
||||
slice->lstr_allocated);
|
||||
DEBUG_XDR_ALLOC(xdrs, slice, slice->lstr_address, slice->lstr_allocated);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1710,7 +1706,7 @@ static bool_t xdr_status_vector(
|
||||
}
|
||||
|
||||
|
||||
static bool_t xdr_trrq_blr( XDR* xdrs, CSTRING* blr)
|
||||
static bool_t xdr_trrq_blr(XDR* xdrs, CSTRING* blr)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1732,9 +1728,9 @@ static bool_t xdr_trrq_blr( XDR* xdrs, CSTRING* blr)
|
||||
return TRUE;
|
||||
|
||||
rem_port* port = (rem_port*) xdrs->x_public;
|
||||
RPR procedure = port->port_rpr;
|
||||
Rpr* procedure = port->port_rpr;
|
||||
if (!procedure)
|
||||
procedure = port->port_rpr = new rpr;
|
||||
procedure = port->port_rpr = new Rpr;
|
||||
|
||||
/* Parse the blr describing the message. */
|
||||
|
||||
@ -1799,7 +1795,7 @@ static bool_t xdr_trrq_message( XDR* xdrs, USHORT msg_type)
|
||||
return TRUE;
|
||||
|
||||
rem_port* port = (rem_port*) xdrs->x_public;
|
||||
RPR procedure = port->port_rpr;
|
||||
Rpr* procedure = port->port_rpr;
|
||||
|
||||
if (msg_type == 1)
|
||||
return xdr_message(xdrs, procedure->rpr_out_msg,
|
||||
|
@ -180,23 +180,23 @@ typedef enum
|
||||
op_exit = 2, /* Remote end has exitted */
|
||||
op_accept = 3, /* Server accepts connection */
|
||||
op_reject = 4, /* Server rejects connection */
|
||||
op_protocol = 5, /* Protocol selection */
|
||||
//op_protocol = 5, /* Protocol selection */
|
||||
op_disconnect = 6, /* Connect is going away */
|
||||
op_credit = 7, /* Grant (buffer) credits */
|
||||
op_continuation = 8, /* Continuation packet */
|
||||
//op_credit = 7, /* Grant (buffer) credits */
|
||||
//op_continuation = 8, /* Continuation packet */
|
||||
op_response = 9, /* Generic response block */
|
||||
|
||||
/* Page server operations */
|
||||
|
||||
op_open_file = 10, /* Open file for page service */
|
||||
op_create_file = 11, /* Create file for page service */
|
||||
op_close_file = 12, /* Close file for page service */
|
||||
op_read_page = 13, /* optionally lock and read page */
|
||||
op_write_page = 14, /* write page and optionally release lock */
|
||||
op_lock = 15, /* sieze lock */
|
||||
op_convert_lock = 16, /* convert existing lock */
|
||||
op_release_lock = 17, /* release existing lock */
|
||||
op_blocking = 18, /* blocking lock message */
|
||||
//op_open_file = 10, /* Open file for page service */
|
||||
//op_create_file = 11, /* Create file for page service */
|
||||
//op_close_file = 12, /* Close file for page service */
|
||||
//op_read_page = 13, /* optionally lock and read page */
|
||||
//op_write_page = 14, /* write page and optionally release lock */
|
||||
//op_lock = 15, /* seize lock */
|
||||
//op_convert_lock = 16, /* convert existing lock */
|
||||
//op_release_lock = 17, /* release existing lock */
|
||||
//op_blocking = 18, /* blocking lock message */
|
||||
|
||||
/* Full context server operations */
|
||||
|
||||
@ -208,7 +208,7 @@ typedef enum
|
||||
op_start_and_send = 24,
|
||||
op_send = 25,
|
||||
op_receive = 26,
|
||||
op_unwind = 27,
|
||||
op_unwind = 27, // apparently unused, see protocol.cpp's case op_unwind
|
||||
op_release = 28,
|
||||
|
||||
op_transaction = 29, /* Transaction operations */
|
||||
@ -231,9 +231,9 @@ typedef enum
|
||||
|
||||
op_batch_segments = 44, /* Put a bunch of blob segments */
|
||||
|
||||
op_mgr_set_affinity = 45, /* Establish server affinity */
|
||||
op_mgr_clear_affinity = 46, /* Break server affinity */
|
||||
op_mgr_report = 47, /* Report on server */
|
||||
//op_mgr_set_affinity = 45, /* Establish server affinity */
|
||||
//op_mgr_clear_affinity = 46, /* Break server affinity */
|
||||
//op_mgr_report = 47, /* Report on server */
|
||||
|
||||
op_que_events = 48, /* Que event notification request */
|
||||
op_cancel_events = 49, /* Cancel event notification request */
|
||||
@ -344,9 +344,9 @@ typedef struct p_cnct
|
||||
P_OP p_cnct_operation; /* OP_CREATE or OP_OPEN */
|
||||
USHORT p_cnct_cversion; /* Version of connect protocol */
|
||||
P_ARCH p_cnct_client; /* Architecture of client */
|
||||
CSTRING p_cnct_file; /* File name */
|
||||
CSTRING_CONST p_cnct_file; /* File name */
|
||||
USHORT p_cnct_count; /* Protocol versions understood */
|
||||
CSTRING p_cnct_user_id; /* User identification stuff */
|
||||
CSTRING_CONST p_cnct_user_id; /* User identification stuff */
|
||||
struct p_cnct_repeat
|
||||
{
|
||||
USHORT p_cnct_version; /* Protocol version number */
|
||||
@ -421,8 +421,8 @@ typedef struct p_resp
|
||||
typedef struct p_atch
|
||||
{
|
||||
OBJCT p_atch_database; /* Database object id */
|
||||
CSTRING p_atch_file; /* File name */
|
||||
CSTRING p_atch_dpb; /* Database parameter block */
|
||||
CSTRING_CONST p_atch_file; /* File name */
|
||||
CSTRING_CONST p_atch_dpb; /* Database parameter block */
|
||||
} P_ATCH;
|
||||
|
||||
/* Compile request */
|
||||
@ -430,7 +430,7 @@ typedef struct p_atch
|
||||
typedef struct p_cmpl
|
||||
{
|
||||
OBJCT p_cmpl_database; /* Database object id */
|
||||
CSTRING p_cmpl_blr; /* Request blr */
|
||||
CSTRING_CONST p_cmpl_blr; /* Request blr */
|
||||
} P_CMPL;
|
||||
|
||||
/* Start Transaction */
|
||||
@ -438,7 +438,7 @@ typedef struct p_cmpl
|
||||
typedef struct p_sttr
|
||||
{
|
||||
OBJCT p_sttr_database; /* Database object id */
|
||||
CSTRING p_sttr_tpb; /* Transaction parameter block */
|
||||
CSTRING_CONST p_sttr_tpb; /* Transaction parameter block */
|
||||
} P_STTR;
|
||||
|
||||
/* Generic release block */
|
||||
@ -498,8 +498,8 @@ typedef struct p_seek {
|
||||
typedef struct p_info {
|
||||
OBJCT p_info_object; /* Object of information */
|
||||
USHORT p_info_incarnation; /* Incarnation of object */
|
||||
CSTRING p_info_items; /* Information */
|
||||
CSTRING p_info_recv_items; /* Receive information */
|
||||
CSTRING_CONST p_info_items; /* Information */
|
||||
CSTRING_CONST p_info_recv_items; /* Receive information */
|
||||
USHORT p_info_buffer_length; /* Target buffer length */
|
||||
} P_INFO;
|
||||
|
||||
@ -507,7 +507,7 @@ typedef struct p_info {
|
||||
|
||||
typedef struct p_event {
|
||||
OBJCT p_event_database; /* Database object id */
|
||||
CSTRING p_event_items; /* Event description block */
|
||||
CSTRING_CONST p_event_items; /* Event description block */
|
||||
FPTR_EVENT_CALLBACK p_event_ast; /* Address of ast routine */
|
||||
SLONG p_event_arg; /* Argument to ast routine */
|
||||
SLONG p_event_rid; /* Client side id of remote event */
|
||||
@ -517,7 +517,7 @@ typedef struct p_event {
|
||||
|
||||
typedef struct p_prep {
|
||||
OBJCT p_prep_transaction;
|
||||
CSTRING p_prep_data;
|
||||
CSTRING_CONST p_prep_data;
|
||||
} P_PREP;
|
||||
|
||||
/* Connect request block */
|
||||
@ -555,7 +555,7 @@ typedef struct p_slc {
|
||||
typedef struct p_slr {
|
||||
lstring p_slr_slice; /* Slice proper */
|
||||
ULONG p_slr_length; /* Total length of slice */
|
||||
UCHAR *p_slr_sdl; /* *** not transfered *** */
|
||||
UCHAR* p_slr_sdl; /* *** not transfered *** */
|
||||
USHORT p_slr_sdl_length; /* *** not transfered *** */
|
||||
} P_SLR;
|
||||
|
||||
@ -565,9 +565,10 @@ typedef struct p_sqlst {
|
||||
OBJCT p_sqlst_transaction; /* transaction object */
|
||||
OBJCT p_sqlst_statement; /* statement object */
|
||||
USHORT p_sqlst_SQL_dialect; /* the SQL dialect */
|
||||
CSTRING p_sqlst_SQL_str; /* statement to be prepared */
|
||||
CSTRING_CONST p_sqlst_SQL_str; /* statement to be prepared */
|
||||
USHORT p_sqlst_buffer_length; /* Target buffer length */
|
||||
CSTRING p_sqlst_items; /* Information */
|
||||
CSTRING_CONST p_sqlst_items; /* Information */
|
||||
// This should be CSTRING_CONST
|
||||
CSTRING p_sqlst_blr; /* blr describing message */
|
||||
USHORT p_sqlst_message_number;
|
||||
USHORT p_sqlst_messages; /* Number of messages */
|
||||
@ -578,6 +579,7 @@ typedef struct p_sqlst {
|
||||
typedef struct p_sqldata {
|
||||
OBJCT p_sqldata_statement; /* statement object */
|
||||
OBJCT p_sqldata_transaction; /* transaction object */
|
||||
// This should be CSTRING_CONST, but fetch() has strange behavior.
|
||||
CSTRING p_sqldata_blr; /* blr describing message */
|
||||
USHORT p_sqldata_message_number;
|
||||
USHORT p_sqldata_messages; /* Number of messages */
|
||||
@ -593,7 +595,7 @@ typedef struct p_sqlfree {
|
||||
|
||||
typedef struct p_sqlcur {
|
||||
OBJCT p_sqlcur_statement; /* statement object */
|
||||
CSTRING p_sqlcur_cursor_name; /* cursor name */
|
||||
CSTRING_CONST p_sqlcur_cursor_name; /* cursor name */
|
||||
USHORT p_sqlcur_type; /* type of cursor */
|
||||
} P_SQLCUR;
|
||||
|
||||
|
@ -53,7 +53,7 @@ static TEXT* attach_failures_ptr;
|
||||
static void cleanup_memory(void*);
|
||||
|
||||
|
||||
void REMOTE_cleanup_transaction( RTR transaction)
|
||||
void REMOTE_cleanup_transaction( Rtr* transaction)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -164,7 +164,7 @@ const USHORT MIN_PACKETS_PER_BATCH = 2; /* packets - picked by SWAG */
|
||||
const USHORT DESIRED_ROWS_PER_BATCH = 20; /* data rows - picked by SWAG */
|
||||
const USHORT MIN_ROWS_PER_BATCH = 10; /* data rows - picked by SWAG */
|
||||
|
||||
USHORT op_overhead = (USHORT) xdr_protocol_overhead(op_code);
|
||||
const USHORT op_overhead = (USHORT) xdr_protocol_overhead(op_code);
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr,
|
||||
@ -176,24 +176,22 @@ const USHORT MIN_ROWS_PER_BATCH = 10; /* data rows - picked by SWAG */
|
||||
ULONG row_size;
|
||||
if (port->port_flags & PORT_symmetric) {
|
||||
/* Same architecture connection */
|
||||
row_size = (ROUNDUP(format->fmt_length, 4)
|
||||
+ op_overhead);
|
||||
row_size = (ROUNDUP(format->fmt_length, 4) + op_overhead);
|
||||
}
|
||||
else {
|
||||
/* Using XDR for data transfer */
|
||||
row_size = (ROUNDUP(format->fmt_net_length, 4)
|
||||
+ op_overhead);
|
||||
row_size = (ROUNDUP(format->fmt_net_length, 4) + op_overhead);
|
||||
}
|
||||
|
||||
USHORT num_packets = (USHORT) (((DESIRED_ROWS_PER_BATCH * row_size) /* data set */
|
||||
+ buffer_used /* used in 1st pkt */
|
||||
+ (port->port_buff_size - 1)) /* to round up */
|
||||
/port->port_buff_size);
|
||||
/ port->port_buff_size);
|
||||
if (num_packets > MAX_PACKETS_PER_BATCH) {
|
||||
num_packets = (USHORT) (((MIN_ROWS_PER_BATCH * row_size) /* data set */
|
||||
+ buffer_used /* used in 1st pkt */
|
||||
+ (port->port_buff_size - 1)) /* to round up */
|
||||
/port->port_buff_size);
|
||||
/ port->port_buff_size);
|
||||
}
|
||||
num_packets = MAX(num_packets, MIN_PACKETS_PER_BATCH);
|
||||
|
||||
@ -299,7 +297,7 @@ void REMOTE_free_packet( rem_port* port, PACKET * packet, bool partial)
|
||||
USHORT n;
|
||||
|
||||
if (packet) {
|
||||
xdrmem_create(&xdr, reinterpret_cast < char *>(packet),
|
||||
xdrmem_create(&xdr, reinterpret_cast<char*>(packet),
|
||||
sizeof(PACKET), XDR_FREE);
|
||||
xdr.x_public = (caddr_t) port;
|
||||
|
||||
@ -427,7 +425,7 @@ void REMOTE_release_request( Rrq* request)
|
||||
* Release a request block and friends.
|
||||
*
|
||||
**************************************/
|
||||
RDB rdb = request->rrq_rdb;
|
||||
Rdb* rdb = request->rrq_rdb;
|
||||
|
||||
for (Rrq** p = &rdb->rdb_requests; *p; p = &(*p)->rrq_next)
|
||||
{
|
||||
|
@ -85,7 +85,7 @@ struct rem_port;
|
||||
typedef Firebird::AutoPtr<UCHAR, Firebird::ArrayDelete<UCHAR> > UCharArrayAutoPtr;
|
||||
|
||||
|
||||
typedef struct Rdb : public Firebird::GlobalStorage, public TypedHandle<rem_type_rdb>
|
||||
struct Rdb : public Firebird::GlobalStorage, public TypedHandle<rem_type_rdb>
|
||||
{
|
||||
USHORT rdb_id;
|
||||
USHORT rdb_flags;
|
||||
@ -93,7 +93,7 @@ typedef struct Rdb : public Firebird::GlobalStorage, public TypedHandle<rem_type
|
||||
rem_port* rdb_port; /* communication port */
|
||||
struct Rtr* rdb_transactions; /* linked list of transactions */
|
||||
struct Rrq* rdb_requests; /* compiled requests */
|
||||
struct rvnt* rdb_events; /* known events */
|
||||
struct Rvnt* rdb_events; /* known events */
|
||||
struct Rsr* rdb_sql_requests; /* SQL requests */
|
||||
ISC_STATUS* rdb_status_vector;
|
||||
PACKET rdb_packet; /* Communication structure */
|
||||
@ -112,10 +112,10 @@ public:
|
||||
}
|
||||
|
||||
static ISC_STATUS badHandle() { return isc_bad_db_handle; }
|
||||
} *RDB;
|
||||
};
|
||||
|
||||
|
||||
typedef struct Rtr : public Firebird::GlobalStorage, public TypedHandle<rem_type_rtr>
|
||||
struct Rtr : public Firebird::GlobalStorage, public TypedHandle<rem_type_rtr>
|
||||
{
|
||||
Rdb* rtr_rdb;
|
||||
Rtr* rtr_next;
|
||||
@ -131,10 +131,10 @@ public:
|
||||
{ }
|
||||
|
||||
static ISC_STATUS badHandle() { return isc_bad_trans_handle; }
|
||||
} *RTR;
|
||||
};
|
||||
|
||||
|
||||
typedef struct Rbl : public Firebird::GlobalStorage, public TypedHandle<rem_type_rbl>
|
||||
struct Rbl : public Firebird::GlobalStorage, public TypedHandle<rem_type_rbl>
|
||||
{
|
||||
Firebird::HalfStaticArray<UCHAR, BLOB_LENGTH> rbl_data;
|
||||
Rdb* rbl_rdb;
|
||||
@ -170,12 +170,12 @@ public:
|
||||
{ }
|
||||
|
||||
static ISC_STATUS badHandle() { return isc_bad_segstr_handle; }
|
||||
} *RBL;
|
||||
};
|
||||
|
||||
|
||||
typedef struct rvnt : public Firebird::GlobalStorage
|
||||
struct Rvnt : public Firebird::GlobalStorage
|
||||
{
|
||||
rvnt* rvnt_next;
|
||||
Rvnt* rvnt_next;
|
||||
Rdb* rvnt_rdb;
|
||||
FPTR_EVENT_CALLBACK rvnt_ast;
|
||||
void* rvnt_arg;
|
||||
@ -186,12 +186,12 @@ typedef struct rvnt : public Firebird::GlobalStorage
|
||||
SSHORT rvnt_length;
|
||||
|
||||
public:
|
||||
rvnt() :
|
||||
Rvnt() :
|
||||
rvnt_next(0), rvnt_rdb(0), rvnt_ast(0),
|
||||
rvnt_arg(0), rvnt_id(0), rvnt_rid(0),
|
||||
rvnt_port(0), rvnt_items(0), rvnt_length(0)
|
||||
{ }
|
||||
} *RVNT;
|
||||
};
|
||||
|
||||
|
||||
struct rem_str : public pool_alloc_rpt<SCHAR>
|
||||
@ -251,7 +251,7 @@ public:
|
||||
|
||||
|
||||
// remote stored procedure request
|
||||
typedef struct rpr : public Firebird::GlobalStorage
|
||||
struct Rpr : public Firebird::GlobalStorage
|
||||
{
|
||||
Rdb* rpr_rdb;
|
||||
Rtr* rpr_rtr;
|
||||
@ -262,13 +262,13 @@ typedef struct rpr : public Firebird::GlobalStorage
|
||||
rem_fmt* rpr_out_format; /* Format of output message */
|
||||
|
||||
public:
|
||||
rpr() :
|
||||
Rpr() :
|
||||
rpr_rdb(0), rpr_rtr(0), rpr_handle(0),
|
||||
rpr_in_msg(0), rpr_out_msg(0), rpr_in_format(0), rpr_out_format(0)
|
||||
{ }
|
||||
|
||||
//ISC_STATUS badHandle() { return ; }
|
||||
} *RPR;
|
||||
};
|
||||
|
||||
struct Rrq : public Firebird::GlobalStorage, public TypedHandle<rem_type_rrq>
|
||||
{
|
||||
@ -344,11 +344,13 @@ public:
|
||||
explicit RFlags(const T flags) :
|
||||
m_flags(flags)
|
||||
{}
|
||||
// At least one bit in the parameter is 1 in the object.
|
||||
bool test(const T flags) const
|
||||
{
|
||||
return m_flags & flags;
|
||||
}
|
||||
bool testExact(const T flags) const
|
||||
// All bits received as parameter are 1 in the object.
|
||||
bool testAll(const T flags) const
|
||||
{
|
||||
return (m_flags & flags) == flags;
|
||||
}
|
||||
@ -630,7 +632,7 @@ struct rem_port : public Firebird::GlobalStorage, public Firebird::RefCounted
|
||||
rem_str* port_passwd;
|
||||
rem_str* port_protocol_str; // String containing protocol name for this port
|
||||
rem_str* port_address_str; // Protocol-specific address string for the port
|
||||
rpr* port_rpr; /* port stored procedure reference */
|
||||
Rpr* port_rpr; /* port stored procedure reference */
|
||||
Rsr* port_statement; /* Statement for execute immediate */
|
||||
rmtque* port_receive_rmtque; /* for client, responses waiting */
|
||||
USHORT port_requests_queued; /* requests currently queued */
|
||||
@ -742,7 +744,7 @@ public:
|
||||
transferred by the remote protocol. */
|
||||
if (id > MAX_OBJCT_HANDLES)
|
||||
{
|
||||
return (OBJCT)0;
|
||||
return (OBJCT) 0;
|
||||
}
|
||||
|
||||
port_objects.grow(id + 1);
|
||||
|
@ -138,17 +138,17 @@ static REM_MSG dump_cache(Rrq::rrq_repeat*);
|
||||
#endif
|
||||
|
||||
static bool get_next_msg_no(Rrq*, USHORT, USHORT*);
|
||||
static RTR make_transaction(RDB, FB_API_HANDLE);
|
||||
static Rtr* make_transaction(Rdb*, FB_API_HANDLE);
|
||||
static bool process_packet(rem_port* port,
|
||||
PACKET* sendL,
|
||||
PACKET* receive,
|
||||
rem_port** result);
|
||||
static void release_blob(RBL);
|
||||
static void release_event(RVNT);
|
||||
static void release_blob(Rbl*);
|
||||
static void release_event(Rvnt*);
|
||||
static void release_request(Rrq*);
|
||||
static void release_statement(Rsr**);
|
||||
static void release_sql_request(Rsr*);
|
||||
static void release_transaction(RTR);
|
||||
static void release_transaction(Rtr*);
|
||||
|
||||
#ifdef SCROLLABLE_CURSORS
|
||||
static REM_MSG scroll_cache(Rrq::rrq_repeat*, USHORT *, ULONG *);
|
||||
@ -160,15 +160,15 @@ static void success(ISC_STATUS*);
|
||||
static THREAD_ENTRY_DECLARE loopThread(THREAD_ENTRY_PARAM);
|
||||
static void zap_packet(PACKET*, bool);
|
||||
|
||||
static bool bad_port_context(ISC_STATUS*, RDB, const ISC_LONG);
|
||||
static bool bad_port_context(ISC_STATUS*, Rdb*, const ISC_LONG);
|
||||
|
||||
|
||||
inline bool bad_db(ISC_STATUS* status_vector, RDB rdb)
|
||||
inline bool bad_db(ISC_STATUS* status_vector, Rdb* rdb)
|
||||
{
|
||||
return bad_port_context(status_vector, rdb, isc_bad_db_handle);
|
||||
}
|
||||
|
||||
inline bool bad_service(ISC_STATUS* status_vector, RDB rdb)
|
||||
inline bool bad_service(ISC_STATUS* status_vector, Rdb* rdb)
|
||||
{
|
||||
return bad_port_context(status_vector, rdb, isc_bad_svc_handle);
|
||||
}
|
||||
@ -759,7 +759,7 @@ static ISC_STATUS allocate_statement( rem_port* port, P_RLSE * allocate, PACKET*
|
||||
**************************************/
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
|
||||
RDB rdb = port->port_context;
|
||||
Rdb* rdb = port->port_context;
|
||||
|
||||
if (bad_db(status_vector, rdb))
|
||||
{
|
||||
@ -1057,7 +1057,7 @@ static void attach_database2(rem_port* port,
|
||||
|
||||
if (!status_vector[1])
|
||||
{
|
||||
RDB rdb = new Rdb;
|
||||
Rdb* rdb = new Rdb;
|
||||
if (rdb)
|
||||
{
|
||||
port->port_context = rdb;
|
||||
@ -1136,7 +1136,7 @@ static void aux_request( rem_port* port, P_REQ * request, PACKET* send)
|
||||
send->p_resp.p_resp_data.cstr_address = buffer;
|
||||
|
||||
rem_port* aux_port = port->request(send);
|
||||
RDB rdb = port->port_context;
|
||||
Rdb* rdb = port->port_context;
|
||||
if (bad_db(status_vector, rdb))
|
||||
{
|
||||
// who has any idea what else to do with such attempt
|
||||
@ -1181,7 +1181,7 @@ static ISC_STATUS cancel_events( rem_port* port, P_EVENT * stuff, PACKET* send)
|
||||
|
||||
/* Which database ? */
|
||||
|
||||
RDB rdb = port->port_context;
|
||||
Rdb* rdb = port->port_context;
|
||||
if (bad_db(status_vector, rdb))
|
||||
{
|
||||
return port->send_response(send, 0, 0, status_vector, false);
|
||||
@ -1189,7 +1189,7 @@ static ISC_STATUS cancel_events( rem_port* port, P_EVENT * stuff, PACKET* send)
|
||||
|
||||
/* Find the event */
|
||||
|
||||
RVNT event;
|
||||
Rvnt* event;
|
||||
for (event = rdb->rdb_events; event; event = event->rvnt_next)
|
||||
{
|
||||
if (event->rvnt_rid == stuff->p_event_rid)
|
||||
@ -1234,7 +1234,7 @@ static void cancel_operation( rem_port* port)
|
||||
* able to be canceled.
|
||||
*
|
||||
**************************************/
|
||||
RDB rdb;
|
||||
Rdb* rdb;
|
||||
if ((port->port_flags & (PORT_async | PORT_disconnect)) ||
|
||||
!(rdb = port->port_context))
|
||||
{
|
||||
@ -1350,7 +1350,7 @@ ISC_STATUS rem_port::compile(P_CMPL* compileL, PACKET* sendL)
|
||||
**************************************/
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
|
||||
RDB rdb = this->port_context;
|
||||
Rdb* rdb = this->port_context;
|
||||
if (bad_db(status_vector, rdb))
|
||||
{
|
||||
return this->send_response(sendL, 0, 0, status_vector, false);
|
||||
@ -1434,11 +1434,11 @@ ISC_STATUS rem_port::ddl(P_DDL* ddlL, PACKET* sendL)
|
||||
*
|
||||
**************************************/
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
RTR transaction;
|
||||
Rtr* transaction;
|
||||
|
||||
getHandle(transaction, ddlL->p_ddl_transaction);
|
||||
|
||||
RDB rdb = this->port_context;
|
||||
Rdb* rdb = this->port_context;
|
||||
if (bad_db(status_vector, rdb))
|
||||
{
|
||||
return this->send_response(sendL, 0, 0, status_vector, false);
|
||||
@ -1466,7 +1466,7 @@ void rem_port::disconnect(PACKET* sendL, PACKET* receiveL)
|
||||
* We've lost the connection to the parent. Stop everything.
|
||||
*
|
||||
**************************************/
|
||||
RDB rdb = this->port_context;
|
||||
Rdb* rdb = this->port_context;
|
||||
|
||||
if (this->port_flags & PORT_async)
|
||||
{
|
||||
@ -1521,7 +1521,7 @@ void rem_port::disconnect(PACKET* sendL, PACKET* receiveL)
|
||||
release_request(rdb->rdb_requests);
|
||||
while (rdb->rdb_sql_requests)
|
||||
release_sql_request(rdb->rdb_sql_requests);
|
||||
RTR transaction;
|
||||
Rtr* transaction;
|
||||
while (transaction = rdb->rdb_transactions) {
|
||||
if (!transaction->rtr_limbo)
|
||||
isc_rollback_transaction(status_vector, &transaction->rtr_handle);
|
||||
@ -1622,7 +1622,7 @@ void rem_port::drop_database(P_RLSE* release, PACKET* sendL)
|
||||
**************************************/
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
|
||||
RDB rdb = this->port_context;
|
||||
Rdb* rdb = this->port_context;
|
||||
if (bad_db(status_vector, rdb))
|
||||
{
|
||||
this->send_response(sendL, 0, 0, status_vector, false);
|
||||
@ -1698,7 +1698,7 @@ ISC_STATUS rem_port::end_blob(P_OP operation, P_RLSE * release, PACKET* sendL)
|
||||
* End a blob.
|
||||
*
|
||||
**************************************/
|
||||
RBL blob;
|
||||
Rbl* blob;
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
|
||||
getHandle(blob, release->p_rlse_object);
|
||||
@ -1730,7 +1730,7 @@ ISC_STATUS rem_port::end_database(P_RLSE * release, PACKET* sendL)
|
||||
**************************************/
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
|
||||
RDB rdb = this->port_context;
|
||||
Rdb* rdb = this->port_context;
|
||||
if (bad_db(status_vector, rdb))
|
||||
{
|
||||
return this->send_response(sendL, 0, 0, status_vector, false);
|
||||
@ -1839,7 +1839,7 @@ ISC_STATUS rem_port::end_transaction(P_OP operation, P_RLSE * release, PACKET* s
|
||||
* End a transaction.
|
||||
*
|
||||
**************************************/
|
||||
RTR transaction;
|
||||
Rtr* transaction;
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
|
||||
getHandle(transaction, release->p_rlse_object);
|
||||
@ -1890,12 +1890,12 @@ ISC_STATUS rem_port::execute_immediate(P_OP op, P_SQLST * exnow, PACKET* sendL)
|
||||
* process an execute immediate DSQL packet
|
||||
*
|
||||
*****************************************/
|
||||
RTR transaction = NULL;
|
||||
Rtr* transaction = NULL;
|
||||
USHORT in_blr_length, in_msg_type, parser_version,
|
||||
out_blr_length, out_msg_type;
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
|
||||
RDB rdb = this->port_context;
|
||||
Rdb* rdb = this->port_context;
|
||||
if (bad_db(status_vector, rdb))
|
||||
{
|
||||
return this->send_response(sendL, 0, 0, status_vector, false);
|
||||
@ -2033,7 +2033,7 @@ ISC_STATUS rem_port::execute_statement(P_OP op, P_SQLDATA* sqldata, PACKET* send
|
||||
* Execute a non-SELECT dynamic SQL statement.
|
||||
*
|
||||
*****************************************/
|
||||
RTR transaction = NULL;
|
||||
Rtr* transaction = NULL;
|
||||
|
||||
/** Do not call CHECK_HANDLE if this is the start of a transaction **/
|
||||
if (sqldata->p_sqldata_transaction)
|
||||
@ -2466,7 +2466,7 @@ ISC_STATUS rem_port::get_segment(P_SGMT* segment, PACKET* sendL)
|
||||
* Get a single blob segment.
|
||||
*
|
||||
**************************************/
|
||||
RBL blob;
|
||||
Rbl* blob;
|
||||
|
||||
getHandle(blob, segment->p_sgmt_blob);
|
||||
|
||||
@ -2569,10 +2569,10 @@ ISC_STATUS rem_port::get_slice(P_SLC * stuff, PACKET* sendL)
|
||||
* Get an array slice.
|
||||
*
|
||||
**************************************/
|
||||
RTR transaction;
|
||||
Rtr* transaction;
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
|
||||
RDB rdb = this->port_context;
|
||||
Rdb* rdb = this->port_context;
|
||||
if (bad_db(status_vector, rdb))
|
||||
{
|
||||
return this->send_response(sendL, 0, 0, status_vector, false);
|
||||
@ -2619,7 +2619,7 @@ ISC_STATUS rem_port::get_slice(P_SLC * stuff, PACKET* sendL)
|
||||
}
|
||||
|
||||
|
||||
ISC_STATUS rem_port::info(P_OP op, P_INFO * stuff, PACKET* sendL)
|
||||
ISC_STATUS rem_port::info(P_OP op, P_INFO* stuff, PACKET* sendL)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2632,12 +2632,9 @@ ISC_STATUS rem_port::info(P_OP op, P_INFO * stuff, PACKET* sendL)
|
||||
* statement, or transaction.
|
||||
*
|
||||
**************************************/
|
||||
RBL blob;
|
||||
RTR transaction;
|
||||
Rsr* statement;
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
|
||||
RDB rdb = this->port_context;
|
||||
Rdb* rdb = this->port_context;
|
||||
if (bad_db(status_vector, rdb))
|
||||
{
|
||||
return this->send_response(sendL, 0, 0, status_vector, false);
|
||||
@ -2662,8 +2659,8 @@ ISC_STATUS rem_port::info(P_OP op, P_INFO * stuff, PACKET* sendL)
|
||||
else
|
||||
{
|
||||
// stuff isc_info_length in front of info items buffer
|
||||
|
||||
CSTRING* info_string = (op == op_service_info) ?
|
||||
|
||||
CSTRING_CONST* info_string = (op == op_service_info) ?
|
||||
&stuff->p_info_recv_items : &stuff->p_info_items;
|
||||
|
||||
info_len = 1 + info_string->cstr_length;
|
||||
@ -2673,6 +2670,10 @@ ISC_STATUS rem_port::info(P_OP op, P_INFO * stuff, PACKET* sendL)
|
||||
memmove(info_buffer + 1, info_string->cstr_address, info_len - 1);
|
||||
}
|
||||
|
||||
Rbl* blob;
|
||||
Rtr* transaction;
|
||||
Rsr* statement;
|
||||
|
||||
USHORT info_db_len = 0;
|
||||
switch (op) {
|
||||
case op_info_blob:
|
||||
@ -2721,7 +2722,7 @@ ISC_STATUS rem_port::info(P_OP op, P_INFO * stuff, PACKET* sendL)
|
||||
info_len,
|
||||
info_buffer,
|
||||
stuff->p_info_buffer_length,
|
||||
reinterpret_cast < char *>(buffer));
|
||||
reinterpret_cast<char*>(buffer));
|
||||
break;
|
||||
|
||||
case op_service_info:
|
||||
@ -2729,8 +2730,7 @@ ISC_STATUS rem_port::info(P_OP op, P_INFO * stuff, PACKET* sendL)
|
||||
&rdb->rdb_handle,
|
||||
NULL,
|
||||
stuff->p_info_items.cstr_length,
|
||||
reinterpret_cast<
|
||||
const char*>(stuff->p_info_items.cstr_address),
|
||||
reinterpret_cast<const char*>(stuff->p_info_items.cstr_address),
|
||||
info_len,
|
||||
info_buffer,
|
||||
stuff->p_info_buffer_length,
|
||||
@ -2745,14 +2745,13 @@ ISC_STATUS rem_port::info(P_OP op, P_INFO * stuff, PACKET* sendL)
|
||||
info_len,
|
||||
info_buffer,
|
||||
stuff->p_info_buffer_length,
|
||||
reinterpret_cast < char *>(buffer));
|
||||
reinterpret_cast<char*>(buffer));
|
||||
break;
|
||||
}
|
||||
|
||||
/* Send a response that includes the segment. */
|
||||
|
||||
USHORT response_len =
|
||||
info_db_len ? info_db_len : stuff->p_info_buffer_length;
|
||||
USHORT response_len = info_db_len ? info_db_len : stuff->p_info_buffer_length;
|
||||
|
||||
SSHORT skip_len = 0;
|
||||
if (*buffer == isc_info_length)
|
||||
@ -2816,7 +2815,7 @@ ISC_STATUS rem_port::insert(P_SQLDATA * sqldata, PACKET* sendL)
|
||||
}
|
||||
|
||||
|
||||
static RTR make_transaction (RDB rdb, FB_API_HANDLE handle)
|
||||
static Rtr* make_transaction (Rdb* rdb, FB_API_HANDLE handle)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2828,7 +2827,7 @@ static RTR make_transaction (RDB rdb, FB_API_HANDLE handle)
|
||||
* Create a local transaction handle.
|
||||
*
|
||||
**************************************/
|
||||
RTR transaction = new Rtr;
|
||||
Rtr* transaction = new Rtr;
|
||||
transaction->rtr_rdb = rdb;
|
||||
transaction->rtr_handle = handle;
|
||||
if (transaction->rtr_id = rdb->rdb_port->get_id(transaction))
|
||||
@ -2857,12 +2856,12 @@ ISC_STATUS rem_port::open_blob(P_OP op, P_BLOB* stuff, PACKET* sendL)
|
||||
* Open or create a new blob.
|
||||
*
|
||||
**************************************/
|
||||
RTR transaction;
|
||||
Rtr* transaction;
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
|
||||
getHandle(transaction, stuff->p_blob_transaction);
|
||||
|
||||
RDB rdb = this->port_context;
|
||||
Rdb* rdb = this->port_context;
|
||||
if (bad_db(status_vector, rdb))
|
||||
{
|
||||
return this->send_response(sendL, 0, 0, status_vector, false);
|
||||
@ -2890,7 +2889,7 @@ ISC_STATUS rem_port::open_blob(P_OP op, P_BLOB* stuff, PACKET* sendL)
|
||||
if (status_vector[1])
|
||||
object = 0;
|
||||
else {
|
||||
RBL blob = new Rbl;
|
||||
Rbl* blob = new Rbl;
|
||||
#ifdef DEBUG_REMOTE_MEMORY
|
||||
printf("open_blob(server) allocate blob %x\n", blob);
|
||||
#endif
|
||||
@ -2930,7 +2929,7 @@ ISC_STATUS rem_port::prepare(P_PREP * stuff, PACKET* sendL)
|
||||
* End a transaction.
|
||||
*
|
||||
**************************************/
|
||||
RTR transaction;
|
||||
Rtr* transaction;
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
|
||||
getHandle(transaction, stuff->p_prep_transaction);
|
||||
@ -2958,7 +2957,7 @@ ISC_STATUS rem_port::prepare_statement(P_SQLST * prepareL, PACKET* sendL)
|
||||
* Prepare a dynamic SQL statement for execution.
|
||||
*
|
||||
*****************************************/
|
||||
RTR transaction = NULL;
|
||||
Rtr* transaction = NULL;
|
||||
Rsr* statement;
|
||||
|
||||
/** Do not call CHECK_HANDLE if this is the start of a transaction **/
|
||||
@ -3450,7 +3449,7 @@ ISC_STATUS rem_port::put_segment(P_OP op, P_SGMT * segment, PACKET* sendL)
|
||||
* Write a single blob segment.
|
||||
*
|
||||
**************************************/
|
||||
RBL blob;
|
||||
Rbl* blob;
|
||||
|
||||
getHandle(blob, segment->p_sgmt_blob);
|
||||
|
||||
@ -3499,12 +3498,12 @@ ISC_STATUS rem_port::put_slice(P_SLC * stuff, PACKET* sendL)
|
||||
* Put an array slice.
|
||||
*
|
||||
**************************************/
|
||||
RTR transaction;
|
||||
Rtr* transaction;
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
|
||||
getHandle(transaction, stuff->p_slc_transaction);
|
||||
|
||||
RDB rdb = this->port_context;
|
||||
Rdb* rdb = this->port_context;
|
||||
if (bad_db(status_vector, rdb))
|
||||
{
|
||||
return this->send_response(sendL, 0, 0, status_vector, false);
|
||||
@ -3514,9 +3513,9 @@ ISC_STATUS rem_port::put_slice(P_SLC * stuff, PACKET* sendL)
|
||||
isc_put_slice(status_vector, &rdb->rdb_handle, &transaction->rtr_handle,
|
||||
(ISC_QUAD*) &sendL->p_resp.p_resp_blob_id,
|
||||
stuff->p_slc_sdl.cstr_length,
|
||||
reinterpret_cast<char*>(stuff->p_slc_sdl.cstr_address),
|
||||
reinterpret_cast<const char*>(stuff->p_slc_sdl.cstr_address),
|
||||
stuff->p_slc_parameters.cstr_length,
|
||||
(ISC_LONG *) stuff->p_slc_parameters.cstr_address,
|
||||
(const ISC_LONG*) stuff->p_slc_parameters.cstr_address,
|
||||
stuff->p_slc_slice.lstr_length,
|
||||
stuff->p_slc_slice.lstr_address);
|
||||
|
||||
@ -3537,7 +3536,7 @@ ISC_STATUS rem_port::que_events(P_EVENT * stuff, PACKET* sendL)
|
||||
**************************************/
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
|
||||
RDB rdb = this->port_context;
|
||||
Rdb* rdb = this->port_context;
|
||||
if (bad_db(status_vector, rdb))
|
||||
{
|
||||
return this->send_response(sendL, 0, 0, status_vector, false);
|
||||
@ -3545,7 +3544,7 @@ ISC_STATUS rem_port::que_events(P_EVENT * stuff, PACKET* sendL)
|
||||
|
||||
/* Find unused event block or, if necessary, a new one */
|
||||
|
||||
RVNT event;
|
||||
Rvnt* event;
|
||||
for (event = rdb->rdb_events; event; event = event->rvnt_next) {
|
||||
if (!event->rvnt_id) {
|
||||
break;
|
||||
@ -3554,7 +3553,7 @@ ISC_STATUS rem_port::que_events(P_EVENT * stuff, PACKET* sendL)
|
||||
|
||||
if (!event)
|
||||
{
|
||||
event = new rvnt;
|
||||
event = new Rvnt;
|
||||
#ifdef DEBUG_REMOTE_MEMORY
|
||||
printf("que_events(server) allocate event %x\n", event);
|
||||
#endif
|
||||
@ -3641,11 +3640,9 @@ ISC_STATUS rem_port::receive_after_start( P_DATA* data,
|
||||
{
|
||||
data->p_data_messages =
|
||||
(USHORT) REMOTE_compute_batch_size(this,
|
||||
(USHORT)
|
||||
xdr_protocol_overhead
|
||||
(op_response_piggyback),
|
||||
op_send,
|
||||
format);
|
||||
(USHORT) xdr_protocol_overhead(op_response_piggyback),
|
||||
op_send,
|
||||
format);
|
||||
}
|
||||
|
||||
return this->receive_msg(data, sendL);
|
||||
@ -3924,7 +3921,7 @@ ISC_STATUS rem_port::receive_msg(P_DATA * data, PACKET* sendL)
|
||||
}
|
||||
|
||||
|
||||
static void release_blob(RBL blob)
|
||||
static void release_blob(Rbl* blob)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3936,12 +3933,12 @@ static void release_blob(RBL blob)
|
||||
* Release a blob block and friends.
|
||||
*
|
||||
**************************************/
|
||||
RDB rdb = blob->rbl_rdb;
|
||||
RTR transaction = blob->rbl_rtr;
|
||||
Rdb* rdb = blob->rbl_rdb;
|
||||
Rtr* transaction = blob->rbl_rtr;
|
||||
|
||||
rdb->rdb_port->releaseObject(blob->rbl_id);
|
||||
|
||||
for (RBL* p = &transaction->rtr_blobs; *p; p = &(*p)->rbl_next) {
|
||||
for (Rbl** p = &transaction->rtr_blobs; *p; p = &(*p)->rbl_next) {
|
||||
if (*p == blob) {
|
||||
*p = blob->rbl_next;
|
||||
break;
|
||||
@ -3955,7 +3952,7 @@ static void release_blob(RBL blob)
|
||||
}
|
||||
|
||||
|
||||
static void release_event( RVNT event)
|
||||
static void release_event( Rvnt* event)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3967,9 +3964,9 @@ static void release_event( RVNT event)
|
||||
* Release an event block.
|
||||
*
|
||||
**************************************/
|
||||
RDB rdb = event->rvnt_rdb;
|
||||
Rdb* rdb = event->rvnt_rdb;
|
||||
|
||||
for (RVNT* p = &rdb->rdb_events; *p; p = &(*p)->rvnt_next)
|
||||
for (Rvnt** p = &rdb->rdb_events; *p; p = &(*p)->rvnt_next)
|
||||
{
|
||||
if (*p == event) {
|
||||
*p = event->rvnt_next;
|
||||
@ -3993,7 +3990,7 @@ static void release_request( Rrq* request)
|
||||
* Release a request block.
|
||||
*
|
||||
**************************************/
|
||||
RDB rdb = request->rrq_rdb;
|
||||
Rdb* rdb = request->rrq_rdb;
|
||||
rdb->rdb_port->releaseObject(request->rrq_id);
|
||||
REMOTE_release_request(request);
|
||||
}
|
||||
@ -4034,7 +4031,7 @@ static void release_sql_request( Rsr* statement)
|
||||
* Release an SQL request block.
|
||||
*
|
||||
**************************************/
|
||||
RDB rdb = statement->rsr_rdb;
|
||||
Rdb* rdb = statement->rsr_rdb;
|
||||
rdb->rdb_port->releaseObject(statement->rsr_id);
|
||||
|
||||
for (Rsr** p = &rdb->rdb_sql_requests; *p; p = &(*p)->rsr_next)
|
||||
@ -4049,7 +4046,7 @@ static void release_sql_request( Rsr* statement)
|
||||
}
|
||||
|
||||
|
||||
static void release_transaction( RTR transaction)
|
||||
static void release_transaction( Rtr* transaction)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -4061,13 +4058,13 @@ static void release_transaction( RTR transaction)
|
||||
* Release a transaction block and friends.
|
||||
*
|
||||
**************************************/
|
||||
RDB rdb = transaction->rtr_rdb;
|
||||
Rdb* rdb = transaction->rtr_rdb;
|
||||
rdb->rdb_port->releaseObject(transaction->rtr_id);
|
||||
|
||||
while (transaction->rtr_blobs)
|
||||
release_blob(transaction->rtr_blobs);
|
||||
|
||||
for (RTR* p = &rdb->rdb_transactions; *p; p = &(*p)->rtr_next)
|
||||
for (Rtr** p = &rdb->rdb_transactions; *p; p = &(*p)->rtr_next)
|
||||
{
|
||||
if (*p == transaction) {
|
||||
*p = transaction->rtr_next;
|
||||
@ -4204,7 +4201,7 @@ static REM_MSG scroll_cache(
|
||||
#endif
|
||||
|
||||
|
||||
ISC_STATUS rem_port::seek_blob(P_SEEK * seek, PACKET* sendL)
|
||||
ISC_STATUS rem_port::seek_blob(P_SEEK* seek, PACKET* sendL)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -4216,7 +4213,7 @@ ISC_STATUS rem_port::seek_blob(P_SEEK * seek, PACKET* sendL)
|
||||
* Execute a blob seek operation.
|
||||
*
|
||||
**************************************/
|
||||
RBL blob;
|
||||
Rbl* blob;
|
||||
|
||||
getHandle(blob, seek->p_seek_blob);
|
||||
|
||||
@ -4436,10 +4433,10 @@ static void server_ast(void* event_void, USHORT length, const UCHAR* items)
|
||||
* Send an asynchrous event packet back to client.
|
||||
*
|
||||
**************************************/
|
||||
RVNT event = static_cast<rvnt*>(event_void);
|
||||
Rvnt* event = static_cast<Rvnt*>(event_void);
|
||||
|
||||
event->rvnt_id = 0;
|
||||
RDB rdb = event->rvnt_rdb;
|
||||
Rdb* rdb = event->rvnt_rdb;
|
||||
|
||||
rem_port* port = rdb->rdb_port->port_async;
|
||||
if (!port) {
|
||||
@ -4453,8 +4450,7 @@ static void server_ast(void* event_void, USHORT length, const UCHAR* items)
|
||||
P_EVENT* p_event = &packet.p_event;
|
||||
p_event->p_event_database = rdb->rdb_id;
|
||||
p_event->p_event_items.cstr_length = length;
|
||||
// Probalby should define this item with CSTRING_CONST instead.
|
||||
p_event->p_event_items.cstr_address = const_cast<UCHAR*>(items);
|
||||
p_event->p_event_items.cstr_address = items;
|
||||
|
||||
// Nickolay Samofatov: We keep these values and even pass them to the client
|
||||
// (as 32-bit values) when event is fired, but client ignores them.
|
||||
@ -4613,7 +4609,7 @@ ISC_STATUS rem_port::service_attach(const char* service_name,
|
||||
reinterpret_cast<const char*>(spb.getBuffer()));
|
||||
|
||||
if (!status_vector[1]) {
|
||||
RDB rdb = new Rdb;
|
||||
Rdb* rdb = new Rdb;
|
||||
if (rdb)
|
||||
{
|
||||
this->port_context = rdb;
|
||||
@ -4650,7 +4646,7 @@ ISC_STATUS rem_port::service_end(P_RLSE * release, PACKET* sendL)
|
||||
**************************************/
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
|
||||
RDB rdb = this->port_context;
|
||||
Rdb* rdb = this->port_context;
|
||||
if (bad_service(status_vector, rdb))
|
||||
{
|
||||
return this->send_response(sendL, 0, 0, status_vector, false);
|
||||
@ -4676,7 +4672,7 @@ ISC_STATUS rem_port::service_start(P_INFO * stuff, PACKET* sendL)
|
||||
**************************************/
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
|
||||
RDB rdb = this->port_context;
|
||||
Rdb* rdb = this->port_context;
|
||||
if (bad_service(status_vector, rdb))
|
||||
{
|
||||
return this->send_response(sendL, 0, 0, status_vector, false);
|
||||
@ -4687,7 +4683,7 @@ ISC_STATUS rem_port::service_start(P_INFO * stuff, PACKET* sendL)
|
||||
&rdb->rdb_handle,
|
||||
reserved,
|
||||
stuff->p_info_items.cstr_length,
|
||||
reinterpret_cast<char*>(stuff->p_info_items.cstr_address));
|
||||
reinterpret_cast<const char*>(stuff->p_info_items.cstr_address));
|
||||
|
||||
return this->send_response(sendL, 0, 0, status_vector, false);
|
||||
}
|
||||
@ -4761,7 +4757,7 @@ ISC_STATUS rem_port::start(P_OP operation, P_DATA * data, PACKET* sendL)
|
||||
* Functional description
|
||||
*
|
||||
**************************************/
|
||||
RTR transaction;
|
||||
Rtr* transaction;
|
||||
|
||||
getHandle(transaction, data->p_data_transaction);
|
||||
|
||||
@ -4800,7 +4796,7 @@ ISC_STATUS rem_port::start_and_send(P_OP operation,
|
||||
*
|
||||
**************************************/
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
RTR transaction;
|
||||
Rtr* transaction;
|
||||
getHandle(transaction, data->p_data_transaction);
|
||||
|
||||
Rrq* requestL;
|
||||
@ -4851,7 +4847,7 @@ ISC_STATUS rem_port::start_transaction(P_OP operation, P_STTR * stuff, PACKET* s
|
||||
**************************************/
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
|
||||
RDB rdb = this->port_context;
|
||||
Rdb* rdb = this->port_context;
|
||||
if (bad_db(status_vector, rdb))
|
||||
{
|
||||
return this->send_response(sendL, 0, 0, status_vector, false);
|
||||
@ -4875,7 +4871,7 @@ ISC_STATUS rem_port::start_transaction(P_OP operation, P_STTR * stuff, PACKET* s
|
||||
}
|
||||
else
|
||||
{
|
||||
RTR transaction = make_transaction(rdb, handle);
|
||||
Rtr* transaction = make_transaction(rdb, handle);
|
||||
if (transaction)
|
||||
{
|
||||
object = transaction->rtr_id;
|
||||
@ -5177,11 +5173,11 @@ ISC_STATUS rem_port::transact_request(P_TRRQ* trrq, PACKET* sendL)
|
||||
*
|
||||
**************************************/
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
RTR transaction;
|
||||
Rtr* transaction;
|
||||
|
||||
getHandle(transaction, trrq->p_trrq_transaction);
|
||||
|
||||
RDB rdb = this->port_context;
|
||||
Rdb* rdb = this->port_context;
|
||||
if (bad_db(status_vector, rdb))
|
||||
{
|
||||
return this->send_response(sendL, 0, 0, status_vector, false);
|
||||
@ -5189,7 +5185,7 @@ ISC_STATUS rem_port::transact_request(P_TRRQ* trrq, PACKET* sendL)
|
||||
|
||||
const UCHAR* blr = trrq->p_trrq_blr.cstr_address;
|
||||
const USHORT blr_length = trrq->p_trrq_blr.cstr_length;
|
||||
RPR procedure = this->port_rpr;
|
||||
Rpr* procedure = this->port_rpr;
|
||||
const UCHAR* in_msg = (procedure->rpr_in_msg) ? procedure->rpr_in_msg->msg_address : NULL;
|
||||
const USHORT in_msg_length =
|
||||
(procedure->rpr_in_format) ? procedure->rpr_in_format->fmt_length : 0;
|
||||
@ -5249,7 +5245,7 @@ static void zap_packet(PACKET* packet,
|
||||
}
|
||||
|
||||
static bool bad_port_context(ISC_STATUS* status_vector,
|
||||
RDB rdb,
|
||||
Rdb* rdb,
|
||||
const ISC_LONG error)
|
||||
{
|
||||
/**************************************
|
||||
|
@ -166,7 +166,7 @@ static void xnet_log_error(const char* err_msg)
|
||||
}
|
||||
|
||||
|
||||
rem_port* XNET_analyze(Firebird::PathName& file_name,
|
||||
rem_port* XNET_analyze(const Firebird::PathName& file_name,
|
||||
ISC_STATUS* status_vector,
|
||||
const TEXT* node_name,
|
||||
const TEXT* user_string,
|
||||
@ -189,7 +189,7 @@ rem_port* XNET_analyze(Firebird::PathName& file_name,
|
||||
// We need to establish a connection to a remote server.
|
||||
// Allocate the necessary blocks and get ready to go.
|
||||
|
||||
RDB rdb = new Rdb;
|
||||
Rdb* rdb = new Rdb;
|
||||
PACKET* packet = &rdb->rdb_packet;
|
||||
|
||||
// Pick up some user identification information
|
||||
@ -217,15 +217,14 @@ rem_port* XNET_analyze(Firebird::PathName& file_name,
|
||||
cnct->p_cnct_cversion = CONNECT_VERSION2;
|
||||
cnct->p_cnct_client = ARCHITECTURE;
|
||||
cnct->p_cnct_file.cstr_length = file_name.length();
|
||||
cnct->p_cnct_file.cstr_address =
|
||||
reinterpret_cast<UCHAR*>(file_name.begin());
|
||||
cnct->p_cnct_file.cstr_address = reinterpret_cast<const UCHAR*>(file_name.c_str());
|
||||
|
||||
// Note: prior to V3.1E a recievers could not in truth handle more
|
||||
// then 5 protocol descriptions; however, the interprocess server
|
||||
// was created in 4.0 so this does not apply.
|
||||
|
||||
cnct->p_cnct_user_id.cstr_length = user_id.getBufferLength();
|
||||
cnct->p_cnct_user_id.cstr_address = const_cast<UCHAR*>(user_id.getBuffer());
|
||||
cnct->p_cnct_user_id.cstr_address = user_id.getBuffer();
|
||||
|
||||
static const p_cnct::p_cnct_repeat protocols_to_try1[] =
|
||||
{
|
||||
@ -265,12 +264,12 @@ rem_port* XNET_analyze(Firebird::PathName& file_name,
|
||||
cnct->p_cnct_cversion = CONNECT_VERSION2;
|
||||
cnct->p_cnct_client = ARCHITECTURE;
|
||||
cnct->p_cnct_file.cstr_length = file_name.length();
|
||||
cnct->p_cnct_file.cstr_address = (UCHAR *) file_name.c_str();
|
||||
cnct->p_cnct_file.cstr_address = reinterpret_cast<const UCHAR*>(file_name.c_str());
|
||||
|
||||
// try again with next set of known protocols
|
||||
|
||||
cnct->p_cnct_user_id.cstr_length = user_id.getBufferLength();
|
||||
cnct->p_cnct_user_id.cstr_address = const_cast<UCHAR*>(user_id.getBuffer());
|
||||
cnct->p_cnct_user_id.cstr_address = user_id.getBuffer();
|
||||
|
||||
static const p_cnct::p_cnct_repeat protocols_to_try2[] =
|
||||
{
|
||||
@ -302,12 +301,12 @@ rem_port* XNET_analyze(Firebird::PathName& file_name,
|
||||
cnct->p_cnct_cversion = CONNECT_VERSION2;
|
||||
cnct->p_cnct_client = ARCHITECTURE;
|
||||
cnct->p_cnct_file.cstr_length = file_name.length();
|
||||
cnct->p_cnct_file.cstr_address = (UCHAR *) file_name.c_str();
|
||||
cnct->p_cnct_file.cstr_address = reinterpret_cast<const UCHAR*>(file_name.c_str());
|
||||
|
||||
// try again with next set of known protocols
|
||||
|
||||
cnct->p_cnct_user_id.cstr_length = user_id.getBufferLength();
|
||||
cnct->p_cnct_user_id.cstr_address = const_cast<UCHAR*>(user_id.getBuffer());
|
||||
cnct->p_cnct_user_id.cstr_address = user_id.getBuffer();
|
||||
|
||||
static const p_cnct::p_cnct_repeat protocols_to_try3[] =
|
||||
{
|
||||
@ -1545,7 +1544,7 @@ static void server_shutdown(rem_port* port)
|
||||
#endif // SUPERCLIENT
|
||||
|
||||
|
||||
static int xdrxnet_create(XDR * xdrs, rem_port* port, UCHAR * buffer,
|
||||
static int xdrxnet_create(XDR * xdrs, rem_port* port, UCHAR* buffer,
|
||||
USHORT length, enum xdr_op x_op)
|
||||
{
|
||||
/**************************************
|
||||
@ -1560,7 +1559,7 @@ static int xdrxnet_create(XDR * xdrs, rem_port* port, UCHAR * buffer,
|
||||
**************************************/
|
||||
|
||||
xdrs->x_public = (caddr_t) port;
|
||||
xdrs->x_private = (SCHAR *) buffer;
|
||||
xdrs->x_private = reinterpret_cast<SCHAR*>(buffer);
|
||||
xdrs->x_base = xdrs->x_private;
|
||||
xdrs->x_handy = length;
|
||||
xdrs->x_ops = &xnet_ops;
|
||||
@ -2372,7 +2371,7 @@ static rem_port* get_server_port(ULONG client_pid,
|
||||
XCC xcc = new struct xcc;
|
||||
|
||||
try {
|
||||
UCHAR* p = (UCHAR *) xpm->xpm_address + XPS_SLOT_OFFSET(global_pages_per_slot, slot_num);
|
||||
UCHAR* p = (UCHAR*) xpm->xpm_address + XPS_SLOT_OFFSET(global_pages_per_slot, slot_num);
|
||||
memset(p, 0, XPS_MAPPED_PER_CLI(global_pages_per_slot));
|
||||
xcc->xcc_next = NULL;
|
||||
xcc->xcc_mapped_addr = p;
|
||||
|
@ -32,7 +32,7 @@
|
||||
#define rem_port void
|
||||
#endif
|
||||
|
||||
rem_port* XNET_analyze(Firebird::PathName&, ISC_STATUS*, const TEXT*, const TEXT*, bool);
|
||||
rem_port* XNET_analyze(const Firebird::PathName&, ISC_STATUS*, const TEXT*, const TEXT*, bool);
|
||||
rem_port* XNET_connect(const TEXT*, struct packet*, ISC_STATUS*, USHORT);
|
||||
|
||||
#ifndef SUPERCLIENT
|
||||
|
Loading…
Reference in New Issue
Block a user