Skip to content

Commit

Permalink
Merge pull request #294 from janLo/simplify-session-match
Browse files Browse the repository at this point in the history
Simplify session match logic.
  • Loading branch information
jsorg71 committed Nov 9, 2015
2 parents e1c7aa3 + 844f01b commit 657f144
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions sesman/session.c
Expand Up @@ -144,27 +144,9 @@ session_get_bydata(char *name, int width, int height, int bpp, int type, char *c
tmp->item->client_ip);
#endif

if ((type == SESMAN_SESSION_TYPE_XRDP) || (type == SESMAN_SESSION_TYPE_XORG))
{
/* only name and bpp need to match for X11rdp, it can resize */
if (g_strncmp(name, tmp->item->name, 255) == 0 &&
(!(policy & SESMAN_CFG_SESS_POLICY_D) ||
(tmp->item->width == width && tmp->item->height == height)) &&
(!(policy & SESMAN_CFG_SESS_POLICY_I) ||
(g_strncmp_d(client_ip, tmp->item->client_ip, ':', 255) == 0)) &&
(!(policy & SESMAN_CFG_SESS_POLICY_C) ||
(g_strncmp(client_ip, tmp->item->client_ip, 255) == 0)) &&
tmp->item->bpp == bpp &&
tmp->item->type == type)
{
/*THREAD-FIX release chain lock */
lock_chain_release();
return tmp->item;
}
}

if (g_strncmp(name, tmp->item->name, 255) == 0 &&
(tmp->item->width == width && tmp->item->height == height) &&
(!(policy & SESMAN_CFG_SESS_POLICY_D) ||
(tmp->item->width == width && tmp->item->height == height)) &&
(!(policy & SESMAN_CFG_SESS_POLICY_I) ||
(g_strncmp_d(client_ip, tmp->item->client_ip, ':', 255) == 0)) &&
(!(policy & SESMAN_CFG_SESS_POLICY_C) ||
Expand Down

0 comments on commit 657f144

Please sign in to comment.