[Interest] Does QNetworkAccessManager support HTTP persistent connections? (keep-alive)
Sze Howe Koh
szehowe.koh at gmail.com
Thu Jul 26 02:57:33 CEST 2018
On Thu, 26 Jul 2018 at 05:44, Thiago Macieira <thiago.macieira at intel.com> wrote:
> On Wednesday, 25 July 2018 10:22:19 PDT Thiago Macieira wrote:
> > On Wednesday, 25 July 2018 07:52:13 PDT Marian Beermann wrote:
> > > Correct. If you augment your debugging a little, it is easy to see the
> > > server sending a "Connection: close" header:
> > >
> > > qDebug() << ... << reply->rawHeader("Connection");
> > The question is whether the request had a "Connection: keep-alive" header.
> > You need to check the Wireshark logs to see that.
> Or if the request was HTTP/1.1, which changed the Connection default to keep-
The reply's "Connection" header was "close", and Wireshark's traces
have no mention keep-alive.
Explicitly setting the "Connection" header in the request had no effect:
for (auto url : urls)
auto reply = nam.get(req);
QObject::connect(reply, &QNetworkReply::finished, [=]
qDebug() << reply->request().url();
qDebug() << '\t' << "Reqst:" <<
qDebug() << '\t' << "Reply:" << reply->rawHeader("Connection");
Does this mean the server is ignoring the keep-alive flag? How do I
check if QNAM is setting it correctly in the first place?
More information about the Interest