aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--drv_vnc.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/drv_vnc.c b/drv_vnc.c
index 72051f0..6e12b95 100644
--- a/drv_vnc.c
+++ b/drv_vnc.c
@@ -69,6 +69,7 @@ static rfbScreenInfoPtr server;
static int xres = 320;
static int yres = 200;
static int BPP = 4;
+static int max_clients = 2;
static int clientCount = 0;
@@ -81,10 +82,15 @@ static void clientgone(rfbClientPtr cl)
static enum rfbNewClientAction newclient(rfbClientPtr cl)
{
- cl->clientGoneHook = clientgone;
- clientCount++;
- debug("%d clients connected\n", clientCount);
- return RFB_CLIENT_ACCEPT;
+ if (clientCount < max_clients) {
+ clientCount++;
+ cl->clientGoneHook = clientgone;
+ debug("%d clients connected\n", clientCount);
+ return RFB_CLIENT_ACCEPT;
+ } else {
+ info("client refused due max. client connections (%d)\n", clientCount);
+ return RFB_CLIENT_REFUSE;
+ }
}
/* handle mouse action */
@@ -103,7 +109,7 @@ static void doptr(int buttonMask, int x, int y, rfbClientPtr cl)
static int drv_vnc_open(const char *Section)
{
if (cfg_number(Section, "xres", 320, 32, 2048, &xres) < 1) {
- info("[DRV_VNC] no '%s.xres' entry from %s using default %d", Section, cfg_source(), xres);
+ info("[DRV_VNC] no '%s.xres' entry frXom %s using default %d", Section, cfg_source(), xres);
}
if (cfg_number(Section, "yres", 200, 32, 2048, &yres) < 1) {
info("[DRV_VNC] no '%s.yres' entry from %s using default %d", Section, cfg_source(), yres);
@@ -111,6 +117,9 @@ static int drv_vnc_open(const char *Section)
if (cfg_number(Section, "bpp", 4, 1, 4, &BPP) < 1) {
info("[DRV_VNC] no '%s.bpp' entry from %s using default %d", Section, cfg_source(), BPP);
}
+ if (cfg_number(Section, "maxclients", 2, 1, 64, &max_clients) < 1) {
+ info("[DRV_VNC] no '%s.maxclients' entry from %s using default %d", Section, cfg_source(), max_clients);
+ }
return 0;
}
@@ -141,9 +150,10 @@ static void drv_vnc_blit_it(const int row, const int col, const int height, cons
static void drv_vnc_blit(const int row, const int col, const int height, const int width)
{
- if (rfbIsActive(server)) {
+ if (rfbIsActive(server)) {
drv_vnc_blit_it(row, col, height, width, (unsigned char *) server->frameBuffer);
+
if (clientCount > 0) {
rfbMarkRectAsModified(server, 0, 0, xres, yres);
}
@@ -186,7 +196,6 @@ static int drv_vnc_start(const char *section)
server->frameBuffer = (char *) malloc(xres * yres * BPP);
server->alwaysShared = (1 == 1);
server->ptrAddEvent = doptr;
-// server->kbdAddEvent = dokey;
server->newClientHook = newclient;
/* Initialize the server */
ux.git/commit/lcd4linux.conf.sample?id=c0d32e02c2ef7a009bc236a1b333a8dd25e9029e&follow=1'>[lcd4linux @ 2004-06-07 07:02:13 by reinelt]reinelt1-0/+33 2004-06-07[lcd4linux @ 2004-06-07 06:56:55 by reinelt]reinelt5-7/+149 2004-06-06[lcd4linux @ 2004-06-06 06:51:59 by reinelt]reinelt16-52/+135 2004-06-05[lcd4linux @ 2004-06-05 14:56:48 by reinelt]reinelt3-24/+37 2004-06-05[lcd4linux @ 2004-06-05 06:41:39 by reinelt]reinelt11-42/+87 2004-06-05[lcd4linux @ 2004-06-05 06:13:11 by reinelt]reinelt9-69/+327 2004-06-02[lcd4linux @ 2004-06-02 10:09:22 by reinelt]reinelt4-180/+183 2004-06-02[lcd4linux @ 2004-06-02 09:41:19 by reinelt]reinelt18-114/+211 2004-06-02[lcd4linux @ 2004-06-02 05:56:25 by reinelt]reinelt1-2/+6 2004-06-02[lcd4linux @ 2004-06-02 05:35:55 by reinelt]reinelt1-0/+20 2004-06-02[lcd4linux @ 2004-06-02 05:27:59 by reinelt]reinelt26-0/+2405 2004-06-02[lcd4linux @ 2004-06-02 05:14:16 by reinelt]reinelt2-17/+31 2004-06-01[lcd4linux @ 2004-06-01 06:45:28 by reinelt]reinelt18-71/+241 2004-06-01[lcd4linux @ 2004-06-01 06:04:25 by reinelt]reinelt2-25/+25 2004-05-31[lcd4linux @ 2004-05-31 21:23:16 by reinelt]reinelt1-37/+49 2004-05-31[lcd4linux @ 2004-05-31 21:05:13 by reinelt]reinelt5-77/+111 2004-05-31[lcd4linux @ 2004-05-31 16:39:05 by reinelt]reinelt11-180/+535 2004-05-31[lcd4linux @ 2004-05-31 06:27:34 by reinelt]reinelt1-0/+40 2004-05-31[lcd4linux @ 2004-05-31 06:24:42 by reinelt]reinelt2-7/+29 2004-05-31[lcd4linux @ 2004-05-31 05:38:02 by reinelt]reinelt8-42/+94 2004-05-31[lcd4linux @ 2004-05-31 01:31:01 by andy-b]andy-b1-10/+12 2004-05-30[lcd4linux @ 2004-05-30 08:25:50 by reinelt]reinelt2-30/+92 2004-05-29[lcd4linux @ 2004-05-29 23:30:20 by reinelt]reinelt1-1/+9 2004-05-29[lcd4linux @ 2004-05-29 15:53:28 by reinelt]reinelt3-9/+25 2004-05-29[lcd4linux @ 2004-05-29 01:07:56 by reinelt]reinelt2-21/+25 2004-05-29[lcd4linux @ 2004-05-29 00:27:14 by reinelt]reinelt8-11/+214 2004-05-28[lcd4linux @ 2004-05-28 14:38:10 by reinelt]reinelt2-1/+41