[Spice-devel] [spice-gtk v4 06/24] file-xfer: introduce functions to read file async

Jonathon Jongsma jjongsma at redhat.com
Wed Jun 29 16:23:29 UTC 2016


On Sat, 2016-06-25 at 10:56 +0200, Victor Toso wrote:
> > > +
> > > +    /* The progress here means the amount of data we have _read_ and not
> what
> > > +     * was actually sent to the agent. On the next "progress", the
> previous
> > > data
> > > +     * read was sent. This means that when user see 100%, we are sending
> the
> > > +     * last chunk to the guest */
> >
> > That's a good point. Do you have ideas for improving that?
> 
> As SpiceFileTransferTask does not know when the data is flushed it is a
> bit hard to emit progress of data that were actually sent.
> 
> IMHO it is not that bad as the concept of 'progress' can have some
> flexibility (data-read x data-sent) but I thought a comment was
> necessary to make explicit what we are emitting.
> 
> If we should change that, we could move this to the beginning of each
> read on _read_async():
>  emit  0% ~ file just started
>  emit 10% ~ we flushed 10% (and we are reading more)
>  emit 100% ~ all good
> 
> I'm sure we call _read_async() till the last step (expecting a EOF) so
> this should work well.


That seems like a reasonable approach.


More information about the Spice-devel mailing list