Merge pull request #294 from janLo/simplify-session-match

Simplify session match logic.
ulab-next-nosound
jsorg71 9 years ago
commit 657f144ed5

@ -144,9 +144,6 @@ session_get_bydata(char *name, int width, int height, int bpp, int type, char *c
tmp->item->client_ip); tmp->item->client_ip);
#endif #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 && if (g_strncmp(name, tmp->item->name, 255) == 0 &&
(!(policy & SESMAN_CFG_SESS_POLICY_D) || (!(policy & SESMAN_CFG_SESS_POLICY_D) ||
(tmp->item->width == width && tmp->item->height == height)) && (tmp->item->width == width && tmp->item->height == height)) &&
@ -161,21 +158,6 @@ session_get_bydata(char *name, int width, int height, int bpp, int type, char *c
lock_chain_release(); lock_chain_release();
return tmp->item; 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_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;
}
tmp = tmp->next; tmp = tmp->next;
} }

Loading…
Cancel
Save