[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Review Request: kio_http: fix keepalive timeout parsing
From:       "Andrea Iacovitti" <aiacovitti () libero ! it>
Date:       2011-10-10 22:35:57
Message-ID: 20111010223557.18213.51157 () vidsolbach ! de
[Download RAW message or body]

-----------------------------------------------------------
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=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!).


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 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)


Thanks,

Andrea Iacovitti


[Attachment #3 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/102822/">http://git.reviewboard.kde.org/r/102822/</a>
  </td>
    </tr>
   </table>
   <br />


<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for kdelibs, Andreas Hartmetz and Dawit Alemayehu.</div>
<div>By Andrea Iacovitti.</div>







<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Keep-alive header can specify multiple, comma-separated, value pairs. \
For example what apache web server normally sends is something like that:

&quot;Keep-Alive: timeout=5, max=99&quot;

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(&quot;5, max=99&quot;).toInt(), that returns 0 \
(wrong!). </pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
                break-word;">-Patched code compiles
-Hacked a web server and made tests against following keep-alive header variants:
 &quot;Keep-Alive: timeout=5, max=99&quot;
 &quot;Keep-Alive: Timeout=5, max=99&quot;     (uppercase &#39;T&#39;)
 &quot;Keep-Alive: Timeout=5 , max=99&quot;    (extra space before comma)
</pre>
  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>kioslave/http/http.cpp <span style="color: grey">(2862707)</span></li>

 <li>kioslave/http/parsinghelpers.cpp <span style="color: grey">(fc75d68)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/102822/diff/" style="margin-left: \
3em;">View Diff</a></p>




  </td>
 </tr>
</table>




  </div>
 </body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic