diff options
author | runge <runge> | 2009-03-07 22:30:43 +0000 |
---|---|---|
committer | runge <runge> | 2009-03-07 22:30:43 +0000 |
commit | e7152a7f68063a86887a9059728ca26b5404ce51 (patch) | |
tree | f7ac5e878e0655840337f10946868231e10dd9ba /x11vnc/user.c | |
parent | eb1cc7608b91996199dae88663ee0d14d5d5b3f7 (diff) | |
download | libtdevnc-e7152a7f68063a86887a9059728ca26b5404ce51.tar.gz libtdevnc-e7152a7f68063a86887a9059728ca26b5404ce51.zip |
Allow range for X11VNC_SKIP_DISPLAY, document grab
Xserver issue. Add progress_client() to proceed more quickly
thru handshake. Improvements to turbovnc hack.
Diffstat (limited to 'x11vnc/user.c')
-rw-r--r-- | x11vnc/user.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/x11vnc/user.c b/x11vnc/user.c index 60aef52..589afb3 100644 --- a/x11vnc/user.c +++ b/x11vnc/user.c @@ -22,6 +22,7 @@ int switch_user(char *user, int fb_mode); int read_passwds(char *passfile); void install_passwds(void); void check_new_passwds(int force); +void progress_client(void); int wait_for_client(int *argc, char** argv, int http); rfbBool custom_passwd_check(rfbClientPtr cl, const char *response, int len); char *xdmcp_insert = NULL; @@ -2137,7 +2138,7 @@ static void check_nodisplay(char **nd) { t2 = strchr(t, ','); if (t2) *t2 = '\0'; while (*t != '\0') { - if (*t == '-') { + if (*t == '+') { *t = ','; } t++; @@ -2591,6 +2592,36 @@ void ssh_remote_tunnel(char *, int); static XImage ximage_struct; +void progress_client(void) { + int i, j = 0, progressed = 0, db = 0; + double start = dnow(); + if (getenv("PROGRESS_CLIENT_DBG")) { + rfbLog("progress_client: begin\n"); + db = 1; + } + for (i = 0; i < 15; i++) { + if (latest_client) { + for (j = 0; j < 10; j++) { + if (latest_client->state != RFB_PROTOCOL_VERSION) { + progressed = 1; + break; + } + if (db) rfbLog("progress_client: calling-1 rfbCFD(1) %.6f\n", dnow()-start); + rfbCFD(1); + } + } + if (progressed) { + break; + } + if (db) rfbLog("progress_client: calling-2 rfbCFD(1) %.6f\n", dnow()-start); + rfbCFD(1); + } + if (!quiet) { + rfbLog("client progressed=%d in %d/%d %.6f s\n", + progressed, i, j, dnow() - start); + } +} + int wait_for_client(int *argc, char** argv, int http) { /* ugh, here we go... */ XImage* fb_image; @@ -2767,6 +2798,10 @@ int wait_for_client(int *argc, char** argv, int http) { } } do_unixpw_loop(); + } else if (cmd && !use_threads) { + /* try to get RFB proto done now. */ + progress_client(); + } } |