[Spice-devel] [PATCH spice-gtk 4/5] webdav: remove client on empty message

Jakub Janku jjanku at redhat.com
Wed Jun 19 14:37:58 UTC 2019


Hi,

On Wed, Jun 19, 2019 at 11:59 AM Frediano Ziglio <fziglio at redhat.com> wrote:
>
> >
> > Message with no data from spice-webdav daemon means
> > the client disconnected.
> >
> > In this case, the client connection to phodav
> > should be closed as well.
> >
> > This can happen e.g. when file transfer gets cancelled.
> >
> > Signed-off-by: Jakub Janků <jjanku at redhat.com>
> > ---
> >  src/channel-webdav.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/channel-webdav.c b/src/channel-webdav.c
> > index ea287f1..34d88a9 100644
> > --- a/src/channel-webdav.c
> > +++ b/src/channel-webdav.c
> > @@ -341,8 +341,8 @@ static void demux_to_client(Client *client)
> >                                          c->cancellable, demux_to_client_cb,
> >                                          client);
> >          return;
> >      } else {
> > -        /* Nothing to write */
> > -        demux_to_client_finish(client, FALSE);
> > +        /* Client disconnected */
> > +        demux_to_client_finish(client, TRUE);
>
> Minor style: as we are changing this. Previous if block ends with a "return",
> why not removing the "else" and reduce indentation too?

I think it would actually make better sense to put the
demux_to_client_finish() call in an if-return block, as this is the
"special" case.
So I would change it to that, if you don't mind.

Jakub
>
> >      }
> >  #endif
> >  }
>
> Otherwise,
>   Acked-by: Frediano Ziglio <fziglio at redhat.com>
>
> Frediano


More information about the Spice-devel mailing list