<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="https://git.reviewboard.kde.org/r/115499/">https://git.reviewboard.kde.org/r/115499/</a>
     </td>
    </tr>
   </table>
   <br />










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On February 17th, 2014, 9:32 p.m. UTC, <b>George Kiagiadakis</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  



<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="https://git.reviewboard.kde.org/r/115499/diff/1/?file=242079#file242079line1045" style="color: black; font-weight: bold; text-decoration: underline;">libvncserver/main.c</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 rfbInitServer(rfbScreenInfoPtr screen)</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">1045</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="k">while</span><span class="p">(</span> <span class="p">(</span><span class="n">cl</span> <span class="o">=</span> <span class="n">rfbClientIteratorNext</span><span class="p">(</span><span class="n">iter</span><span class="p">))</span> <span class="p">)</span></pre></td>
    <th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1045</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="k">while</span><span class="p">(</span> <span class="p">(</span><span class="n">cl</span> <span class="o">=</span> <span class="n">rfbClientIteratorNext</span><span class="p">(</span><span class="n">iter</span><span class="p">))</span> <span class="p">)</span><span class="hl"> </span><span class="p"><span class="hl">{</span></span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">1046</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">cl</span><span class="o">-></span><span class="n">sock</span> <span class="o">></span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span></pre></td>
    <th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1046</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">cl</span><span class="o">-></span><span class="n">sock</span> <span class="o">></span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span><span class="hl"> </span><span class="p"><span class="hl">{</span></span></pre></td>
  </tr>

 </tbody>


 
 

 <tbody>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">1047</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb">   </span><span class="cm">/* we don't care about maxfd here, because the server goes away */</span></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1047</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            <span class="cm">/* we don't care about maxfd here, because the server goes away */</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">1048</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb">   </span><span class="n">rfbCloseClient</span><span class="p">(</span><span class="n">cl</span><span class="p">);</span></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1048</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            <span class="n">rfbCloseClient</span><span class="p">(</span><span class="n">cl</span><span class="p">);</span></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">1049</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            <span class="n">rfbClientConnectionGone</span><span class="p">(</span><span class="n">cl</span><span class="p">);</span></pre></td>
  </tr>

  <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">1050</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="p">}</span></pre></td>
  </tr>

  <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">1051</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="p">}</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I'd rather avoid this change. Can't we force clients to disconnect from somewhere else in the krfb code? We should avoid changing libvncserver, as it is an external library and I was hoping that I could remove it from krfb and use the upstream one bundled with distributions. The only reason it exists here is because I needed to patch it a couple of years ago, but all my patches are now in version 0.9.9 upstream, so I want to remove it if possible.</pre>
 </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The issue here is that rfbClientConnectionGone must be called on all the clients that are associated with the server, when we are stopping the server.
Now the server doesn't maintain the list of clients, and just calls rfbShutdownServer which iterates over the clients, calling rfbCloseClient on each. It misses calling rfbClientConnectionGone.

In case of closing the application, RfbServerManager's cleanup is responsible for calling stop() (via destructor). In such a case, RfbServerManager still has the client in it's list since the method stated above wasn't called which includes call to CLIENT_GONE_HOOK. 

We could add call to rfbClientConnectionGone for clients in the RfbServerManager's code, but then that will be invoked only when application is closing. We need to be able to start/stop server on user request.</pre>
<br />




<p>- Amandeep</p>


<br />
<p>On February 5th, 2014, 3:51 p.m. UTC, Amandeep Singh wrote:</p>








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

<div>Review request for Telepathy and George Kiagiadakis.</div>
<div>By Amandeep Singh.</div>


<p style="color: grey;"><i>Updated Feb. 5, 2014, 3:51 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
krfb
</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;">Season of KDE Project - KRFB

Status Quo
-----------
Currently KRFB works on an invite-only model, where the host user needs to create an invite via the Invitation Dialog.
This provides the connection details (address and password), which must then be communicated to the remote user.
No information about telepathy contacts with whom desktop can be shared is present in the KRFB Dialog.
The implementation of RFB also lacks support of clipboard operations like cut and paste of text.

Changes
-------
Krfb modified to move away from invite-model, and modeled as a service that can be started/stopped.
Bidirectional text-clipboard operations are supported.
Telepathy contacts with rfb capability shown inside main window, with an option to share desktop.
Desktop sharing password visible in main window, with option to change it.
Unattended Access allowed with separate password.
Fixed bugs in libvncserver responsible for KRFB crashing.
Krfb now runs as KUniqueApplication.

All changes are present in the following clone of KRFB

Repository
----------
http://quickgit.kde.org/?p=clones%2Fkrfb%2Famandeepsingh%2Fkrfb-sok.git</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>CMakeLists.txt <span style="color: grey">(78c19b3)</span></li>

 <li>cmake/modules/FindKTp.cmake <span style="color: grey">(PRE-CREATION)</span></li>

 <li>krfb/CMakeLists.txt <span style="color: grey">(bbc508d)</span></li>

 <li>krfb/invitation.h <span style="color: grey">(27dddeb)</span></li>

 <li>krfb/invitation.cpp <span style="color: grey">(5379060)</span></li>

 <li>krfb/invitationmanager.h <span style="color: grey">(a611e48)</span></li>

 <li>krfb/invitationmanager.cpp <span style="color: grey">(b9abe94)</span></li>

 <li>krfb/invitationsrfbclient.h <span style="color: grey">(f263f64)</span></li>

 <li>krfb/invitationsrfbclient.cpp <span style="color: grey">(bd5cff8)</span></li>

 <li>krfb/invitationsrfbserver.h <span style="color: grey">(9faecb6)</span></li>

 <li>krfb/invitationsrfbserver.cpp <span style="color: grey">(47ed934)</span></li>

 <li>krfb/invitedialog.h <span style="color: grey">(3e45bb1)</span></li>

 <li>krfb/invitedialog.cpp <span style="color: grey">(e911fdb)</span></li>

 <li>krfb/krfb.desktop <span style="color: grey">(41d0fae)</span></li>

 <li>krfb/krfb.kcfg <span style="color: grey">(acae17f)</span></li>

 <li>krfb/main.cpp <span style="color: grey">(8803baa)</span></li>

 <li>krfb/mainwindow.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>krfb/mainwindow.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>krfb/manageinvitationsdialog.h <span style="color: grey">(3740ebc)</span></li>

 <li>krfb/manageinvitationsdialog.cpp <span style="color: grey">(2c786a3)</span></li>

 <li>krfb/pendingrfbclient.h <span style="color: grey">(c0524fe)</span></li>

 <li>krfb/pendingrfbclient.cpp <span style="color: grey">(c16b045)</span></li>

 <li>krfb/personalinvitedialog.h <span style="color: grey">(caadbb9)</span></li>

 <li>krfb/personalinvitedialog.cpp <span style="color: grey">(2851678)</span></li>

 <li>krfb/rfbclient.h <span style="color: grey">(7b46d3f)</span></li>

 <li>krfb/rfbclient.cpp <span style="color: grey">(9ab16eb)</span></li>

 <li>krfb/rfbserver.h <span style="color: grey">(6ef73e4)</span></li>

 <li>krfb/rfbserver.cpp <span style="color: grey">(cd5d6c0)</span></li>

 <li>krfb/trayicon.cpp <span style="color: grey">(02ae7af)</span></li>

 <li>krfb/tubesrfbclient.h <span style="color: grey">(3908e47)</span></li>

 <li>krfb/tubesrfbclient.cpp <span style="color: grey">(2466826)</span></li>

 <li>krfb/tubesrfbserver.h <span style="color: grey">(596636c)</span></li>

 <li>krfb/tubesrfbserver.cpp <span style="color: grey">(575c3cd)</span></li>

 <li>krfb/ui/configsecurity.ui <span style="color: grey">(4afbb58)</span></li>

 <li>krfb/ui/mainwidget.ui <span style="color: grey">(PRE-CREATION)</span></li>

 <li>krfb/ui/manageinvitations.ui <span style="color: grey">(f727af6)</span></li>

 <li>krfb/ui/personalinvitewidget.ui <span style="color: grey">(5d12c2a)</span></li>

 <li>libvncserver/main.c <span style="color: grey">(b47e873)</span></li>

 <li>libvncserver/sockets.c <span style="color: grey">(e54252d)</span></li>

</ul>

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







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








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