[Interest] Does QNetworkAccessManager support HTTP persistent connections? (keep-alive)

Sze Howe Koh szehowe.koh at gmail.com
Thu Jul 26 17:01:48 CEST 2018


On Thu, 26 Jul 2018 at 09:24, Thiago Macieira <thiago.macieira at intel.com> wrote:
>
> On Wednesday, 25 July 2018 17:59:07 PDT Sze Howe Koh wrote:
> > I think the comms was HTTP 1.1, because Wireshark showed "HTTP/1.1 200
> > OK    (text/plain)"
>
> Ok, so the server chose to close the connection.
>
> It did not happen for me when using curl, also with download.qt.io. Possible
> reasons:
>  1) different mirror
>  2) server behaves differently based on the User-Agent
>
> #2 is likely.

Thanks for trying, Thiago.

To clarify: Did the server respond to your GET with "Connection:
keep-alive" instead of "Connection: close", when you downloaded a
metadata file (*meta.7z)?

I sent requests from 3 different programs with different user-agents
(plus 1 request from a VM). All of them got "Connection: close" from
the server.

Interestingly, all 3 requests from Windows got a RST from the server,
but the request from my Linux VM didn't. (All of them got "Connection:
close", however). Is this a clue, or a red herring?


=== cURL from Linux VM ===
GET /online/qtsdkrepository/windows_x86/desktop/qt5_59/qt.59.qtvirtualkeyboard.win64_msvc2015_64/5.9.0-0-201705291821meta.7z
HTTP/1.1
Host: download.qt.io
User-Agent: curl/7.52.1
Accept: */*


=== cURL from Windows host ===
GET /online/qtsdkrepository/windows_x86/desktop/qt5_59/qt.59.qtvirtualkeyboard.win64_msvc2015_64/5.9.0-0-201705291821meta.7z
HTTP/1.1
Host: download.qt.io
User-Agent: curl/7.53.1
Accept: */*


=== QNAM, default settings, from Windows host ===
GET /online/qtsdkrepository/windows_x86/desktop/qt5_59/qt.59.qtvirtualkeyboard.win64_msvc2015_64/5.9.0-0-201705291821meta.7z
HTTP/1.1
Host: download.qt.io
Connection: Keep-Alive
Accept-Encoding: gzip, deflate
Accept-Language: en-AU,*
User-Agent: Mozilla/5.0


=== Google Chrome from Windows host ===
GET /online/qtsdkrepository/windows_x86/desktop/qt5_59/qt.59.qtvirtualkeyboard.win64_msvc2015_64/5.9.0-0-201705291821meta.7z
HTTP/1.1
Host: download.qt.io
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99
Safari/537.36
DNT: 1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: en,en-AU;q=0.9


Anyway, it looks like this isn't a QNAM issue so I'll ask a qt.io web admin.

Regards,
Sze-Howe



More information about the Interest mailing list