Details
Description
When doing a HTTP request where the hostname has both a IPv4 and v6 address (but the actual webserver only listens on IPv4), on a machine with a working IPv6 setup, there's a huge timeout (30 seconds) before retrying on the IPv4 address, even if the connection attempt at IPv6 returns immediately.
E.g., a sample application like this:
#include <QtGui> #include <QtNetwork> int main(int argc, char *argv[]) { QApplication app(argc, argv); QNetworkAccessManager manager; QNetworkRequest request(QString("http://localhost:8080/foo")); QNetworkReply* reply = manager.get(request); return app.exec(); }
A packet trace of the loopback interface when this is run looks like this:
1 0.000000 ::1 -> ::1 TCP 60162 > http-alt [SYN] Seq=0 Win=65535 Len=0 MSS=16324 WS=1 TSV=515579911 TSER=0 2 0.000020 ::1 -> ::1 TCP http-alt > 60162 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0 3 30.003665 127.0.0.1 -> 127.0.0.1 TCP 60169 > http-alt [SYN] Seq=0 Win=65535 Len=0 MSS=16344 WS=1 TSV=515580210 TSER=0 4 30.003760 127.0.0.1 -> 127.0.0.1 TCP http-alt > 60169 [SYN, ACK] Seq=0 Ack=1 Win=65535 Len=0 MSS=16344 WS=1 TSV=515580210 TSER=515580210 5 30.003767 127.0.0.1 -> 127.0.0.1 TCP 60169 > http-alt [ACK] Seq=1 Ack=1 Win=81660 Len=0 TSV=515580210 TSER=515580210
If the first connection attempt to ::1 has already been properly denied, why the 30 second wait?
This also affects QtWebKit.
Attachments
Issue Links
- relates to
-
QTBUG-12608 QHostInfo IPv6 does not respect scope
-
- Closed
-