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

List:       kde-core-devel
Subject:    Re: Review Request: Fix for connecting to FTP sites through HTTP proxy
From:       "David Faure" <faure () kde ! org>
Date:       2011-03-07 18:26:28
Message-ID: 20110307182628.14153.10647 () vidsolbach ! de
[Download RAW message or body]

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



kparts/browserrun.cpp
<http://git.reviewboard.kde.org/r/100814/#comment1506>

    For speed reasons, we could do the proxy-determination (which is what \
slaveProtocol does) only for protocols (such as FTP) where the proxy is a different \
protocol (such as HTTP).  
    findProtocol in kprotocolmanager.cpp shows us how: with a 
    if (!KProtocolInfo::proxiedBy(url.protocol()).isEmpty()) {} around the call to \
slaveProtocol.



kparts/browserrun.cpp
<http://git.reviewboard.kde.org/r/100814/#comment1504>

    null check should not be necessary, findByUrl never returns 0.
    (OK it does if no mimetypes are installed at all, but that's never supposed to \
happen, and isn't a supported use case anyway).


- David


On March 7, 2011, 5:32 p.m., Dawit Alemayehu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/100814/
> -----------------------------------------------------------
> 
> (Updated March 7, 2011, 5:32 p.m.)
> 
> 
> Review request for kdelibs.
> 
> 
> Summary
> -------
> 
> The attached patch fixes accessing FTP sites through HTTP proxy servers for KDE \
> based browsers, such as Konqueror, only. Why only browsers ? Because FTP over HTTP \
> proxy sends back HTML pages and not file items. As such, the returned result cannot \
> be shown in Dolphin or any application or dialog that relies on the dolphin part. 
> There is however a much larger issue here that this patch does not address. How to \
> support connections to FTP sites in all apps/dialogs that use the dolphinpart when \
> such requests are routed through an HTTP proxy ? There is a possibility of using \
> proxy tunneling like it is done for HTTPS over HTTP proxy. However, that would \
> require kio_ftp being changed to support connecting to an HTTP proxy server. Not a \
> minor change. The other option I can think of is to modify the dolphinpart to parse \
> the HTML file returned in such cases and create file items out of them, but that \
> too is not a complicated solution. 
> Anyhow, regardless of what could or could not be done to resolve that issue in the \
> future, I think that the dolphinpart should at least should check to see if the ftp \
> request is going over proxy (KProtocolManager::slaveProtocol) and inform the user \
> such action is not supported. 
> 
> This addresses bug 236630.
> http://bugs.kde.org/show_bug.cgi?id=236630
> 
> 
> Diffs
> -----
> 
> kioslave/http/http.cpp 0579382 
> kparts/browserrun.cpp 3a062d2 
> 
> Diff: http://git.reviewboard.kde.org/r/100814/diff
> 
> 
> Testing
> -------
> 
> Used Konqueror to connect to FTP sites through a local proxy server.
> 
> 
> Thanks,
> 
> Dawit
> 
> 


[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/100814/">http://git.reviewboard.kde.org/r/100814/</a>
  </td>
    </tr>
   </table>
   <br />









<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="http://git.reviewboard.kde.org/r/100814/diff/1/?file=10681#file10681line124" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kparts/browserrun.cpp</a>  <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">void \
BrowserRun::scanFile()</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">124</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">  <span \
class="k">const</span> <span class="n">QString</span> <span class="n">protocol</span> \
<span class="o">=</span> <span class="n">KProtocolManager</span><span \
class="o">::</span><span class="n">slaveProtocol</span><span class="p">(</span><span \
class="n">KRun</span><span class="o">::</span><span class="n">url</span><span \
class="p">(),</span> <span class="n">dummy</span><span class="p">);</span></pre></td> \
</tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">For speed \
reasons, we could do the proxy-determination (which is what slaveProtocol does) only \
for protocols (such as FTP) where the proxy is a different protocol (such as HTTP).

findProtocol in kprotocolmanager.cpp shows us how: with a 
if (!KProtocolInfo::proxiedBy(url.protocol()).isEmpty()) {} around the call to \
slaveProtocol.</pre> </div>
<br />

<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="http://git.reviewboard.kde.org/r/100814/diff/1/?file=10681#file10681line129" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kparts/browserrun.cpp</a>  <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">void \
BrowserRun::scanFile()</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">127</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="k">if</span> \
<span class="p">(</span><span class="hl"> </span><span class="o">!</span><span \
class="n">mime</span><span class="o">-&gt;</span><span \
class="n">isDefault</span><span class="p">()</span> <span class="o">||</span> <span \
class="n">isLocalFile</span><span class="p">()</span> <span class="p"><span \
class="hl">)</span></span></pre></td>  <th bgcolor="#e9eaa8" style="border-left: 1px \
solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font \
size="2">129</font></th>  <td bgcolor="#fdfebc" width="50%"><pre style="font-size: \
8pt; line-height: 140%; margin: 0; ">    <span class="k">if</span> <span \
class="p">(</span><span class="n"><span class="hl">mime</span></span><span \
class="hl"> </span><span class="o"><span class="hl">&amp;&amp;</span></span><span \
class="hl"> </span><span class="p"><span class="hl">(</span></span><span \
class="o">!</span><span class="n">mime</span><span class="o">-&gt;</span><span \
class="n">isDefault</span><span class="p">()</span> <span class="o">||</span> <span \
class="n">isLocalFile</span><span class="p">()<span \
class="hl">))</span></span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">null check \
should not be necessary, findByUrl never returns 0. (OK it does if no mimetypes are \
installed at all, but that&#39;s never supposed to happen, and isn&#39;t a supported \
use case anyway).</pre> </div>
<br />



<p>- David</p>


<br />
<p>On March 7th, 2011, 5:32 p.m., Dawit Alemayehu wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.orgrb/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.</div>
<div>By Dawit Alemayehu.</div>


<p style="color: grey;"><i>Updated March 7, 2011, 5:32 p.m.</i></p>




<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;">The attached patch fixes accessing FTP sites through HTTP proxy servers \
for KDE based browsers, such as Konqueror, only. Why only browsers ? Because FTP over \
HTTP proxy sends back HTML pages and not file items. As such, the returned result \
cannot be shown in Dolphin or any application or dialog that relies on the dolphin \
part.

There is however a much larger issue here that this patch does not address. How to \
support connections to FTP sites in all apps/dialogs that use the dolphinpart when \
such requests are routed through an HTTP proxy ? There is a possibility of using \
proxy tunneling like it is done for HTTPS over HTTP proxy. However, that would \
require kio_ftp being changed to support connecting to an HTTP proxy server. Not a \
minor change. The other option I can think of is to modify the dolphinpart to parse \
the HTML file returned in such cases and create file items out of them, but that too \
is not a complicated solution.

Anyhow, regardless of what could or could not be done to resolve that issue in the \
future, I think that the dolphinpart should at least should check to see if the ftp \
request is going over proxy (KProtocolManager::slaveProtocol) and inform the user \
such action is not supported.</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;">Used Konqueror to connect to FTP sites through a local proxy \
server.</pre>  </td>
 </tr>
</table>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="http://bugs.kde.org/show_bug.cgi?id=236630">236630</a>


</div>


<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">(0579382)</span></li>

 <li>kparts/browserrun.cpp <span style="color: grey">(3a062d2)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/100814/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