Re: [PATCH spice-gtk 16/16] channel-main: Don't g_warn when not finding a file-xfer-id

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 29, 2013 at 12:40:28PM +0100, Hans de Goede wrote:
> Since the agent channel can have a significant latency, it is possible
> for a cancel send from the client to the agent and a status message from
> the agent to cross each other. If this happens then the file-xfer will no
> longer be on the list.
> 
> Printing a g_warning on this (rare but triggerable) condition will only get
> us hard to debug bug reports, so turn it into a SPICE_DEBUG.

On the other hand, this rare situation occurring could be related to some
mysterious transient bugs that would be reported in the future, so having a
warning being displayed right away is more useful than having to
enable debug before getting a hint that this rare situation occurred.
So I'd tend to keep a g_warning, potentially with an improved message
rather than a g_debug (even if it can occur in legit cases), but no strong
feeling either way.

Christophe

> 
> Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
> ---
>  gtk/channel-main.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/gtk/channel-main.c b/gtk/channel-main.c
> index 01c0659..11cd0f9 100644
> --- a/gtk/channel-main.c
> +++ b/gtk/channel-main.c
> @@ -1704,8 +1704,10 @@ static void file_xfer_handle_status(SpiceMainChannel *channel,
>  
>      l = g_list_find_custom(c->file_xfer_task_list, &msg->id,
>                             file_xfer_task_find);
> -
> -    g_return_if_fail(l != NULL);
> +    if (l == NULL) {
> +        SPICE_DEBUG("cannot find task %d", msg->id);
> +        return;
> +    }
>      task = l->data;
>  
>      SPICE_DEBUG("task %d received response %d", msg->id, msg->result);
> -- 
> 1.8.1.4
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/spice-devel

Attachment: pgplK9OyXNEqQ.pgp
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]