Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
The asiohiper.cpp example code is not doing things quite right #1191
[ There are collections of known issues to be aware of:
There is an example code demostrating curl multi working with boost::asio at docs/examples/asiohiper.cpp and also at https://curl.haxx.se/libcurl/c/asiohiper.html
When you try to run the code, the download progress is noticably slower than expected (compared with a program that uses just an easy interface), especially if you change the download url from google homepage into some larger pages. To make that more noticable, modify this line in the code:
Even worse, if that line of code get commented out, the program will exit while only the beginning of page downloaded, and the "DONE: some_url => (0)" log line never got printed.
The problem is that the example uses
I'll provide a PR trying to fix this later.
A test result for the commit. The exec time seems reasonable now and the downloaded content is correct.
$ time ./asiohiper
I further examined Issue #1170 and unfortunately it seems to be another problem than I have reported.
No it isn't blocking at all (for most TLS backends at least) asio doesn't know about SSL so of course it has no particular knowledge or saying about the SSL handshake, it just gets socket activities and tells libcurl about them for SSL handshakes as well as any other socket stuff.