curl / Mailing Lists / curl-library / Single Mail

curl-library

RE: CURLINFO_XFER_STATE

From: Lucas Pardue <Lucas.Pardue_at_bbc.co.uk>
Date: Thu, 25 May 2017 12:54:45 +0000

> On Thur, 25 May 2017, Daniel Stenberg wrote:

> You mean like when handle Y reaches state X, start transfer Z ? Where X
> would be more or less those different states.
>
> That just feels like a very niche feature that we've had very little requests
> for. And I suspect it would also lead to many more things needed for it to be
> really usable to applications; like what if it doesn't reach the state within a
> certain time or what if it ends before it reaches the state how would that be
> signalled back to the application? Tricky.

Yes I see the problem there.

>
> Another approach would be to offer a callback for state changes so that
> applications can get told when the transfer state changes and then they
> could do whatever they want with that info. A callback seems better to me
> than just a getinfo, since if you want to do something special when libcurl
> reaches a particular state it's impractical to keep polling the state to detect
> it...
>
> Of course, even with callbacks we have the problem for when a certain state
> isn't reached at all but instead get skipped etc.
>

With my Statechart hat on, it sounds like you're proposing triggering "new" events on state entry. That does indeed sound better than polling but I wonder if a simpler approach might just be to emit the "old" events that triggered the libcurl state transition. In practice, libcurl and the application would have their own independent state chart models; these could be very similar, or very different. The benefit is that libcurl's internal state remains hidden and avoids some problems. However, I'm sure there are difficulties with this approach too :)

Lucas

-----------------------------
http://www.bbc.co.uk
This e-mail (and any attachments) is confidential and
may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in
error, please delete it from your system.
Do not use, copy or disclose the
information in any way nor act in reliance on it and notify the sender
immediately.
Please note that the BBC monitors e-mails
sent or received.
Further communication will signify your consent to
this.
-----------------------------

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2017-05-25