Silence WLog_ERR messages if last error is set.

This commit is contained in:
Armin Novak 2017-11-06 14:02:22 +01:00
parent 504b771686
commit ce00f4dd8f
5 changed files with 25 additions and 20 deletions

View File

@ -146,7 +146,9 @@ static void* tf_client_thread_proc(freerdp* instance)
if (!freerdp_check_event_handles(instance->context))
{
WLog_ERR(TAG, "Failed to check FreeRDP event handles");
if (freerdp_get_last_error(instance->context) == FREERDP_ERROR_SUCCESS)
WLog_ERR(TAG, "Failed to check FreeRDP event handles");
break;
}
}
@ -174,7 +176,6 @@ int main(int argc, char* argv[])
instance->ContextSize = sizeof(tfContext);
instance->ContextNew = tf_context_new;
instance->ContextFree = tf_context_free;
freerdp_register_addin_provider(freerdp_channels_load_static_addin_entry, 0);
if (!freerdp_context_new(instance))
@ -191,7 +192,6 @@ int main(int argc, char* argv[])
exit(0);
}
if (!freerdp_client_load_addins(instance->context->channels,
instance->settings))
exit(-1);

View File

@ -103,7 +103,7 @@ static BOOL wl_pre_connect(freerdp* instance)
{
rdpSettings* settings;
wlfContext* context;
UwacOutput *output;
UwacOutput* output;
UwacSize resolution;
if (!instance)
@ -152,6 +152,7 @@ static BOOL wl_pre_connect(freerdp* instance)
{
// Use the resolution of the first display output
output = UwacDisplayGetOutput(context->display, 1);
if (output != NULL && UwacOutputGetResolution(output, &resolution) == UWAC_SUCCESS)
{
settings->DesktopWidth = (UINT32) resolution.width;
@ -200,9 +201,7 @@ static BOOL wl_post_connect(freerdp* instance)
gdi->width * gdi->height * 4);
UwacWindowAddDamage(context->window, 0, 0, gdi->width, gdi->height);
context->haveDamage = TRUE;
freerdp_keyboard_init(instance->context->settings->KeyboardLayout);
return wl_update_content(context);
}
@ -346,7 +345,9 @@ static int wlfreerdp_run(freerdp* instance)
//if (WaitForMultipleObjects(count, &handles[1], FALSE, INFINITE)) {
if (freerdp_check_event_handles(instance->context) != TRUE)
{
printf("Failed to check FreeRDP file descriptor\n");
if (freerdp_get_last_error(instance->context) == FREERDP_ERROR_SUCCESS)
printf("Failed to check FreeRDP file descriptor\n");
break;
}

View File

@ -383,7 +383,6 @@ static BOOL xf_sw_desktop_resize(rdpContext* context)
xfc->image->byte_order = LSBFirst;
xfc->image->bitmap_bit_order = LSBFirst;
ret = xf_desktop_resize(context);
out:
xf_unlock_x11(xfc, TRUE);
@ -1267,7 +1266,6 @@ static BOOL xf_post_connect(freerdp* instance)
update->SetKeyboardIndicators = xf_keyboard_set_indicators;
update->SetKeyboardImeStatus = xf_keyboard_set_ime_status;
if (!(xfc->clipboard = xf_clipboard_new(xfc)))
return FALSE;
@ -1275,7 +1273,6 @@ static BOOL xf_post_connect(freerdp* instance)
e.width = settings->DesktopWidth;
e.height = settings->DesktopHeight;
PubSub_OnResizeWindow(context->pubSub, xfc, &e);
return TRUE;
}
@ -1304,10 +1301,9 @@ static void xf_post_disconnect(freerdp* instance)
static int xf_logon_error_info(freerdp* instance, UINT32 data, UINT32 type)
{
xfContext* xfc = (xfContext*) instance->context;
const char *str_data = freerdp_get_logon_error_info_data(data);
const char *str_type = freerdp_get_logon_error_info_type(type);
const char* str_data = freerdp_get_logon_error_info_data(data);
const char* str_type = freerdp_get_logon_error_info_type(type);
WLog_INFO(TAG, "Logon Error Info %s [%s]", str_data, str_type);
xf_rail_disable_remoteapp_mode(xfc);
return 1;
}
@ -1553,7 +1549,9 @@ static void* xf_client_thread(void* param)
if (xf_auto_reconnect(instance))
continue;
WLog_ERR(TAG, "Failed to check FreeRDP file descriptor");
if (freerdp_get_last_error(context) == FREERDP_ERROR_SUCCESS)
WLog_ERR(TAG, "Failed to check FreeRDP file descriptor");
break;
}
}

View File

@ -258,7 +258,7 @@ BOOL freerdp_connect(freerdp* instance)
Stream_SetLength(s, record.length);
Stream_SetPosition(s, 0);
update->BeginPaint(update->context);
update_recv_surfcmds(update, Stream_Length(s) , s);
update_recv_surfcmds(update, Stream_Length(s), s);
update->EndPaint(update->context);
Stream_Release(s);
}
@ -366,7 +366,9 @@ BOOL freerdp_check_event_handles(rdpContext* context)
if (!status)
{
WLog_ERR(TAG, "freerdp_check_fds() failed - %"PRIi32"", status);
if (freerdp_get_last_error(context) == FREERDP_ERROR_SUCCESS)
WLog_ERR(TAG, "freerdp_check_fds() failed - %"PRIi32"", status);
return FALSE;
}
@ -374,7 +376,9 @@ BOOL freerdp_check_event_handles(rdpContext* context)
if (!status)
{
WLog_ERR(TAG, "freerdp_channels_check_fds() failed - %"PRIi32"", status);
if (freerdp_get_last_error(context) == FREERDP_ERROR_SUCCESS)
WLog_ERR(TAG, "freerdp_channels_check_fds() failed - %"PRIi32"", status);
return FALSE;
}

View File

@ -999,8 +999,8 @@ int transport_check_fds(rdpTransport* transport)
while (now < dueDate)
{
if (freerdp_shall_disconnect(transport->context->instance)) {
if (freerdp_shall_disconnect(transport->context->instance))
{
return -1;
}
@ -1197,7 +1197,9 @@ static void* transport_client_thread(void* arg)
{
if (!freerdp_check_event_handles(context))
{
WLog_Print(transport->log, WLOG_ERROR, "freerdp_check_event_handles()");
if (freerdp_get_last_error(context) == FREERDP_ERROR_SUCCESS)
WLog_Print(transport->log, WLOG_ERROR, "freerdp_check_event_handles()");
rdp_set_error_info(rdp, ERRINFO_PEER_DISCONNECTED);
break;
}