Here's what I suggest:
A single callback, attached to the request object (can't use the convenience versions of http_client::request()), which takes a function object with the following profile:
How does that sound?
Niklas
A single callback, attached to the request object (can't use the convenience versions of http_client::request()), which takes a function object with the following profile:
void progress_handler(bool up, size_t processed_so_far)
{
...
}
Since there may not be a known content length, it would be the application's responsibility to understand how much of the overall body the 'so-far' amount represents. The callback, if set, would be called at least once, even for zero-sized bodies. The only situation in which it would not get called is when an exception (not an HTTP error message, a C++ exception) is generated in the processing -- a network error, for example.How does that sound?
Niklas