diff options
author | dscho <dscho> | 2005-09-27 15:18:22 +0000 |
---|---|---|
committer | dscho <dscho> | 2005-09-27 15:18:22 +0000 |
commit | 93be927b1c1c74bc4da6f6d5978ba8e6e52f3cc2 (patch) | |
tree | 0ec66825e92a2cf60e0f32b7ab74bc5777318bd6 /libvncserver/cargs.c | |
parent | 94fcd86cc20dd2ccf7e2299a7dfbcc255c6cc771 (diff) | |
download | libtdevnc-93be927b1c1c74bc4da6f6d5978ba8e6e52f3cc2.tar.gz libtdevnc-93be927b1c1c74bc4da6f6d5978ba8e6e52f3cc2.zip |
Introduce generic protocol extension method. Deprecate
the processCustomClientMessage() method.
Diffstat (limited to 'libvncserver/cargs.c')
-rw-r--r-- | libvncserver/cargs.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/libvncserver/cargs.c b/libvncserver/cargs.c index d0e3309..10926a9 100644 --- a/libvncserver/cargs.c +++ b/libvncserver/cargs.c @@ -19,6 +19,8 @@ extern int rfbStringToAddr(char *str, in_addr_t *iface); void rfbUsage(void) { + rfbProtocolExtension* extension; + fprintf(stderr, "-rfbport port TCP port for RFB protocol\n"); fprintf(stderr, "-rfbwait time max time in ms to wait for RFB client\n"); fprintf(stderr, "-rfbauth passwd-file use authentication on RFB protocol\n" @@ -40,6 +42,11 @@ rfbUsage(void) fprintf(stderr, "-progressive height enable progressive updating for slow links\n"); fprintf(stderr, "-listen ipaddr listen for connections only on network interface with\n"); fprintf(stderr, " addr ipaddr. '-listen localhost' and hostname work too.\n"); + + for(extension=rfbGetExtensionIterator();extension;extension=extension->next) + if(extension->usage) + extension->usage(); + rfbReleaseExtensionIterator(); } /* purges COUNT arguments from ARGV at POSITION and decrements ARGC. @@ -138,9 +145,21 @@ rfbProcessArguments(rfbScreenInfoPtr rfbScreen,int* argc, char *argv[]) return FALSE; } } else { - i++; - i1=i; - continue; + rfbProtocolExtension* extension; + int handled=0; + + for(extension=rfbGetExtensionIterator();handled==0 && extension; + extension=extension->next) + if(extension->processArgument) + handled = extension->processArgument(argv + i); + rfbReleaseExtensionIterator(); + + if(handled==0) { + i++; + i1=i; + continue; + } + i+=handled-1; } /* we just remove the processed arguments from the list */ rfbPurgeArguments(argc,&i1,i-i1+1,argv); |