diff --git a/libfreerdp/core/peer.c b/libfreerdp/core/peer.c index c5d71ae5e..e6f9428c8 100644 --- a/libfreerdp/core/peer.c +++ b/libfreerdp/core/peer.c @@ -1159,6 +1159,10 @@ static state_run_t peer_recv_callback(rdpTransport* transport, wStream* s, void* state_run_t rc = STATE_RUN_FAILED; const size_t start = Stream_GetPosition(s); const rdpContext* context = transport_get_context(transport); + DWORD level = WLOG_TRACE; + static wLog* log = NULL; + if (!log) + log = WLog_Get(TAG); WINPR_ASSERT(context); do @@ -1170,9 +1174,13 @@ static state_run_t peer_recv_callback(rdpTransport* transport, wStream* s, void* Stream_SetPosition(s, start); rc = peer_recv_callback_internal(transport, s, extra); - WLog_VRB(TAG, "(server)[%s -> %s] current return %s [%" PRIuz " bytes not processed]", old, - rdp_get_state_string(rdp), state_run_result_string(rc, buffer, sizeof(buffer)), - Stream_GetRemainingLength(s)); + const size_t len = Stream_GetRemainingLength(s); + if ((len > 0) && !state_run_continue(rc)) + level = WLOG_WARN; + WLog_Print(log, level, + "(server)[%s -> %s] current return %s [%" PRIuz " bytes not processed]", old, + rdp_get_state_string(rdp), state_run_result_string(rc, buffer, sizeof(buffer)), + len); } while (state_run_continue(rc)); return rc;