This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/102822/

On October 12th, 2011, 5:55 a.m., Dawit Alemayehu wrote:

kioslave/http/http.cpp (Diff revision 1)
endParsing:
3107
            if (tIt.next().startsWith("timeout=")) { // krazy:exclude=strings
3107
            QByteArray ka = tIt.next().trimmed().toLower();
This seems unnecessary to me since the parser produces a lower case token to begin with.
hmm... i did more tests and can't confirm what you say.
If server sends "timeOut=5 " ->  tIt.next() == "timeOut=5 "



- Andrea


On October 10th, 2011, 10:35 p.m., Andrea Iacovitti wrote:

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

Updated Oct. 10, 2011, 10:35 p.m.

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=5, max=99"

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 = QString("5, max=99").toInt(), that returns 0 (wrong!).

Testing

-Patched code compiles
-Hacked a web server and made tests against following keep-alive header variants:
 "Keep-Alive: timeout=5, max=99"
 "Keep-Alive: Timeout=5, max=99"     (uppercase 'T')
 "Keep-Alive: Timeout=5 , max=99"    (extra space before comma)

Diffs

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

View Diff