Commit e9353e8d authored by runge's avatar runge

More fixes to ultra java viewer, ultrafilexfer debugging output, fix -loop in .x11vncrc case.

parent 13ad9f49
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -1092,6 +1092,8 @@ rfbBool rfbSendTextChatMessage(rfbClientPtr cl, uint32_t length, char *buffer) ...@@ -1092,6 +1092,8 @@ rfbBool rfbSendTextChatMessage(rfbClientPtr cl, uint32_t length, char *buffer)
return ret; \ return ret; \
} }
int DB = 1;
rfbBool rfbSendFileTransferMessage(rfbClientPtr cl, uint8_t contentType, uint8_t contentParam, uint32_t size, uint32_t length, char *buffer) rfbBool rfbSendFileTransferMessage(rfbClientPtr cl, uint8_t contentType, uint8_t contentParam, uint32_t size, uint32_t length, char *buffer)
{ {
rfbFileTransferMsg ft; rfbFileTransferMsg ft;
...@@ -1213,7 +1215,7 @@ rfbBool rfbSendDirContent(rfbClientPtr cl, int length, char *buffer) ...@@ -1213,7 +1215,7 @@ rfbBool rfbSendDirContent(rfbClientPtr cl, int length, char *buffer)
/* Client thinks we are Winblows */ /* Client thinks we are Winblows */
rfbFilenameTranslate2UNIX(cl, buffer, path); rfbFilenameTranslate2UNIX(cl, buffer, path);
rfbLog("rfbProcessFileTransfer() rfbDirContentRequest: rfbRDirContent: \"%s\"->\"%s\"\n",buffer, path); if (DB) rfbLog("rfbProcessFileTransfer() rfbDirContentRequest: rfbRDirContent: \"%s\"->\"%s\"\n",buffer, path);
dirp=opendir(path); dirp=opendir(path);
if (dirp==NULL) if (dirp==NULL)
...@@ -1482,8 +1484,8 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con ...@@ -1482,8 +1484,8 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con
cl->fileTransfer.fd=open(filename1, O_RDONLY, 0744); cl->fileTransfer.fd=open(filename1, O_RDONLY, 0744);
/* /*
rfbLog("rfbProcessFileTransfer() rfbFileTransferRequest(\"%s\"->\"%s\") Open: %s\n", buffer, filename1, (cl->fileTransfer.fd==-1?"Failed":"Success"));
*/ */
if (DB) rfbLog("rfbProcessFileTransfer() rfbFileTransferRequest(\"%s\"->\"%s\") Open: %s fd=%d\n", buffer, filename1, (cl->fileTransfer.fd==-1?"Failed":"Success"), cl->fileTransfer.fd);
if (cl->fileTransfer.fd!=-1) { if (cl->fileTransfer.fd!=-1) {
if (fstat(cl->fileTransfer.fd, &statbuf)!=0) { if (fstat(cl->fileTransfer.fd, &statbuf)!=0) {
...@@ -1502,6 +1504,7 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con ...@@ -1502,6 +1504,7 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con
strcat(buffer,","); strcat(buffer,",");
strcat(buffer, timespec); strcat(buffer, timespec);
length = strlen(buffer); length = strlen(buffer);
if (DB) rfbLog("rfbProcessFileTransfer() buffer is now: \"%s\"\n", buffer);
} }
} }
...@@ -1595,8 +1598,8 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con ...@@ -1595,8 +1598,8 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con
/* TODO: Delta Transfer */ /* TODO: Delta Transfer */
cl->fileTransfer.fd=open(filename1, O_CREAT|O_WRONLY|O_TRUNC, 0744); cl->fileTransfer.fd=open(filename1, O_CREAT|O_WRONLY|O_TRUNC, 0744);
if (DB) rfbLog("rfbProcessFileTransfer() rfbFileTransferOffer(\"%s\"->\"%s\") %s %s fd=%d\n", buffer, filename1, (cl->fileTransfer.fd==-1?"Failed":"Success"), (cl->fileTransfer.fd==-1?strerror(errno):""), cl->fileTransfer.fd);
/* /*
rfbLog("rfbProcessFileTransfer() rfbFileTransferOffer(\"%s\"->\"%s\") %s %s\n", buffer, filename1, (cl->fileTransfer.fd==-1?"Failed":"Success"), (cl->fileTransfer.fd==-1?strerror(errno):""));
*/ */
/* File Size in bytes, 0xFFFFFFFF (-1) means error */ /* File Size in bytes, 0xFFFFFFFF (-1) means error */
...@@ -1644,8 +1647,8 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con ...@@ -1644,8 +1647,8 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con
break; break;
case rfbEndOfFile: case rfbEndOfFile:
if (DB) rfbLog("rfbProcessFileTransfer() rfbEndOfFile\n");
/* /*
rfbLog("rfbProcessFileTransfer() rfbEndOfFile\n");
*/ */
if (cl->fileTransfer.fd!=-1) if (cl->fileTransfer.fd!=-1)
close(cl->fileTransfer.fd); close(cl->fileTransfer.fd);
...@@ -1655,8 +1658,8 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con ...@@ -1655,8 +1658,8 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con
break; break;
case rfbAbortFileTransfer: case rfbAbortFileTransfer:
if (DB) rfbLog("rfbProcessFileTransfer() rfbAbortFileTransfer\n");
/* /*
rfbLog("rfbProcessFileTransfer() rfbAbortFileTransfer\n");
*/ */
if (cl->fileTransfer.fd!=-1) if (cl->fileTransfer.fd!=-1)
{ {
...@@ -1717,8 +1720,8 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con ...@@ -1717,8 +1720,8 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con
case rfbCDirCreate: /* Client requests the creation of a directory */ case rfbCDirCreate: /* Client requests the creation of a directory */
rfbFilenameTranslate2UNIX(cl, buffer, filename1); rfbFilenameTranslate2UNIX(cl, buffer, filename1);
retval = mkdir(filename1, 0755); retval = mkdir(filename1, 0755);
if (DB) rfbLog("rfbProcessFileTransfer() rfbCommand: rfbCDirCreate(\"%s\"->\"%s\") %s\n", buffer, filename1, (retval==-1?"Failed":"Success"));
/* /*
rfbLog("rfbProcessFileTransfer() rfbCommand: rfbCDirCreate(\"%s\"->\"%s\") %s\n", buffer, filename1, (retval==-1?"Failed":"Success"));
*/ */
retval = rfbSendFileTransferMessage(cl, rfbCommandReturn, rfbADirCreate, retval, length, buffer); retval = rfbSendFileTransferMessage(cl, rfbCommandReturn, rfbADirCreate, retval, length, buffer);
if (buffer!=NULL) free(buffer); if (buffer!=NULL) free(buffer);
...@@ -1745,8 +1748,8 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con ...@@ -1745,8 +1748,8 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con
rfbFilenameTranslate2UNIX(cl, buffer, filename1); rfbFilenameTranslate2UNIX(cl, buffer, filename1);
rfbFilenameTranslate2UNIX(cl, p+1, filename2); rfbFilenameTranslate2UNIX(cl, p+1, filename2);
retval = rename(filename1,filename2); retval = rename(filename1,filename2);
if (DB) rfbLog("rfbProcessFileTransfer() rfbCommand: rfbCFileRename(\"%s\"->\"%s\" -->> \"%s\"->\"%s\") %s\n", buffer, filename1, p+1, filename2, (retval==-1?"Failed":"Success"));
/* /*
rfbLog("rfbProcessFileTransfer() rfbCommand: rfbCFileRename(\"%s\"->\"%s\" -->> \"%s\"->\"%s\") %s\n", buffer, filename1, p+1, filename2, (retval==-1?"Failed":"Success"));
*/ */
/* Restore the buffer so the reply is good */ /* Restore the buffer so the reply is good */
*p = '*'; *p = '*';
......
x11vnc README file Date: Wed May 16 17:16:56 EDT 2007 x11vnc README file Date: Fri May 18 22:13:05 EDT 2007
The following information is taken from these URLs: The following information is taken from these URLs:
...@@ -692,8 +692,8 @@ make ...@@ -692,8 +692,8 @@ make
"-ncache 12". The unix Enhanced TightVNC Viewer [99]ssvnc has a "-ncache 12". The unix Enhanced TightVNC Viewer [99]ssvnc has a
nice [100]-ycrop option to help hide the pixel cache area from nice [100]-ycrop option to help hide the pixel cache area from
view. view.
* The [101]UltraVNC Java viewer has been patched to support SSL as * The [101]UltraVNC Java viewer has been enhanced to support SSL (as
the TightVNC viewer had been previously. The UltraVNC Java the TightVNC viewer had been previously). The UltraVNC Java
supports ultravnc filetransfer, and so can be used as a VNC viewer supports ultravnc filetransfer, and so can be used as a VNC viewer
on Unix that supports ultravnc filetransfer. It is in the on Unix that supports ultravnc filetransfer. It is in the
classes/ssl/UltraViewerSSL.jar file (that is pointed to by classes/ssl/UltraViewerSSL.jar file (that is pointed to by
...@@ -10934,7 +10934,7 @@ x11vnc: a VNC server for real X displays ...@@ -10934,7 +10934,7 @@ x11vnc: a VNC server for real X displays
Here are all of x11vnc command line options: Here are all of x11vnc command line options:
% x11vnc -opts (see below for -help long descriptions) % x11vnc -opts (see below for -help long descriptions)
x11vnc: allow VNC connections to real X11 displays. 0.9.1 lastmod: 2007-05-16 x11vnc: allow VNC connections to real X11 displays. 0.9.1 lastmod: 2007-05-18
x11vnc options: x11vnc options:
-display disp -auth file -N -display disp -auth file -N
...@@ -11048,7 +11048,7 @@ libvncserver-tight-extension options: ...@@ -11048,7 +11048,7 @@ libvncserver-tight-extension options:
% x11vnc -help % x11vnc -help
x11vnc: allow VNC connections to real X11 displays. 0.9.1 lastmod: 2007-05-16 x11vnc: allow VNC connections to real X11 displays. 0.9.1 lastmod: 2007-05-18
(type "x11vnc -opts" to just list the options.) (type "x11vnc -opts" to just list the options.)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
.TH X11VNC "1" "May 2007" "x11vnc " "User Commands" .TH X11VNC "1" "May 2007" "x11vnc " "User Commands"
.SH NAME .SH NAME
x11vnc - allow VNC connections to real X11 displays x11vnc - allow VNC connections to real X11 displays
version: 0.9.1, lastmod: 2007-05-16 version: 0.9.1, lastmod: 2007-05-18
.SH SYNOPSIS .SH SYNOPSIS
.B x11vnc .B x11vnc
[OPTION]... [OPTION]...
......
...@@ -157,7 +157,7 @@ static int limit_shm(void); ...@@ -157,7 +157,7 @@ static int limit_shm(void);
static void check_rcfile(int argc, char **argv); static void check_rcfile(int argc, char **argv);
static void immediate_switch_user(int argc, char* argv[]); static void immediate_switch_user(int argc, char* argv[]);
static void print_settings(int try_http, int bg, char *gui_str); static void print_settings(int try_http, int bg, char *gui_str);
static void check_loop_mode(int argc, char* argv[]); static void check_loop_mode(int argc, char* argv[], int force);
static void check_cursor_changes(void) { static void check_cursor_changes(void) {
...@@ -782,7 +782,7 @@ static void check_rcfile(int argc, char **argv) { ...@@ -782,7 +782,7 @@ static void check_rcfile(int argc, char **argv) {
argv2[argc2++] = strdup(argv[0]); argv2[argc2++] = strdup(argv[0]);
if (! norc) { if (! norc) {
char line[4096], parm[100], tmp[101]; char line[4096], parm[400], tmp[401];
char *buf, *tbuf; char *buf, *tbuf;
struct stat sbuf; struct stat sbuf;
int sz; int sz;
...@@ -873,7 +873,7 @@ static void check_rcfile(int argc, char **argv) { ...@@ -873,7 +873,7 @@ static void check_rcfile(int argc, char **argv) {
q++; q++;
} }
if (i >= 100) { if (i >= 400) {
fprintf(stderr, "invalid rcfile line: %s/%s\n", fprintf(stderr, "invalid rcfile line: %s/%s\n",
p, buf); p, buf);
exit(1); exit(1);
...@@ -884,10 +884,17 @@ static void check_rcfile(int argc, char **argv) { ...@@ -884,10 +884,17 @@ static void check_rcfile(int argc, char **argv) {
exit(1); exit(1);
} }
if (parm[0] == '-') { if (parm[0] == '-') {
strncpy(tmp, parm, 100); strncpy(tmp, parm, 400);
} else { } else {
tmp[0] = '-'; tmp[0] = '-';
strncpy(tmp+1, parm, 100); strncpy(tmp+1, parm, 400);
}
if (strstr(tmp, "-loop") == tmp) {
if (! getenv("X11VNC_LOOP_MODE")) {
check_loop_mode(argc, argv, 1);
exit(0);
}
} }
argv2[argc2++] = strdup(tmp); argv2[argc2++] = strdup(tmp);
...@@ -1306,10 +1313,13 @@ static void print_settings(int try_http, int bg, char *gui_str) { ...@@ -1306,10 +1313,13 @@ static void print_settings(int try_http, int bg, char *gui_str) {
} }
static void check_loop_mode(int argc, char* argv[]) { static void check_loop_mode(int argc, char* argv[], int force) {
int i; int i;
int loop_mode = 0, loop_sleep = 2000, loop_max = 0; int loop_mode = 0, loop_sleep = 2000, loop_max = 0;
if (force) {
loop_mode = 1;
}
for (i=1; i < argc; i++) { for (i=1; i < argc; i++) {
char *p = argv[i]; char *p = argv[i];
if (strstr(p, "--") == p) { if (strstr(p, "--") == p) {
...@@ -1562,7 +1572,7 @@ int main(int argc, char* argv[]) { ...@@ -1562,7 +1572,7 @@ int main(int argc, char* argv[]) {
/* check for -loop mode: */ /* check for -loop mode: */
check_loop_mode(argc, argv); check_loop_mode(argc, argv, 0);
dtime0(&x11vnc_start); dtime0(&x11vnc_start);
...@@ -1773,14 +1783,6 @@ int main(int argc, char* argv[]) { ...@@ -1773,14 +1783,6 @@ int main(int argc, char* argv[]) {
connect_once = 0; connect_once = 0;
} else if (strstr(arg, "-loop") == arg) { } else if (strstr(arg, "-loop") == arg) {
; /* handled above */ ; /* handled above */
#if LIBVNCSERVER_HAVE_SETSID
bg = 1;
opts_bg = bg;
#else
fprintf(stderr, "warning: -bg mode not supported.\n");
#endif
} else if (strstr(arg, "-loop") == arg) {
; /* handled above */
} else if (!strcmp(arg, "-timeout")) { } else if (!strcmp(arg, "-timeout")) {
CHECK_ARGC CHECK_ARGC
first_conn_timeout = atoi(argv[++i]); first_conn_timeout = atoi(argv[++i]);
......
...@@ -15,7 +15,7 @@ int xtrap_base_event_type = 0; ...@@ -15,7 +15,7 @@ int xtrap_base_event_type = 0;
int xdamage_base_event_type = 0; int xdamage_base_event_type = 0;
/* date +'lastmod: %Y-%m-%d' */ /* date +'lastmod: %Y-%m-%d' */
char lastmod[] = "0.9.1 lastmod: 2007-05-16"; char lastmod[] = "0.9.1 lastmod: 2007-05-18";
/* X display info */ /* X display info */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment