diff options
author | runge <runge> | 2007-09-11 20:15:38 +0000 |
---|---|---|
committer | runge <runge> | 2007-09-11 20:15:38 +0000 |
commit | 115e935f72b58e72598c7fccf17364d6cd2fa5a1 (patch) | |
tree | 1ce24590ac497725cb977dfc08ee363773928e89 /x11vnc/connections.c | |
parent | 6a6d26a74701179672d59bfd153cc1a2e92e96bd (diff) | |
download | libtdevnc-115e935f72b58e72598c7fccf17364d6cd2fa5a1.tar.gz libtdevnc-115e935f72b58e72598c7fccf17364d6cd2fa5a1.zip |
x11vnc: fix wireframe crash under -clip. Add -redirect for
VNC redir. -rawfb nullbig, randbig, solid, swirl, etc.
FD_XDM mode to find_display. -listdpy. Add enlightenment.
Xvnc.redirect FINDDISPLAY-vnc_redirect. -xvnc, -xvnc_redirect,
-svc_xvnc. AUTO_PORT.
Diffstat (limited to 'x11vnc/connections.c')
-rw-r--r-- | x11vnc/connections.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/x11vnc/connections.c b/x11vnc/connections.c index b26c790..7d58a54 100644 --- a/x11vnc/connections.c +++ b/x11vnc/connections.c @@ -372,12 +372,13 @@ int cmd_ok(char *cmd) { int run_user_command(char *cmd, rfbClientPtr client, char *mode, char *input, int len, FILE *output) { char *old_display = NULL; - char *addr = client->host; + char *addr = NULL; char str[100]; int rc, ok; ClientData *cd = NULL; if (client != NULL) { cd = (ClientData *) client->clientData; + addr = client->host; } if (addr == NULL || addr[0] == '\0') { @@ -400,7 +401,9 @@ int run_user_command(char *cmd, rfbClientPtr client, char *mode, char *input, sprintf(str, "%d", (int) getpid()); set_env("RFB_X11VNC_PID", str); - if (client->state == RFB_PROTOCOL_VERSION) { + if (client == NULL) { + ; + } else if (client->state == RFB_PROTOCOL_VERSION) { set_env("RFB_STATE", "PROTOCOL_VERSION"); } else if (client->state == RFB_SECURITY_TYPE) { set_env("RFB_STATE", "SECURITY_TYPE"); @@ -422,7 +425,7 @@ int run_user_command(char *cmd, rfbClientPtr client, char *mode, char *input, /* set RFB_CLIENT_PORT to peer port for command to use */ if (cd && cd->client_port > 0) { sprintf(str, "%d", cd->client_port); - } else { + } else if (client) { sprintf(str, "%d", get_remote_port(client->sock)); } set_env("RFB_CLIENT_PORT", str); @@ -437,7 +440,7 @@ int run_user_command(char *cmd, rfbClientPtr client, char *mode, char *input, */ if (cd && cd->server_ip) { set_env("RFB_SERVER_IP", cd->server_ip); - } else { + } else if (client) { char *sip = get_local_host(client->sock); set_env("RFB_SERVER_IP", sip); if (sip) free(sip); @@ -445,7 +448,7 @@ int run_user_command(char *cmd, rfbClientPtr client, char *mode, char *input, if (cd && cd->server_port > 0) { sprintf(str, "%d", cd->server_port); - } else { + } else if (client) { sprintf(str, "%d", get_local_port(client->sock)); } set_env("RFB_SERVER_PORT", str); |