mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 19:23:03 +01:00
Link port into parent's list only after it full creation.
Not used currently in XNET\WNET but looks better ;)
This commit is contained in:
parent
9d97d10ddc
commit
d90529cd7d
@ -558,19 +558,6 @@ static rem_port* alloc_port( rem_port* parent)
|
||||
sprintf(buffer, "WNet (%s)", port->port_host->str_data);
|
||||
port->port_version = REMOTE_make_string(buffer);
|
||||
|
||||
if (parent) {
|
||||
port->port_parent = parent;
|
||||
port->port_next = parent->port_clients;
|
||||
parent->port_clients = parent->port_next = port;
|
||||
port->port_handle = parent->port_handle;
|
||||
port->port_server = parent->port_server;
|
||||
port->port_server_flags = parent->port_server_flags;
|
||||
if (port->port_connection)
|
||||
ALLR_free(port->port_connection);
|
||||
port->port_connection =
|
||||
REMOTE_make_string(parent->port_connection->str_data);
|
||||
}
|
||||
|
||||
port->port_accept = accept_connection;
|
||||
port->port_disconnect = disconnect;
|
||||
port->port_receive_packet = receive;
|
||||
@ -593,6 +580,20 @@ static rem_port* alloc_port( rem_port* parent)
|
||||
xdrwnet_create(&port->port_receive, port, port->port_buffer, 0,
|
||||
XDR_DECODE);
|
||||
|
||||
if (parent)
|
||||
{
|
||||
port->port_parent = parent;
|
||||
port->port_next = parent->port_clients;
|
||||
parent->port_clients = parent->port_next = port;
|
||||
port->port_handle = parent->port_handle;
|
||||
port->port_server = parent->port_server;
|
||||
port->port_server_flags = parent->port_server_flags;
|
||||
if (port->port_connection){
|
||||
ALLR_free(port->port_connection);
|
||||
}
|
||||
port->port_connection = REMOTE_make_string(parent->port_connection->str_data);
|
||||
}
|
||||
|
||||
return port;
|
||||
}
|
||||
|
||||
|
@ -626,18 +626,6 @@ static rem_port* alloc_port(rem_port* parent,
|
||||
port->port_connection = REMOTE_make_string(buffer);
|
||||
fb_utils::snprintf(buffer, sizeof(buffer), "XNet (%s)", port->port_host->str_data);
|
||||
port->port_version = REMOTE_make_string(buffer);
|
||||
if (parent) {
|
||||
port->port_parent = parent;
|
||||
port->port_next = parent->port_clients;
|
||||
parent->port_clients = parent->port_next = port;
|
||||
port->port_handle = parent->port_handle;
|
||||
port->port_server = parent->port_server;
|
||||
port->port_server_flags = parent->port_server_flags;
|
||||
if (port->port_connection)
|
||||
ALLR_free(port->port_connection);
|
||||
port->port_connection =
|
||||
REMOTE_make_string(parent->port_connection->str_data);
|
||||
}
|
||||
|
||||
port->port_accept = accept_connection;
|
||||
port->port_disconnect = disconnect;
|
||||
@ -659,6 +647,20 @@ static rem_port* alloc_port(rem_port* parent,
|
||||
xdrxnet_create(&port->port_send, port, send_buffer, send_length, XDR_ENCODE);
|
||||
xdrxnet_create(&port->port_receive, port, receive_buffer, 0, XDR_DECODE);
|
||||
|
||||
if (parent)
|
||||
{
|
||||
port->port_parent = parent;
|
||||
port->port_next = parent->port_clients;
|
||||
parent->port_clients = parent->port_next = port;
|
||||
port->port_handle = parent->port_handle;
|
||||
port->port_server = parent->port_server;
|
||||
port->port_server_flags = parent->port_server_flags;
|
||||
if (port->port_connection) {
|
||||
ALLR_free(port->port_connection);
|
||||
}
|
||||
port->port_connection = REMOTE_make_string(parent->port_connection->str_data);
|
||||
}
|
||||
|
||||
return port;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user