summaryrefslogtreecommitdiffstats
path: root/x11vnc/user.c
diff options
context:
space:
mode:
Diffstat (limited to 'x11vnc/user.c')
-rw-r--r--x11vnc/user.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/x11vnc/user.c b/x11vnc/user.c
index be2370e..8678b0f 100644
--- a/x11vnc/user.c
+++ b/x11vnc/user.c
@@ -1180,9 +1180,11 @@ static void handle_one_http_request(void) {
screen->port = 0;
http_connections(1);
+
rfbInitServer(screen);
if (!inetd) {
+ /* XXX ipv6 */
int conn = 0;
while (1) {
if (0) fprintf(stderr, "%d %d %d %d\n", conn, screen->listenSock, screen->httpSock, screen->httpListenSock);
@@ -1234,8 +1236,7 @@ static void handle_one_http_request(void) {
rfbLog("handle_one_http_request: finished.\n");
return;
} else {
- int sock = rfbConnectToTcpAddr("127.0.0.1",
- screen->httpPort);
+ int sock = connect_tcp("127.0.0.1", screen->httpPort);
if (sock < 0) {
exit(1);
}
@@ -1703,6 +1704,7 @@ static void vnc_redirect_loop(char *vnc_redirect_test, int *vnc_redirect_cnt) {
}
} else {
pid_t pid = 0;
+ /* XXX ipv6 */
if (screen->httpListenSock >= 0) {
#if LIBVNCSERVER_HAVE_FORK
if ((pid = fork()) > 0) {
@@ -1817,7 +1819,7 @@ static void vnc_redirect_loop(char *vnc_redirect_test, int *vnc_redirect_cnt) {
static void do_vnc_redirect(int created_disp, char *vnc_redirect_host, int vnc_redirect_port,
int vnc_redirect_cnt, char *vnc_redirect_test) {
- char *q = strchr(use_dpy, ':');
+ char *q = strrchr(use_dpy, ':');
int vdpy = -1, sock = -1;
int s_in, s_out, i;
if (vnc_redirect == 2) {
@@ -1850,7 +1852,7 @@ static void do_vnc_redirect(int created_disp, char *vnc_redirect_host, int vnc_r
usleep(1000*1000);
}
for (i=0; i < 20; i++) {
- sock = rfbConnectToTcpAddr(vnc_redirect_host, vdpy);
+ sock = connect_tcp(vnc_redirect_host, vdpy);
if (sock >= 0) {
break;
}
@@ -2993,9 +2995,14 @@ int wait_for_client(int *argc, char** argv, int http) {
if (! screen->port || screen->listenSock < 0) {
if (got_rfbport && got_rfbport_val == 0) {
;
+ } else if (ipv6_listen && ipv6_listen_fd >= 0) {
+ rfbLog("Info: listening only on IPv6 interface.\n");
} else {
rfbLogEnable(1);
rfbLog("Error: could not obtain listening port.\n");
+ if (!got_rfbport) {
+ rfbLog("If this system is IPv6-only, use the -6 option.\n");
+ }
clean_up_exit(1);
}
}