core: fix endless loops waiting for activation
authorNorbert Federa <norbert.federa@thincast.com>
Thu, 20 Feb 2020 16:26:27 +0000 (17:26 +0100)
committerNorbert Federa <norbert.federa@thincast.com>
Thu, 20 Feb 2020 16:51:20 +0000 (17:51 +0100)
commita48e7f8b473f2d97e0eb5b6a1011507888c5e837
treefe0229c5257efe5b948bf74b92273c1edc62b282
parent428234012f95277c27e2a5c59b3a6672ab9fa499
core: fix endless loops waiting for activation

There are two loops polling the transport pdu receiver in non-blocking mode
when waiting for reaching CONNECTION_STATE_ACTIVE rdp state.

In case of an invalid pdu size in the tpkt header this leaded to an endless
loop, utilizing 100% of a cpu core.

Added a sleep and limited the max loop time to the tcp ack timout value.
libfreerdp/core/activation.c
libfreerdp/core/connection.c