From kde-core-devel Mon Oct 10 22:35:57 2011 From: "Andrea Iacovitti" Date: Mon, 10 Oct 2011 22:35:57 +0000 To: kde-core-devel Subject: Review Request: kio_http: fix keepalive timeout parsing Message-Id: <20111010223557.18213.51157 () vidsolbach ! de> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=131832708505530 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============2663070037641882788==" --===============2663070037641882788== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/102822/ ----------------------------------------------------------- Review request for kdelibs, Andreas Hartmetz and Dawit Alemayehu. Description ------- Keep-alive header can specify multiple, comma-separated, value pairs. For example what apache web server normally sends is something like that: "Keep-Alive: timeout=3D5, max=3D99" Actually kio_http fails to extract timeout value because it assumes keep-alive header can contain only a single value pair. In the case of example above what it end up to do is m_request.keepAliveTimeout =3D QString("5, max=3D99").toInt(), that returns= 0 (wrong!). Diffs ----- kioslave/http/http.cpp 2862707 = kioslave/http/parsinghelpers.cpp fc75d68 = Diff: http://git.reviewboard.kde.org/r/102822/diff/diff Testing ------- -Patched code compiles -Hacked a web server and made tests against following keep-alive header var= iants: "Keep-Alive: timeout=3D5, max=3D99" "Keep-Alive: Timeout=3D5, max=3D99" (uppercase 'T') "Keep-Alive: Timeout=3D5 , max=3D99" (extra space before comma) Thanks, Andrea Iacovitti --===============2663070037641882788== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable
This is an automatically generated e-mail. To reply, visit: http://git.revie= wboard.kde.org/r/102822/

Review request for kdelibs, Andreas Hartmetz and Dawit Alemayehu.
By Andrea Iacovitti.

Descripti= on

Keep-alive header can specify multiple, comma-separated, val=
ue pairs.
For example what apache web server normally sends is something like that:

"Keep-Alive: timeout=3D5, max=3D99"

Actually kio_http fails to extract timeout value because it assumes
keep-alive header can contain only a single value pair.
In the case of example above what it end up to do is
m_request.keepAliveTimeout =3D QString("5, max=3D99").toInt(), th=
at returns 0 (wrong!).

Testing <= /h1>
-Patched code compiles
-Hacked a web server and made tests against following keep-alive header var=
iants:
 "Keep-Alive: timeout=3D5, max=3D99"
 "Keep-Alive: Timeout=3D5, max=3D99"     (uppercase 'T')
 "Keep-Alive: Timeout=3D5 , max=3D99"    (extra space before comm=
a)

Diffs=

  • kioslave/http/http.cpp (2862707)
  • kioslave/http/parsinghelpers.cpp (fc75d68)=

View Diff

--===============2663070037641882788==--