Unify connection fields for the connected client
The connected client is currently described in two places in the xrdp_client_info structure:- 1) In the connection_description field. This was introduced as field client_ip by commitd797b2cf49for xrdp v0.6.0 2) In the client_addr and client_port fields introduced by commit25369460a1for xrdp v0.8.0 This commit unifies these two sets of fields into a single set of fields describing the connection IP and port (for AF_INET/AF_INET6 connections only) and a connection description for all connection types. The code in os_calls to provide client logging has been simplified somewhat which should make it easier to add new connection types (e.g. AF_VSOCK). The old connection_description field used to be passed to sesman to inform sesman of the IP address of the client, and also to provide a string for 'C' field session policy matching. 'C' field session policy matching does not actually need this string (see #2239), and so now only the IP field is passed to sesman.
This commit is contained in:
+1
-7
@@ -330,9 +330,7 @@ trans_check_wait_objs(struct trans *self)
|
||||
{
|
||||
if (g_sck_can_recv(self->sck, 0))
|
||||
{
|
||||
in_sck = g_sck_accept(self->sck, self->addr, sizeof(self->addr),
|
||||
self->port, sizeof(self->port));
|
||||
|
||||
in_sck = g_sck_accept(self->sck);
|
||||
if (in_sck == -1)
|
||||
{
|
||||
if (g_tcp_last_error_would_block(self->sck))
|
||||
@@ -357,10 +355,6 @@ trans_check_wait_objs(struct trans *self)
|
||||
in_trans->type1 = TRANS_TYPE_SERVER;
|
||||
in_trans->status = TRANS_STATUS_UP;
|
||||
in_trans->is_term = self->is_term;
|
||||
g_strncpy(in_trans->addr, self->addr,
|
||||
sizeof(self->addr) - 1);
|
||||
g_strncpy(in_trans->port, self->port,
|
||||
sizeof(self->port) - 1);
|
||||
g_sck_set_non_blocking(in_sck);
|
||||
if (self->trans_conn_in(self, in_trans) != 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user