virtual-image: Only print warnings for actual errors

No need to warn for lost connections (if we don't expect more data) or
cancellations.
This commit is contained in:
Benjamin Berg 2019-12-04 19:55:25 +01:00 committed by Benjamin Berg
parent 702255b182
commit a8a2a757ed

View file

@ -75,9 +75,9 @@ recv_image_img_recv_cb (GObject *source_object,
{
if (!success)
{
g_warning ("Error receiving header for image data: %s", error->message);
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
return;
g_warning ("Error receiving header for image data: %s", error->message);
}
self = FPI_DEVICE_VIRTUAL_IMAGE (user_data);
@ -113,9 +113,10 @@ recv_image_hdr_recv_cb (GObject *source_object,
{
if (!success)
{
g_warning ("Error receiving header for image data: %s", error->message);
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) ||
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CLOSED))
return;
g_warning ("Error receiving header for image data: %s", error->message);
}
self = FPI_DEVICE_VIRTUAL_IMAGE (user_data);