[Spice-devel] [PATCH spice-gtk 16/16] channel-main: Don't g_warn when not finding a file-xfer-id
Christophe Fergeau
cfergeau at redhat.com
Tue Apr 9 02:54:52 PDT 2013
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 at redhat.com>
> ---
> 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 at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20130409/c41a553f/attachment.pgp>
More information about the Spice-devel
mailing list