curl-library
libCurl does not send data using multi interface on high latency connections
Date: Wed, 12 Sep 2018 15:53:33 -0300
Hi, I am using libCurl's multi interface with boost::asio and I
noticed that on high latency connections (200 ms or more) libCurl
manages to open the connection, but it does not send any data, so the
server never replies back.
I've sniffed my network with wireshark to see what's going on, and
what I can see is that libCurl successfully opens the tcp connection
(it does all the handshake process), but then it does not send any
data to the server (for example a GET request).
For that reason, the server never replies back and then the
connections expires with a timeout without never receiving any data.
You can reproduce this bug even in the asiohiper example from the curl
Example page: https://curl.haxx.se/libcurl/c/asiohiper.html
The only requirement is that the host needs to have high latency, at
least 200 ms from where you are.
For that reason you can change the hardcoded domain in new_conn((char
*)"www.google.com", &g); to a server you know has a high latency, or
you can add artificial latency using tc on linux.
I have tested it using a local nodejs server, and adding an artificial
delay to my localhost interface with the following command: sudo tc
qdisc add dev lo root netem delay 222ms
You can later remove the delay with the command: sudo tc qdisc del dev lo root
NOTE: it only applies to the loopback interface
My OS is Ubuntu 16.04 (kernel version 4.4.0-134-generic), my curl
version is 7.55.1 and my boost version is 1.65.0
I have no clue about what is happening, so any help will be greatly appreciated
Thanks in advance,
Nicolas Bagnasco
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2018-09-12