Subject | Re: Firebird 2_1 installation |
---|---|
Author | Amit Bueno |
Post date | 2008-09-16T16:24:31Z |
I have drilled down to the code that is rejecting my packet from the
connection:
"
static bool accept_connection(rem_port* port,
P_CNCT * connect,
PACKET* send)
{
/**************************************
*
* a c c e p t _ c o n n e c t i o n
*
**************************************
*
* Functional description
* Process a connect packet.
*
**************************************/
// Accept the physical connection
send->p_operation = op_reject;
P_ACPT* accept = &send->p_acpt;
if (!port->accept(connect)) {
port->send(send);
return false;
}
// Select the most appropriate protocol (this will get smarter)
P_ARCH architecture = arch_generic;
USHORT version = 0;
USHORT type = 0;
bool accepted = false;
USHORT weight = 0;
const p_cnct::p_cnct_repeat* protocol = connect->p_cnct_versions;
for (const p_cnct::p_cnct_repeat* const end = protocol +
connect->p_cnct_count;
protocol < end; protocol++)
{
if ((protocol->p_cnct_version == PROTOCOL_VERSION3 ||
protocol->p_cnct_version == PROTOCOL_VERSION4 ||
protocol->p_cnct_version == PROTOCOL_VERSION5 ||
protocol->p_cnct_version == PROTOCOL_VERSION6 ||
protocol->p_cnct_version == PROTOCOL_VERSION7 ||
protocol->p_cnct_version == PROTOCOL_VERSION8 ||
protocol->p_cnct_version == PROTOCOL_VERSION9 ||
protocol->p_cnct_version == PROTOCOL_VERSION10 ||
protocol->p_cnct_version == PROTOCOL_VERSION11
#ifdef SCROLLABLE_CURSORS
|| protocol->p_cnct_version == PROTOCOL_SCROLLABLE_CURSORS
#endif
) &&
(protocol->p_cnct_architecture == arch_generic ||
protocol->p_cnct_architecture == ARCHITECTURE) &&
protocol->p_cnct_weight >= weight)
{
accepted = true;
weight = protocol->p_cnct_weight;
version = protocol->p_cnct_version;
architecture = protocol->p_cnct_architecture;
type = MIN(protocol->p_cnct_max_type, ptype_lazy_send);
send->p_operation = op_accept;
}
}
/* Send off out gracious acceptance or flag rejection */
if (!accepted) {
port->send(send);
return false;
}
accept->p_acpt_version = port->port_protocol = version;
accept->p_acpt_architecture = architecture;
accept->p_acpt_type = type;
/* and modify the version string to reflect the chosen protocol */
Firebird::string buffer;
buffer.printf("%s/P%d", port->port_version->str_data,
port->port_protocol & FB_PROTOCOL_MASK);
ALLR_free(port->port_version);
port->port_version = REMOTE_make_string(buffer.c_str());
if (architecture == ARCHITECTURE)
port->port_flags |= PORT_symmetric;
if (type == ptype_rpc)
port->port_flags |= PORT_rpc;
if (type != ptype_out_of_band)
port->port_flags |= PORT_no_oob;
if (type == ptype_lazy_send)
port->port_flags |= PORT_lazy;
port->send(send);
return true;
}
"
I still do not know why it is being rejected....
connection:
"
static bool accept_connection(rem_port* port,
P_CNCT * connect,
PACKET* send)
{
/**************************************
*
* a c c e p t _ c o n n e c t i o n
*
**************************************
*
* Functional description
* Process a connect packet.
*
**************************************/
// Accept the physical connection
send->p_operation = op_reject;
P_ACPT* accept = &send->p_acpt;
if (!port->accept(connect)) {
port->send(send);
return false;
}
// Select the most appropriate protocol (this will get smarter)
P_ARCH architecture = arch_generic;
USHORT version = 0;
USHORT type = 0;
bool accepted = false;
USHORT weight = 0;
const p_cnct::p_cnct_repeat* protocol = connect->p_cnct_versions;
for (const p_cnct::p_cnct_repeat* const end = protocol +
connect->p_cnct_count;
protocol < end; protocol++)
{
if ((protocol->p_cnct_version == PROTOCOL_VERSION3 ||
protocol->p_cnct_version == PROTOCOL_VERSION4 ||
protocol->p_cnct_version == PROTOCOL_VERSION5 ||
protocol->p_cnct_version == PROTOCOL_VERSION6 ||
protocol->p_cnct_version == PROTOCOL_VERSION7 ||
protocol->p_cnct_version == PROTOCOL_VERSION8 ||
protocol->p_cnct_version == PROTOCOL_VERSION9 ||
protocol->p_cnct_version == PROTOCOL_VERSION10 ||
protocol->p_cnct_version == PROTOCOL_VERSION11
#ifdef SCROLLABLE_CURSORS
|| protocol->p_cnct_version == PROTOCOL_SCROLLABLE_CURSORS
#endif
) &&
(protocol->p_cnct_architecture == arch_generic ||
protocol->p_cnct_architecture == ARCHITECTURE) &&
protocol->p_cnct_weight >= weight)
{
accepted = true;
weight = protocol->p_cnct_weight;
version = protocol->p_cnct_version;
architecture = protocol->p_cnct_architecture;
type = MIN(protocol->p_cnct_max_type, ptype_lazy_send);
send->p_operation = op_accept;
}
}
/* Send off out gracious acceptance or flag rejection */
if (!accepted) {
port->send(send);
return false;
}
accept->p_acpt_version = port->port_protocol = version;
accept->p_acpt_architecture = architecture;
accept->p_acpt_type = type;
/* and modify the version string to reflect the chosen protocol */
Firebird::string buffer;
buffer.printf("%s/P%d", port->port_version->str_data,
port->port_protocol & FB_PROTOCOL_MASK);
ALLR_free(port->port_version);
port->port_version = REMOTE_make_string(buffer.c_str());
if (architecture == ARCHITECTURE)
port->port_flags |= PORT_symmetric;
if (type == ptype_rpc)
port->port_flags |= PORT_rpc;
if (type != ptype_out_of_band)
port->port_flags |= PORT_no_oob;
if (type == ptype_lazy_send)
port->port_flags |= PORT_lazy;
port->send(send);
return true;
}
"
I still do not know why it is being rejected....