[Spice-devel] [PATCH spice-gtk 5/5] webdav: remove the client if input stream is closed
Victor Toso
victortoso at redhat.com
Mon Sep 4 09:57:53 UTC 2017
Hi,
On Mon, Sep 04, 2017 at 05:49:44AM -0400, Marc-André Lureau wrote:
> > > static void start_demux(SpiceWebdavChannel *self);
> > > @@ -361,6 +364,7 @@ static void start_client(SpiceWebdavChannel *self)
> > > SoupServer *server;
> > > GSocketAddress *addr;
> > > GError *error = NULL;
> > > + bool started;
> > >
> > > session = spice_channel_get_session(SPICE_CHANNEL(self));
> > > server =
> > > phodav_server_get_soup_server(spice_session_get_webdav_server(session));
> > > @@ -384,7 +388,8 @@ G_GNUC_END_IGNORE_DEPRECATIONS
> > >
> > > g_hash_table_insert(c->clients, &client->id, client);
> > >
> > > - client_start_read(client);
> > > + started = client_start_read(client);
> > > + g_assert(started);
> >
> > Isn't it assert too much?
>
> Since the pipe was just created for the client, it should never return
> false in client_start_read(), because g_input_stream_is_closed() is
> not possible. For me, assert() is appropriate in this case. I tend to
> keep return_if/warnings for unexpected errors that we can cope with,
> not for impossible situations (like failing to alloc, that glib assert
> on too for ex).
Ok,
Acked-by: Victor Toso <victortoso at redhat.com>
Thanks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170904/9f1dc8d0/attachment.sig>
More information about the Spice-devel
mailing list