From 8f5c9ef01ef9101cf8f8d8f1eacdaab27ac7c2c8 Mon Sep 17 00:00:00 2001 From: runge Date: Mon, 7 Dec 2009 09:15:22 -0500 Subject: X11VNC_EXTRA_HTTPS_PARAMS, X11VNC_HTTP_LISTEN_LOCALHOST, X11VNC_REOPEN_SLEEP_MAX, -findauth/-auth guess FD_XDM=1 for root, work around xhost SI:localuser:root. --- x11vnc/sslhelper.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'x11vnc/sslhelper.c') diff --git a/x11vnc/sslhelper.c b/x11vnc/sslhelper.c index 12f5819..b36c7fd 100644 --- a/x11vnc/sslhelper.c +++ b/x11vnc/sslhelper.c @@ -3626,8 +3626,26 @@ void accept_openssl(int mode, int presock) { * the rest of the SSL session to it: */ if (n > 0) { - if (db) fprintf(stderr, "sending http buffer httpsock: %d\n'%s'\n", httpsock, buf); - write(httpsock, buf, n); + char *s = getenv("X11VNC_EXTRA_HTTPS_PARAMS"); + int did_extra = 0; + + if (db) fprintf(stderr, "sending http buffer httpsock: %d n=%d\n'%s'\n", httpsock, n, buf); + if (s != NULL) { + char *q = strstr(buf, " HTTP/"); + if (q) { + int m; + *q = '\0'; + m = strlen(buf); + write(httpsock, buf, m); + write(httpsock, s, strlen(s)); + *q = ' '; + write(httpsock, q, n-m); + did_extra = 1; + } + } + if (!did_extra) { + write(httpsock, buf, n); + } } ssl_xfer(httpsock, s_in, s_out, is_http); rfbLog("SSL: ssl_helper[%d]: exit case 6 (https ssl_xfer done)\n", getpid()); -- cgit v1.2.3