Fix missing displays on sesman restart

This commit is contained in:
matt335672
2024-12-18 12:42:11 +00:00
parent 9225fe0686
commit 0806b2b978
3 changed files with 17 additions and 6 deletions
-3
View File
@@ -207,11 +207,8 @@ ercp_get_session_announce_event(struct trans *trans,
&i_start_time);
if (rv == 0)
{
if (display != NULL)
{
*display = i_display;
}
*uid = (uid_t)i_uid;
*type = (enum scp_session_type)i_type;
*start_width = i_width;
-1
View File
@@ -188,7 +188,6 @@ ercp_send_session_announce_event(struct trans *trans,
*
* @param trans EICP transport
* @param[out] display Display used by session.
* Pointer can be NULL if this is already known.
* @param[out] uid UID of user logged in to session
* @param[out] type Session type
* @param[out] start_width Starting width of seenio
+16 -1
View File
@@ -42,9 +42,10 @@ process_session_announce_event(struct session_item *si)
{
int rv;
const char *start_ip_addr;
unsigned int display;
rv = ercp_get_session_announce_event(si->sesexec_trans,
NULL,
&display,
&si->uid,
&si->type,
&si->start_width,
@@ -53,10 +54,24 @@ process_session_announce_event(struct session_item *si)
&si->guid,
&start_ip_addr,
&si->start_time);
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);
si->display = display;
si->state = E_SESSION_RUNNING;
}