Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-12243

Too long timeout before retrying with IPv4 instead of IPv6 when IPv6 attempt has failed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.7.1
    • 4.6.2
    • Network
    • None
    • Qt 4.6.2, Mac OS X 10.6
    • ae29cdf5cd319e447ef75b11ac1247375c6c8192

    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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              tmacieir Thiago Macieira (closed Nokia identity) (Inactive)
              mstorsjo Martin Storsjö
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes