You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CConn.cxx 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718
  1. /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
  2. * Copyright (C) 2011 D. R. Commander. All Rights Reserved.
  3. * Copyright 2009-2014 Pierre Ossman for Cendio AB
  4. *
  5. * This is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This software is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this software; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  18. * USA.
  19. */
  20. #ifdef HAVE_CONFIG_H
  21. #include <config.h>
  22. #endif
  23. #include <assert.h>
  24. #ifndef _WIN32
  25. #include <unistd.h>
  26. #endif
  27. #include <rfb/CMsgWriter.h>
  28. #include <rfb/CSecurity.h>
  29. #include <rfb/Hostname.h>
  30. #include <rfb/LogWriter.h>
  31. #include <rfb/Security.h>
  32. #include <rfb/util.h>
  33. #include <rfb/screenTypes.h>
  34. #include <rfb/fenceTypes.h>
  35. #include <rfb/Timer.h>
  36. #include <rdr/MemInStream.h>
  37. #include <rdr/MemOutStream.h>
  38. #include <network/TcpSocket.h>
  39. #ifndef WIN32
  40. #include <network/UnixSocket.h>
  41. #endif
  42. #include <FL/Fl.H>
  43. #include <FL/fl_ask.H>
  44. #include "CConn.h"
  45. #include "OptionsDialog.h"
  46. #include "DesktopWindow.h"
  47. #include "PlatformPixelBuffer.h"
  48. #include "i18n.h"
  49. #include "parameters.h"
  50. #include "vncviewer.h"
  51. #ifdef WIN32
  52. #include "win32.h"
  53. #endif
  54. using namespace rdr;
  55. using namespace rfb;
  56. using namespace std;
  57. static rfb::LogWriter vlog("CConn");
  58. // 8 colours (1 bit per component)
  59. static const PixelFormat verylowColourPF(8, 3,false, true,
  60. 1, 1, 1, 2, 1, 0);
  61. // 64 colours (2 bits per component)
  62. static const PixelFormat lowColourPF(8, 6, false, true,
  63. 3, 3, 3, 4, 2, 0);
  64. // 256 colours (2-3 bits per component)
  65. static const PixelFormat mediumColourPF(8, 8, false, true,
  66. 7, 7, 3, 5, 2, 0);
  67. CConn::CConn(const char* vncServerName, network::Socket* socket=NULL)
  68. : serverHost(0), serverPort(0), desktop(NULL),
  69. updateCount(0), pixelCount(0), pendingPFChange(false),
  70. currentEncoding(encodingTight), lastServerEncoding((unsigned int)-1),
  71. formatChange(false), encodingChange(false),
  72. firstUpdate(true), pendingUpdate(false), continuousUpdates(false),
  73. forceNonincremental(true), supportsSyncFence(false)
  74. {
  75. setShared(::shared);
  76. sock = socket;
  77. int encNum = encodingNum(preferredEncoding);
  78. if (encNum != -1)
  79. currentEncoding = encNum;
  80. cp.supportsLocalCursor = true;
  81. cp.supportsDesktopResize = true;
  82. cp.supportsExtendedDesktopSize = true;
  83. cp.supportsDesktopRename = true;
  84. cp.supportsLEDState = true;
  85. if (customCompressLevel)
  86. cp.compressLevel = compressLevel;
  87. else
  88. cp.compressLevel = -1;
  89. if (!noJpeg)
  90. cp.qualityLevel = qualityLevel;
  91. else
  92. cp.qualityLevel = -1;
  93. if(sock == NULL) {
  94. try {
  95. #ifndef WIN32
  96. if (strchr(vncServerName, '/') != NULL) {
  97. sock = new network::UnixSocket(vncServerName);
  98. serverHost = sock->getPeerAddress();
  99. vlog.info(_("connected to socket %s"), serverHost);
  100. } else
  101. #endif
  102. {
  103. getHostAndPort(vncServerName, &serverHost, &serverPort);
  104. sock = new network::TcpSocket(serverHost, serverPort);
  105. vlog.info(_("connected to host %s port %d"), serverHost, serverPort);
  106. }
  107. } catch (rdr::Exception& e) {
  108. vlog.error("%s", e.str());
  109. if (alertOnFatalError)
  110. fl_alert("%s", e.str());
  111. exit_vncviewer();
  112. return;
  113. }
  114. }
  115. Fl::add_fd(sock->getFd(), FL_READ | FL_EXCEPT, socketEvent, this);
  116. // See callback below
  117. sock->inStream().setBlockCallback(this);
  118. setServerName(serverHost);
  119. setStreams(&sock->inStream(), &sock->outStream());
  120. initialiseProtocol();
  121. OptionsDialog::addCallback(handleOptions, this);
  122. }
  123. CConn::~CConn()
  124. {
  125. OptionsDialog::removeCallback(handleOptions);
  126. Fl::remove_timeout(handleUpdateTimeout, this);
  127. if (desktop)
  128. delete desktop;
  129. delete [] serverHost;
  130. if (sock)
  131. Fl::remove_fd(sock->getFd());
  132. delete sock;
  133. }
  134. void CConn::refreshFramebuffer()
  135. {
  136. forceNonincremental = true;
  137. // Without fences, we cannot safely trigger an update request directly
  138. // but must wait for the next update to arrive.
  139. if (supportsSyncFence)
  140. requestNewUpdate();
  141. }
  142. const char *CConn::connectionInfo()
  143. {
  144. static char infoText[1024] = "";
  145. char scratch[100];
  146. char pfStr[100];
  147. // Crude way of avoiding constant overflow checks
  148. assert((sizeof(scratch) + 1) * 10 < sizeof(infoText));
  149. infoText[0] = '\0';
  150. snprintf(scratch, sizeof(scratch),
  151. _("Desktop name: %.80s"), cp.name());
  152. strcat(infoText, scratch);
  153. strcat(infoText, "\n");
  154. snprintf(scratch, sizeof(scratch),
  155. _("Host: %.80s port: %d"), serverHost, serverPort);
  156. strcat(infoText, scratch);
  157. strcat(infoText, "\n");
  158. snprintf(scratch, sizeof(scratch),
  159. _("Size: %d x %d"), cp.width, cp.height);
  160. strcat(infoText, scratch);
  161. strcat(infoText, "\n");
  162. // TRANSLATORS: Will be filled in with a string describing the
  163. // protocol pixel format in a fairly language neutral way
  164. cp.pf().print(pfStr, 100);
  165. snprintf(scratch, sizeof(scratch),
  166. _("Pixel format: %s"), pfStr);
  167. strcat(infoText, scratch);
  168. strcat(infoText, "\n");
  169. // TRANSLATORS: Similar to the earlier "Pixel format" string
  170. serverPF.print(pfStr, 100);
  171. snprintf(scratch, sizeof(scratch),
  172. _("(server default %s)"), pfStr);
  173. strcat(infoText, scratch);
  174. strcat(infoText, "\n");
  175. snprintf(scratch, sizeof(scratch),
  176. _("Requested encoding: %s"), encodingName(currentEncoding));
  177. strcat(infoText, scratch);
  178. strcat(infoText, "\n");
  179. snprintf(scratch, sizeof(scratch),
  180. _("Last used encoding: %s"), encodingName(lastServerEncoding));
  181. strcat(infoText, scratch);
  182. strcat(infoText, "\n");
  183. snprintf(scratch, sizeof(scratch),
  184. _("Line speed estimate: %d kbit/s"), sock->inStream().kbitsPerSecond());
  185. strcat(infoText, scratch);
  186. strcat(infoText, "\n");
  187. snprintf(scratch, sizeof(scratch),
  188. _("Protocol version: %d.%d"), cp.majorVersion, cp.minorVersion);
  189. strcat(infoText, scratch);
  190. strcat(infoText, "\n");
  191. snprintf(scratch, sizeof(scratch),
  192. _("Security method: %s"), secTypeName(csecurity->getType()));
  193. strcat(infoText, scratch);
  194. strcat(infoText, "\n");
  195. return infoText;
  196. }
  197. unsigned CConn::getUpdateCount()
  198. {
  199. return updateCount;
  200. }
  201. unsigned CConn::getPixelCount()
  202. {
  203. return pixelCount;
  204. }
  205. unsigned CConn::getPosition()
  206. {
  207. return sock->inStream().pos();
  208. }
  209. // The RFB core is not properly asynchronous, so it calls this callback
  210. // whenever it needs to block to wait for more data. Since FLTK is
  211. // monitoring the socket, we just make sure FLTK gets to run.
  212. void CConn::blockCallback()
  213. {
  214. run_mainloop();
  215. if (should_exit())
  216. throw rdr::Exception("Termination requested");
  217. }
  218. void CConn::socketEvent(FL_SOCKET fd, void *data)
  219. {
  220. CConn *cc;
  221. static bool recursing = false;
  222. assert(data);
  223. cc = (CConn*)data;
  224. // I don't think processMsg() is recursion safe, so add this check
  225. if (recursing)
  226. return;
  227. recursing = true;
  228. try {
  229. // processMsg() only processes one message, so we need to loop
  230. // until the buffers are empty or things will stall.
  231. do {
  232. cc->processMsg();
  233. // Make sure that the FLTK handling and the timers gets some CPU
  234. // time in case of back to back messages
  235. Fl::check();
  236. Timer::checkTimeouts();
  237. // Also check if we need to stop reading and terminate
  238. if (should_exit())
  239. break;
  240. } while (cc->sock->inStream().checkNoWait(1));
  241. } catch (rdr::EndOfStream& e) {
  242. vlog.info("%s", e.str());
  243. exit_vncviewer();
  244. } catch (rdr::Exception& e) {
  245. vlog.error("%s", e.str());
  246. // Somebody might already have requested us to terminate, and
  247. // might have already provided an error message.
  248. if (!should_exit())
  249. exit_vncviewer(e.str());
  250. }
  251. recursing = false;
  252. }
  253. ////////////////////// CConnection callback methods //////////////////////
  254. // serverInit() is called when the serverInit message has been received. At
  255. // this point we create the desktop window and display it. We also tell the
  256. // server the pixel format and encodings to use and request the first update.
  257. void CConn::serverInit()
  258. {
  259. CConnection::serverInit();
  260. // If using AutoSelect with old servers, start in FullColor
  261. // mode. See comment in autoSelectFormatAndEncoding.
  262. if (cp.beforeVersion(3, 8) && autoSelect)
  263. fullColour.setParam(true);
  264. serverPF = cp.pf();
  265. desktop = new DesktopWindow(cp.width, cp.height, cp.name(), serverPF, this);
  266. fullColourPF = desktop->getPreferredPF();
  267. // Force a switch to the format and encoding we'd like
  268. formatChange = encodingChange = true;
  269. // And kick off the update cycle
  270. requestNewUpdate();
  271. // This initial update request is a bit of a corner case, so we need
  272. // to help out setting the correct format here.
  273. assert(pendingPFChange);
  274. cp.setPF(pendingPF);
  275. pendingPFChange = false;
  276. }
  277. // setDesktopSize() is called when the desktop size changes (including when
  278. // it is set initially).
  279. void CConn::setDesktopSize(int w, int h)
  280. {
  281. CConnection::setDesktopSize(w,h);
  282. resizeFramebuffer();
  283. }
  284. // setExtendedDesktopSize() is a more advanced version of setDesktopSize()
  285. void CConn::setExtendedDesktopSize(unsigned reason, unsigned result,
  286. int w, int h, const rfb::ScreenSet& layout)
  287. {
  288. CConnection::setExtendedDesktopSize(reason, result, w, h, layout);
  289. if ((reason == reasonClient) && (result != resultSuccess)) {
  290. vlog.error(_("SetDesktopSize failed: %d"), result);
  291. return;
  292. }
  293. resizeFramebuffer();
  294. }
  295. // setName() is called when the desktop name changes
  296. void CConn::setName(const char* name)
  297. {
  298. CConnection::setName(name);
  299. if (desktop)
  300. desktop->setName(name);
  301. }
  302. // framebufferUpdateStart() is called at the beginning of an update.
  303. // Here we try to send out a new framebuffer update request so that the
  304. // next update can be sent out in parallel with us decoding the current
  305. // one.
  306. void CConn::framebufferUpdateStart()
  307. {
  308. CConnection::framebufferUpdateStart();
  309. // Note: This might not be true if sync fences are supported
  310. pendingUpdate = false;
  311. requestNewUpdate();
  312. // Update the screen prematurely for very slow updates
  313. Fl::add_timeout(1.0, handleUpdateTimeout, this);
  314. }
  315. // framebufferUpdateEnd() is called at the end of an update.
  316. // For each rectangle, the FdInStream will have timed the speed
  317. // of the connection, allowing us to select format and encoding
  318. // appropriately, and then request another incremental update.
  319. void CConn::framebufferUpdateEnd()
  320. {
  321. CConnection::framebufferUpdateEnd();
  322. updateCount++;
  323. Fl::remove_timeout(handleUpdateTimeout, this);
  324. desktop->updateWindow();
  325. if (firstUpdate) {
  326. // We need fences to make extra update requests and continuous
  327. // updates "safe". See fence() for the next step.
  328. if (cp.supportsFence)
  329. writer()->writeFence(fenceFlagRequest | fenceFlagSyncNext, 0, NULL);
  330. firstUpdate = false;
  331. }
  332. // A format change has been scheduled and we are now past the update
  333. // with the old format. Time to active the new one.
  334. if (pendingPFChange) {
  335. cp.setPF(pendingPF);
  336. pendingPFChange = false;
  337. }
  338. // Compute new settings based on updated bandwidth values
  339. if (autoSelect)
  340. autoSelectFormatAndEncoding();
  341. }
  342. // The rest of the callbacks are fairly self-explanatory...
  343. void CConn::setColourMapEntries(int firstColour, int nColours, rdr::U16* rgbs)
  344. {
  345. vlog.error(_("Invalid SetColourMapEntries from server!"));
  346. }
  347. void CConn::bell()
  348. {
  349. fl_beep();
  350. }
  351. void CConn::serverCutText(const char* str, rdr::U32 len)
  352. {
  353. desktop->serverCutText(str, len);
  354. }
  355. void CConn::dataRect(const Rect& r, int encoding)
  356. {
  357. sock->inStream().startTiming();
  358. if (encoding != encodingCopyRect)
  359. lastServerEncoding = encoding;
  360. CConnection::dataRect(r, encoding);
  361. sock->inStream().stopTiming();
  362. pixelCount += r.area();
  363. }
  364. void CConn::setCursor(int width, int height, const Point& hotspot,
  365. const rdr::U8* data)
  366. {
  367. desktop->setCursor(width, height, hotspot, data);
  368. }
  369. void CConn::fence(rdr::U32 flags, unsigned len, const char data[])
  370. {
  371. CMsgHandler::fence(flags, len, data);
  372. if (flags & fenceFlagRequest) {
  373. // We handle everything synchronously so we trivially honor these modes
  374. flags = flags & (fenceFlagBlockBefore | fenceFlagBlockAfter);
  375. writer()->writeFence(flags, len, data);
  376. return;
  377. }
  378. if (len == 0) {
  379. // Initial probe
  380. if (flags & fenceFlagSyncNext) {
  381. supportsSyncFence = true;
  382. if (cp.supportsContinuousUpdates) {
  383. vlog.info(_("Enabling continuous updates"));
  384. continuousUpdates = true;
  385. writer()->writeEnableContinuousUpdates(true, 0, 0, cp.width, cp.height);
  386. }
  387. }
  388. } else {
  389. // Pixel format change
  390. rdr::MemInStream memStream(data, len);
  391. PixelFormat pf;
  392. pf.read(&memStream);
  393. cp.setPF(pf);
  394. }
  395. }
  396. void CConn::setLEDState(unsigned int state)
  397. {
  398. CConnection::setLEDState(state);
  399. desktop->setLEDState(state);
  400. }
  401. ////////////////////// Internal methods //////////////////////
  402. void CConn::resizeFramebuffer()
  403. {
  404. if (!desktop)
  405. return;
  406. if (continuousUpdates)
  407. writer()->writeEnableContinuousUpdates(true, 0, 0, cp.width, cp.height);
  408. desktop->resizeFramebuffer(cp.width, cp.height);
  409. }
  410. // autoSelectFormatAndEncoding() chooses the format and encoding appropriate
  411. // to the connection speed:
  412. //
  413. // First we wait for at least one second of bandwidth measurement.
  414. //
  415. // Above 16Mbps (i.e. LAN), we choose the second highest JPEG quality,
  416. // which should be perceptually lossless.
  417. //
  418. // If the bandwidth is below that, we choose a more lossy JPEG quality.
  419. //
  420. // If the bandwidth drops below 256 Kbps, we switch to palette mode.
  421. //
  422. // Note: The system here is fairly arbitrary and should be replaced
  423. // with something more intelligent at the server end.
  424. //
  425. void CConn::autoSelectFormatAndEncoding()
  426. {
  427. int kbitsPerSecond = sock->inStream().kbitsPerSecond();
  428. unsigned int timeWaited = sock->inStream().timeWaited();
  429. bool newFullColour = fullColour;
  430. int newQualityLevel = qualityLevel;
  431. // Always use Tight
  432. if (currentEncoding != encodingTight) {
  433. currentEncoding = encodingTight;
  434. encodingChange = true;
  435. }
  436. // Check that we have a decent bandwidth measurement
  437. if ((kbitsPerSecond == 0) || (timeWaited < 10000))
  438. return;
  439. // Select appropriate quality level
  440. if (!noJpeg) {
  441. if (kbitsPerSecond > 16000)
  442. newQualityLevel = 8;
  443. else
  444. newQualityLevel = 6;
  445. if (newQualityLevel != qualityLevel) {
  446. vlog.info(_("Throughput %d kbit/s - changing to quality %d"),
  447. kbitsPerSecond, newQualityLevel);
  448. cp.qualityLevel = newQualityLevel;
  449. qualityLevel.setParam(newQualityLevel);
  450. encodingChange = true;
  451. }
  452. }
  453. if (cp.beforeVersion(3, 8)) {
  454. // Xvnc from TightVNC 1.2.9 sends out FramebufferUpdates with
  455. // cursors "asynchronously". If this happens in the middle of a
  456. // pixel format change, the server will encode the cursor with
  457. // the old format, but the client will try to decode it
  458. // according to the new format. This will lead to a
  459. // crash. Therefore, we do not allow automatic format change for
  460. // old servers.
  461. return;
  462. }
  463. // Select best color level
  464. newFullColour = (kbitsPerSecond > 256);
  465. if (newFullColour != fullColour) {
  466. vlog.info(_("Throughput %d kbit/s - full color is now %s"),
  467. kbitsPerSecond,
  468. newFullColour ? _("enabled") : _("disabled"));
  469. fullColour.setParam(newFullColour);
  470. formatChange = true;
  471. }
  472. }
  473. // checkEncodings() sends a setEncodings message if one is needed.
  474. void CConn::checkEncodings()
  475. {
  476. if (encodingChange && writer()) {
  477. vlog.info(_("Using %s encoding"),encodingName(currentEncoding));
  478. writer()->writeSetEncodings(currentEncoding, true);
  479. encodingChange = false;
  480. }
  481. }
  482. // requestNewUpdate() requests an update from the server, having set the
  483. // format and encoding appropriately.
  484. void CConn::requestNewUpdate()
  485. {
  486. if (formatChange) {
  487. PixelFormat pf;
  488. /* Catch incorrect requestNewUpdate calls */
  489. assert(!pendingUpdate || supportsSyncFence);
  490. if (fullColour) {
  491. pf = fullColourPF;
  492. } else {
  493. if (lowColourLevel == 0)
  494. pf = verylowColourPF;
  495. else if (lowColourLevel == 1)
  496. pf = lowColourPF;
  497. else
  498. pf = mediumColourPF;
  499. }
  500. if (supportsSyncFence) {
  501. // We let the fence carry the pixel format and switch once we
  502. // get the response back. That way we will be synchronised with
  503. // when the server switches.
  504. rdr::MemOutStream memStream;
  505. pf.write(&memStream);
  506. writer()->writeFence(fenceFlagRequest | fenceFlagSyncNext,
  507. memStream.length(), (const char*)memStream.data());
  508. } else {
  509. // New requests are sent out at the start of processing the last
  510. // one, so we cannot switch our internal format right now (doing so
  511. // would mean misdecoding the current update).
  512. pendingPFChange = true;
  513. pendingPF = pf;
  514. }
  515. char str[256];
  516. pf.print(str, 256);
  517. vlog.info(_("Using pixel format %s"),str);
  518. writer()->writeSetPixelFormat(pf);
  519. formatChange = false;
  520. }
  521. checkEncodings();
  522. if (forceNonincremental || !continuousUpdates) {
  523. pendingUpdate = true;
  524. writer()->writeFramebufferUpdateRequest(Rect(0, 0, cp.width, cp.height),
  525. !forceNonincremental);
  526. }
  527. forceNonincremental = false;
  528. }
  529. void CConn::handleOptions(void *data)
  530. {
  531. CConn *self = (CConn*)data;
  532. // Checking all the details of the current set of encodings is just
  533. // a pain. Assume something has changed, as resending the encoding
  534. // list is cheap. Avoid overriding what the auto logic has selected
  535. // though.
  536. if (!autoSelect) {
  537. int encNum = encodingNum(preferredEncoding);
  538. if (encNum != -1)
  539. self->currentEncoding = encNum;
  540. }
  541. self->cp.supportsLocalCursor = true;
  542. if (customCompressLevel)
  543. self->cp.compressLevel = compressLevel;
  544. else
  545. self->cp.compressLevel = -1;
  546. if (!noJpeg && !autoSelect)
  547. self->cp.qualityLevel = qualityLevel;
  548. else
  549. self->cp.qualityLevel = -1;
  550. self->encodingChange = true;
  551. // Format changes refreshes the entire screen though and are therefore
  552. // very costly. It's probably worth the effort to see if it is necessary
  553. // here.
  554. PixelFormat pf;
  555. if (fullColour) {
  556. pf = self->fullColourPF;
  557. } else {
  558. if (lowColourLevel == 0)
  559. pf = verylowColourPF;
  560. else if (lowColourLevel == 1)
  561. pf = lowColourPF;
  562. else
  563. pf = mediumColourPF;
  564. }
  565. if (!pf.equal(self->cp.pf())) {
  566. self->formatChange = true;
  567. // Without fences, we cannot safely trigger an update request directly
  568. // but must wait for the next update to arrive.
  569. if (self->supportsSyncFence)
  570. self->requestNewUpdate();
  571. }
  572. }
  573. void CConn::handleUpdateTimeout(void *data)
  574. {
  575. CConn *self = (CConn *)data;
  576. assert(self);
  577. self->desktop->updateWindow();
  578. Fl::repeat_timeout(1.0, handleUpdateTimeout, data);
  579. }