summaryrefslogtreecommitdiffstats
path: root/krfb/libvncserver/stats.c
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2015-01-10 16:02:54 -0600
committerTimothy Pearson <[email protected]>2015-01-10 16:02:54 -0600
commitf6187cc4eb8a8726f5b64f0c640ac8d2355b85eb (patch)
treed5c3b93286335d890339446d15e35c9cc97703d1 /krfb/libvncserver/stats.c
parentdedd07e78dee71fd8cde6a39e2ccc89fdbb8a782 (diff)
downloadtdenetwork-f6187cc4eb8a8726f5b64f0c640ac8d2355b85eb.tar.gz
tdenetwork-f6187cc4eb8a8726f5b64f0c640ac8d2355b85eb.zip
Port to standard shared libvncserver and delete old buggy libvncserver library sources
Note that this DOES NOT WORK as some TDE-specific changes to libvncserver will be required The commit is a "clean slate" for the TDE-specific changes to follow
Diffstat (limited to 'krfb/libvncserver/stats.c')
-rw-r--r--krfb/libvncserver/stats.c103
1 files changed, 0 insertions, 103 deletions
diff --git a/krfb/libvncserver/stats.c b/krfb/libvncserver/stats.c
deleted file mode 100644
index 954e6d14..00000000
--- a/krfb/libvncserver/stats.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * stats.c
- */
-
-/*
- * OSXvnc Copyright (C) 2001 Dan McGuirk <[email protected]>.
- * Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.
- * All Rights Reserved.
- *
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- * USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "rfb.h"
-
-static const char* encNames[] = {
- "raw", "copyRect", "RRE", "[encoding 3]", "CoRRE", "hextile",
- "zlib", "tight", "[encoding 8]", "[encoding 9]"
-};
-
-
-void
-rfbResetStats(rfbClientPtr cl)
-{
- int i;
- for (i = 0; i < MAX_ENCODINGS; i++) {
- cl->rfbBytesSent[i] = 0;
- cl->rfbRectanglesSent[i] = 0;
- }
- cl->rfbLastRectMarkersSent = 0;
- cl->rfbLastRectBytesSent = 0;
- cl->rfbCursorBytesSent = 0;
- cl->rfbCursorUpdatesSent = 0;
- cl->rfbFramebufferUpdateMessagesSent = 0;
- cl->rfbRawBytesEquivalent = 0;
- cl->rfbKeyEventsRcvd = 0;
- cl->rfbPointerEventsRcvd = 0;
-}
-
-void
-rfbPrintStats(rfbClientPtr cl)
-{
- int i;
- int totalRectanglesSent = 0;
- int totalBytesSent = 0;
-
- rfbLog("Statistics:\n");
-
- if ((cl->rfbKeyEventsRcvd != 0) || (cl->rfbPointerEventsRcvd != 0))
- rfbLog(" key events received %d, pointer events %d\n",
- cl->rfbKeyEventsRcvd, cl->rfbPointerEventsRcvd);
-
- for (i = 0; i < MAX_ENCODINGS; i++) {
- totalRectanglesSent += cl->rfbRectanglesSent[i];
- totalBytesSent += cl->rfbBytesSent[i];
- }
-
- totalRectanglesSent += (cl->rfbCursorUpdatesSent +
- cl->rfbLastRectMarkersSent);
- totalBytesSent += (cl->rfbCursorBytesSent + cl->rfbLastRectBytesSent);
-
- rfbLog(" framebuffer updates %d, rectangles %d, bytes %d\n",
- cl->rfbFramebufferUpdateMessagesSent, totalRectanglesSent,
- totalBytesSent);
-
- if (cl->rfbLastRectMarkersSent != 0)
- rfbLog(" LastRect markers %d, bytes %d\n",
- cl->rfbLastRectMarkersSent, cl->rfbLastRectBytesSent);
-
- if (cl->rfbCursorUpdatesSent != 0)
- rfbLog(" cursor shape updates %d, bytes %d\n",
- cl->rfbCursorUpdatesSent, cl->rfbCursorBytesSent);
-
- for (i = 0; i < MAX_ENCODINGS; i++) {
- if (cl->rfbRectanglesSent[i] != 0)
- rfbLog(" %s rectangles %d, bytes %d\n",
- encNames[i], cl->rfbRectanglesSent[i], cl->rfbBytesSent[i]);
- }
-
- if ((totalBytesSent - cl->rfbBytesSent[rfbEncodingCopyRect]) != 0) {
- rfbLog(" raw bytes equivalent %d, compression ratio %f\n",
- cl->rfbRawBytesEquivalent,
- (double)cl->rfbRawBytesEquivalent
- / (double)(totalBytesSent
- - cl->rfbBytesSent[rfbEncodingCopyRect]-
- cl->rfbCursorBytesSent -
- cl->rfbLastRectBytesSent));
- }
-}