Replace X11 display number with a display string
As far as possible, use of the X11 display number is kept to X11-specific routines. This is to make it easier to restructure the code to add non-X11 display support.
This commit is contained in:
+6
-17
@@ -44,7 +44,7 @@ process_session_announce_event(struct session_item *si)
|
||||
int rv;
|
||||
const char *start_ip_addr;
|
||||
const char *instance_name;
|
||||
unsigned int display;
|
||||
const char *display;
|
||||
|
||||
rv = ercp_get_session_announce_event(si->sesexec_trans,
|
||||
&display,
|
||||
@@ -57,30 +57,19 @@ process_session_announce_event(struct session_item *si)
|
||||
&start_ip_addr,
|
||||
&si->start_time,
|
||||
&instance_name);
|
||||
if (rv == 0)
|
||||
{
|
||||
// We may already know the display we sent sesexec. If we do,
|
||||
// check sesexec sent the same value back.
|
||||
if (si->display >= 0 && display != (unsigned int)si->display)
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR, "Bugcheck: sesman expected display %d, got %u",
|
||||
si->display, display);
|
||||
rv = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (rv == 0)
|
||||
{
|
||||
snprintf(si->start_ip_addr, sizeof(si->start_ip_addr),
|
||||
"%s", start_ip_addr);
|
||||
strlcpy(si->display, display, sizeof(si->display));
|
||||
snprintf(si->xrdp_instance_name, sizeof(si->xrdp_instance_name),
|
||||
"%s", instance_name);
|
||||
si->display = display;
|
||||
|
||||
si->state = E_SESSION_RUNNING;
|
||||
|
||||
LOG(LOG_LEVEL_INFO,
|
||||
"sesman: Session on display :%d is now running", si->display);
|
||||
"sesman: Session on display %s is now running", si->display);
|
||||
}
|
||||
|
||||
return rv;
|
||||
@@ -90,7 +79,7 @@ process_session_announce_event(struct session_item *si)
|
||||
static void
|
||||
process_session_finished_event(struct session_item *si)
|
||||
{
|
||||
LOG(LOG_LEVEL_INFO, "sesman: Session on display :%d has finished.",
|
||||
LOG(LOG_LEVEL_INFO, "sesman: Session on display %s has finished.",
|
||||
si->display);
|
||||
// Setting the transport down will remove this connection from the list
|
||||
si->sesexec_trans->status = TRANS_STATUS_DOWN;
|
||||
@@ -113,7 +102,7 @@ process_client_connect_event(struct session_item *si)
|
||||
strlcpy(si->client_name, client_name, sizeof(si->client_name));
|
||||
si->last_connect_disconnect = connect_time;
|
||||
LOG(LOG_LEVEL_INFO,
|
||||
"sesman: Session on display :%d is connected from client '%s'",
|
||||
"sesman: Session on display %s is connected from client '%s'",
|
||||
si->display, si->client_name);
|
||||
}
|
||||
|
||||
@@ -134,7 +123,7 @@ process_client_disconnect_event(struct session_item *si)
|
||||
si->client_name[0] = '\0';
|
||||
si->last_connect_disconnect = disconnect_time;
|
||||
LOG(LOG_LEVEL_INFO,
|
||||
"sesman: Session on display :%d has no client connection",
|
||||
"sesman: Session on display %s has no client connection",
|
||||
si->display);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user