diff --git a/ChangeLog b/ChangeLog index 6f3c65d..ebb4cb2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,24 @@ Version NEXT fsp_env.7: added info about larger packets send_file function renamed to serve_file for avoiding name clash on AIX. + idle resend multiplier descreased from 1.5 to 1.33 + correctly init first sequence number + sequence numbering changed to allow up to 8 packets flying in the + network. Old code uses 4. Even CZFREE.net do not drops 8 packets + in row unless line is down. + allow better debuging of retry alg. + Default max packesize supported by server set by 1200 bytes for + now. Let's make some experiments. + Calculate real RTT using seq. numbers + ignore HUP signal in fgetcmd and fputcmd + ignore HUP signal in fcatcmd if stdout is not a terminal + fspd.1: minor fixes + !! retry alg. retuned for lines with higher PLR. It is much better + than before. + use srandomdev() for seeding server random generator + FAQ: added section about key locking, dmachine, FSP stack libraries, + lamah FSP Win32 suite. + print packet stats after up/downloads if client tracing is enabled. Version 2.8.1b22 - 20 Dec 2004 fixed sf bug 1060594: fspd: owner can't rename files diff --git a/TODO b/TODO index 6fdccb9..bc30322 100644 --- a/TODO +++ b/TODO @@ -1,11 +1,11 @@ -FSP SUITE TO DO LIST BY RADIM KOLAR +FSP SUITE TO DO LIST /* maintained by hsn -at- netmag * cz */ Radim Kolar's personal wishlist from 1997 *-high priority-* - show loosers online (finfo command) and server statz * l o w * - - password change command + - password change command !? TESTSUITE NEEDED: Write a simple FSP protocol testing tool @@ -22,16 +22,12 @@ we should add real,portable error codes support to CC_ERR extended data area. PORTING Sven's Slowaris 8 compile problem -Sven's AIX compile problem +Fixed? Sven's AIX compile problem still not builds on freebsd 4 and FreeBSD 5 - non intel platforms? NEEDS IMPROVMENT: Client LIBRARY -:mid: -we should retune retry algoritm for better support lines with higher - packed loss. On common internet lines current one works okay. -add more detailed stats from retry alg. :low: fver and others add support new syntax fsp://host:port/file @@ -60,7 +56,8 @@ report number of clients connected, size of hostable in new command CC_INFO command special defence against rapid/double fire clients (burst command in fspclient) Native Supports for symbolic links (needed for mirroring Debian) -new LSTAT COMMAND +new LSTAT COMMAND, new MAKELINK command +Server should save .FSP_CONTENT using 1k size directory blocks :midle:may not be in 2.8.2 write FSP_CHANGE_PASSWORD command @@ -81,14 +78,15 @@ FSP Proxy repeater - take a look at old code, but we have NAT and fspproxy today. PERFORMANCE: -host hashtable shrinking sometimes -stat cache pro FSP_STAT a ostatni staty -chage O(N) fifo cache to some more sane lru hashtable code. +do host hashtable shrinking/clearing sometimes +stat cache pro FSP_STAT a other stat() calls +chage O(N) fifo cache to some more sane lru hashtable code. background time() alarm() caller Current performance 1925648B/s MAN: separate manpage for 7 fsp (protocol definition) == write FSP RFC +Register udp/21 for FSP in iana manual page for fmvcmd.1 libraries and support for FSP protocol @@ -96,7 +94,8 @@ libraries and support for FSP protocol DONE: FSP library for Java DONE: FSP over HTTP -ALMOST DONE: new small,light fsplib for C. +DONE: new small,light fsplib for C. + FSP plugin for Netscape/MSIE. Not possible to write protocol plugins with Netscape 3 SDK we have fsproxy now. @@ -106,6 +105,7 @@ FSP support in major ftp programs: lftp,wget,curl,gftp AVFS plugin http://sourceforge.net/projects/avf LARGEFILES64 how to turn them on: +*-------------------------------* Cygwin: #define __LARGE64_FILES fopen64,ftello64,fseeko64 _off64_t glibc 2.3: #define _LARGEFILE64_SOURCE off64_t diff --git a/client/lib.c b/client/lib.c index 424fe17..06e5539 100644 --- a/client/lib.c +++ b/client/lib.c @@ -33,6 +33,7 @@ unsigned long target_maxdelay = DEFAULT_MAXDELAY; /* max resend timer */ unsigned long busy_delay = DEFAULT_DELAY; /* busy retransmit timer */ unsigned long idle_delay = DEFAULT_DELAY; /* idle retransmit timer */ unsigned long udp_sent_time; +unsigned long stat_resends, stat_iresends, stat_dupes, stat_bad, stat_ok; UBUF *client_interact (unsigned char cmd, unsigned long pos, unsigned int l1, unsigned const char * p1, @@ -48,6 +49,7 @@ UBUF *client_interact (unsigned char cmd, unsigned long pos, socklen_t bytes; unsigned long w_delay; unsigned long total_delay; + struct timeval start[8],stop; FD_ZERO(&mask); sbuf.cmd = cmd; @@ -73,7 +75,7 @@ UBUF *client_interact (unsigned char cmd, unsigned long pos, total_delay += w_delay; BB_WRITE2(sbuf.bb_key,key); sbuf.bb_seq[0] = seq0 = (myseq >> 8) & 0xff; - sbuf.bb_seq[1] = seq1 = (myseq & 0xfc) | (retry_send & 0x0003); + sbuf.bb_seq[1] = seq1 = (myseq & 0xf8) | (retry_send & 0x0007); sbuf.sum = 0; for(t = (unsigned char *) &sbuf, sum = n = mlen; n--; sum += *t++); @@ -81,13 +83,21 @@ UBUF *client_interact (unsigned char cmd, unsigned long pos, switch(retry_send) { /* adaptive retry delay adjustments */ case 0: - busy_delay = (target_delay+(busy_delay<<3)-busy_delay)>>3; + if(target_delay>=busy_delay) + w_delay=target_delay; + else + w_delay=busy_delay+DEFAULT_DELAY; + /* classic FSP retry code. Not suitable for CZFREE.NET + busy_delay = (target_delay+ (busy_delay<<3)-busy_delay)>>3; w_delay = busy_delay; + */ break; case 1: busy_delay = busy_delay * 3 / 2; w_delay = busy_delay; + idle_delay = busy_delay; if(client_trace) write(2,"R",1); + stat_resends++; break; default: @@ -97,10 +107,11 @@ UBUF *client_interact (unsigned char cmd, unsigned long pos, exit(1); } #endif - idle_delay = idle_delay * 3 / 2; + idle_delay = idle_delay * 4 / 3; if (idle_delay > target_maxdelay) idle_delay = target_maxdelay; w_delay = idle_delay; if(client_trace) write(2,"I",1); + stat_iresends++; break; } @@ -120,7 +131,18 @@ UBUF *client_interact (unsigned char cmd, unsigned long pos, exit(1); } } + /* Check if w_delay is within limits */ + if(w_delay < MIN_DELAY) + w_delay=MIN_DELAY; + else + if (w_delay > target_maxdelay) + w_delay = target_maxdelay; + +#ifdef DEBUG + printf("Waiting %lu ms for server response.\n",w_delay); +#endif udp_sent_time = time((time_t *) 0); + gettimeofday(&start[retry_send & 0x7],NULL); FD_SET(myfd,&mask); for(retry_recv = 0; ; retry_recv++) { @@ -133,6 +155,7 @@ UBUF *client_interact (unsigned char cmd, unsigned long pos, { /* too enough bytes for header */ if (client_trace) write(2,"H",1); + stat_bad++; continue; } @@ -142,6 +165,7 @@ UBUF *client_interact (unsigned char cmd, unsigned long pos, { /* truncated. */ if (client_trace) write(2,"T",1); + stat_bad++; continue; } @@ -154,21 +178,30 @@ UBUF *client_interact (unsigned char cmd, unsigned long pos, { /* wrong check sum */ if (client_trace) write(2,"C",1); + stat_bad++; continue; } if( (rbuf.bb_seq[0] ^ seq0) || - ((rbuf.bb_seq[1] ^ seq1)&0xfc)) + ((rbuf.bb_seq[1] ^ seq1)&0xf8)) { /* wrong seq # */ if (client_trace) write(2,"S",1); + stat_dupes++; continue; } - myseq = (myseq + 0x0004) & 0xfffc; /* seq for next request */ + myseq = (myseq + 0x0008) & 0xfff8; /* seq for next request */ key = BB_READ2(rbuf.bb_key); /* key for next request */ - + /* calculate real busy delay */ + gettimeofday(&stop,NULL); + busy_delay = 1000*(stop.tv_sec-start[rbuf.bb_seq[1] & 0x7].tv_sec); + busy_delay += (stop.tv_usec-start[rbuf.bb_seq[1] & 0x7].tv_usec)/1000; +#ifdef DEBUG + printf("Server reply RTT was %lu ms.\n",busy_delay); +#endif client_set_key(key); - + stat_ok++; + if(client_intr_state == 2) { if(!key_persists) client_done(); exit(1); @@ -200,10 +233,11 @@ static RETSIGTYPE client_intr (int signum) void init_client (const char * host, unsigned short port, unsigned short myport) { busy_delay = idle_delay = target_delay; + stat_resends = stat_iresends = stat_dupes = stat_bad = stat_ok; #ifdef HAVE_SRANDOMDEV srandomdev(); -#endif - myseq = random(); +#endif + myseq = random() & 0xfff8; if((myfd = _x_udp(env_listen_on,&myport)) == -1) { perror("socket open"); diff --git a/client/util.c b/client/util.c index 63cda09..37c2fc3 100644 --- a/client/util.c +++ b/client/util.c @@ -109,6 +109,13 @@ char *util_abs_path (const char * s2) return(path); } +static void util_pktstats(void) +{ + fprintf(stderr,"Packets received: %lu total (%lu bad, %lu duplicate)\nPackets sent: %lu total (%lu first resends, %lu idle resends).\n",stat_ok+stat_bad+stat_dupes,stat_bad,stat_dupes, + stat_ok+stat_resends+stat_iresends,stat_resends,stat_iresends); + fprintf(stderr,"Line has %lu %% packet loss rate.\n",100*(stat_resends+stat_iresends)/(stat_ok+stat_dupes+stat_resends+stat_iresends)); +} + static int util_split_path (char * path, char ** p1, char ** p2, char ** p3) { @@ -285,6 +292,7 @@ static int util_download_main (char * path, char * fpath, FILE * fp, if(client_trace) { fprintf(stderr,"\r%luk : %s [%ldB/s] \n", 1+(pos>>10), path, downloaded/t); + util_pktstats(); fflush(stderr); } @@ -439,6 +447,7 @@ int util_upload (char * path, FILE * fp, time_t stamp) if(client_trace) { fprintf(stderr,"\r%luk : %s [%ldB/s] \n", 1+(pos>>10), path, pos/t); + util_pktstats(); fflush(stderr); } free(fpath); diff --git a/clients/fcatcmd.c b/clients/fcatcmd.c index c8a99ed..746818d 100644 --- a/clients/fcatcmd.c +++ b/clients/fcatcmd.c @@ -23,7 +23,7 @@ static RETSIGTYPE dont_die (int signum) { #ifndef RELIABLE_SIGNALS - signal(SIGPIPE,dont_die); + signal(signum,dont_die); #endif } @@ -34,7 +34,10 @@ int main (int argc, char ** argv) env_client(); signal(SIGPIPE,dont_die); - if(isatty(1)) client_trace = 0; + if(isatty(1)) + client_trace = 0; + else + signal(SIGHUP,dont_die); while(*++argv) { av = glob(*argv); diff --git a/clients/fgetcmd.c b/clients/fgetcmd.c index a32c1df..f4c7954 100644 --- a/clients/fgetcmd.c +++ b/clients/fgetcmd.c @@ -213,7 +213,7 @@ int main (int argc, char ** argv) char **av, *av2[2], n[1024]; int prompt, mode = 0; - signal(SIGHUP,fsp_cleanup); + signal(SIGHUP,SIG_IGN); signal(SIGINT,fsp_cleanup); signal(SIGQUIT,fsp_cleanup); signal(SIGILL,fsp_cleanup); diff --git a/clients/fput.c b/clients/fput.c index edebd7a..69d8bfc 100644 --- a/clients/fput.c +++ b/clients/fput.c @@ -79,7 +79,7 @@ int main (int argc, char ** argv) exit(1); } - signal(SIGHUP,upload_cleanup); + signal(SIGHUP,SIG_IGN); signal(SIGINT,upload_cleanup); signal(SIGQUIT,upload_cleanup); signal(SIGILL,upload_cleanup); diff --git a/doc/4LAMERZ.TXT b/doc/4LAMERZ.TXT index 52dea35..cdef961 100644 --- a/doc/4LAMERZ.TXT +++ b/doc/4LAMERZ.TXT @@ -19,11 +19,12 @@ ### # # ### L8mer guide to FSP ### ## ## ### ### ### # ### LQ Version -##### # ###### ##### Dec 2004 +##### # ###### ##### Jan 2005 Why you need it - stealth operation +- few people knows what FSP is - old proven software with 10 years history - Elite SitEZ has non interrupted operation by lamerz for more than 10 years! @@ -32,11 +33,16 @@ Why you need it - net adminz do not like it - lamerz can not handle it - bandwidth friendly +- very ressistant to packet loss STuFF firSt! you neeeed to get a p-file called cygwin1.dll. lamerz at www.cygwin.com -have some. Grab a copy, man. Copy it to your winlost sistema32 dyr. +have some. Grab a copy, man. Copy it to your c:\winlost\sistema32 dyr. + +If you can not get it from lamerz listed above and your friends do not have +one, last chance for getting this important p-file is to do a minimal +installation of CygLose. Have it? Right! You are ready now. @@ -131,6 +137,7 @@ for HQ version of this guide send Features included: list of 5 hq quality sitez how to search for new sitez + how to make FSP faster special fsp sites seek tool and 3 secret bonuzez diff --git a/doc/fsp-faq.sgml b/doc/fsp-faq.sgml index beba337..124b76b 100644 --- a/doc/fsp-faq.sgml +++ b/doc/fsp-faq.sgml @@ -197,7 +197,7 @@ There are also some people which likes slower FSP downloads better, because - it saves their bandwidth for interactive tasks. This is often prefered + it saves their bandwidth for interactive tasks. This is often preferred way of downloading large files, like CD-ROM images. It is not true that UDP based protocols are unsecure. &fsp; provides @@ -241,7 +241,7 @@ The Mailinglists - For developing issue writte to the fsp-dev mainlinglist. For end-user questions + For developing issue write to the fsp-dev mainlinglist. For end-user questions and questions on how to configure your server/client write to the fsp-user Mailinglist. You can find more information on how to subscribe/unsubscribe to the mailinglist and the archive on the @@ -327,8 +327,10 @@ FSP development started in a very old days. From source code and man page time stamps we can see that it was working and alive in 1988. - FSP versions 1.0 and 2.0 was born in Dec 1991. After that two first - releases FSP goes to the active life. + FSP versions 1.0 and 2.0 was born in Dec 1991. Release 2.0 was just + bufixed 1.0 but includes man pages. After that two first + releases FSP goes to the active life. People starts using it because + it was superior to anonymous FTP at that time. FSP active development era ends in May 1993 when last official @@ -347,14 +349,21 @@ This version is used on some servers today because Debian Woody has it. - Last official stable FSP version was 2.7.1. This is still - used on some forgotten machines in universities today. It has also + Last official stable FSP version was still 2.7.1 from May '93. + This is still used on some forgotten machines in universities today. + It has also known security issue (fspd follows all symlinks), but at this time this was viewed as feature, not a bug. Radim Kolar released 2.8.1b4 in 2001, which was just some bugfixed version of 2.8.1b3 untouched from 1997 when I ported it to OS/2. + + + With wireless networks Wi-Fi boom in 2002, it becomes clear that + large wireless networks can have quite a high packet loss rate + and TCP protocol is not very suitable for them. + Active working on FSP again starts on 25 June 2003 when Version 2.8.1b5 goes out. Major parts of FSP server code was rewrited for higher performance and many old bugs in FSP code fixed. @@ -373,7 +382,7 @@ on the mailinglists or via e-mail hsn@no.spam.sendmail.cz. - Since September 2003 Sven Hoexter is working on parts of the documentation. + Since September 2003 Sven Hoexter is working on parts of the documentation and code. He is also doing release management and RPM, deb packaging. You can reach him on the mailinglists or via e-mail sven@du-gehoerst-mir.de-nospam. @@ -434,14 +443,14 @@ server in read only mode. In this mode fspd needs to know only home directory and port number. Both can be supplied by command line arguments to fspd. - + If you need additional features, such as - logging, you will need to know + logging, you will need to have How to install fsp server - See first. + FSP server is included in main FSP package. See first. FSP server for windows is in the . Server can be installed as inetd service or standalone. I prefer inetd installation, because modification of system startup @@ -454,12 +463,15 @@ How to quickly install fsp server Add following line to your /etc/inetd.conf - - ftp dgram udp wait ftp /usr/local/bin/fspd in.fspd -d /home/ftp - + +ftp dgram udp wait ftp /usr/local/bin/fspd in.fspd -d /home/ftp + This easy setup will run fsp server on standard port 21, home directory set to /home/ftp and effective user set to ftp. If you do not have configured temporary directory in fspd.conf, fsp server will run in read-only - mode. + mode. + + Some inetd server uses slightly different syntax of inetd.conf + file. Consult your local man pages for inetd and inetd.conf. How to setup a basic fspd.conf @@ -526,16 +538,45 @@ multiple client programs in FSP protocol suite. If you are at least somewhat familiar with command line FTP and want to try FSP, this program is right for you. + + The old, real hackers prefers , because + fspclient is just 'fsp for lamah'. FSP client homepage is http://fspclient.sourceforge.net. - Using FSP in browser + FSP PROXY: Using FSP in browser If you want a GUI, the easiest way is to use FSP directly - from your web browser. + from your web browser. This is recommended method for using FSP + by standard BFU users. They can handle web browser well -- no + extra education is necessary. + You need to download and install FSP Java LIB and Proxy server. Read included docs for install instructions. + + Download Machine + + Download Machine is non interactive, non graphical, batch download + manager. Tired of GUI Download managers and mouse clicking? + Then Download Machine is just for YOU! + + Download Machine is written in portable Java 1.1 code and supports + HTTP, + FTP and FSP + protocols. + + FSP Win32 Suite + + Special, easy to use, starting suite targeted at common Windows users. + Suite contains 3 valueable items: + Easy to use fsp server (works without configration file), + windows version of fspclient and + Lamah starting guide to FSP. + + This package is downloadable from + Source Forge and requires cygwin dll library + not included in the package. @@ -556,7 +597,8 @@ reliable underlying transport. FSP can operate even without any Layer 2 and Layer 3 transports only with some extra features disabled. FSP can be implemented in all kinds of environments. - This makes FSP very suitable for embedded devices area. + This makes FSP very suitable for embedded devices area, because + it is easier to implement than other transfer protocols like X-Modem. When used in TCP/IP based networks, UDP is used for transporting of FSP datagrams, this lowers protocol @@ -570,7 +612,7 @@ FSP protocol is very simple to implement. - Network bandwidth protection + Keying: Network bandwidth protection One of interesting parts of underlying network technology used by FSP is how protocol design restrict user from sending @@ -584,7 +626,8 @@ Server remembers for each IP not only nextkey, but also previous key. When packet's key matches previously stored key -- it is - resend from client. + resend from client. Server limits replies to resend packets also. + Max. allowed reply rate to resend packets is 1 reply per 3 seconds. This method also allows ignore duplicate requests by server for action which should not be done more than once (for example mkdir). @@ -599,18 +642,55 @@ by computing packet loss ratio of network, and duplicate packet rate. + Client side locking + + FSP server has its secret keys database divided by client ip address, + not by client:port. All requests comming from the same machine must + shares the same secret key. This is done for bandwidth protection. + + Client must submit a valid key with request. Where there are 2 programs + runnings on the client PC and both wants to talk to the same FSPD at once, + they must exchange knowledge of this secret key between themselfs. + If they don't, only one program can talk to the FSPD, because others do not + knows the next session key. They can try to talk but fspd will ignore them. + This is kind of client-side multiplexing. + + There are several methods how to do this key sharing. Best method is + to use semop+shmget, second is to use lockf on file in /tmp. All FSP + clients running on the same machine must use the same locking method. + Why not use bigger packet size? &fsp; defines maximum packet size 1024 bytes of data + header. + All FSP compatible protocol stacks must support this packet size. + Nearly all networks can transfer 1036 bytes long UDP packets. + Some networks allows only 512 bytes long UDP (maximal size required + by RFC). To use FSP on that networks, fsp clients must be configured + to use only 500 bytes of payload. + Because MTU of most networks is about 1500 bytes. It is true, that - we can use slightly bigger packets for gaining some speed. + we can use slightly bigger packets for gaining some speed. FSP + server can optionally support larger packet size, but must send + them out only on explicit client request. + We have performed some benchmarks and they shows only minor performance increase, about 10-15 percent. Similar testing was performed by HP in RFC 2348. - For bigger performance enhancement we need to use at least 2KB, - but packets of that size must be fragmented on most network and fragmenting increases possibility of packet loss. We will not increase packet size - in FSP v2 codebase, but we are willing to do some experiments in FSP v3. + For bigger performance enhancement we need to use at least 2.5 KB, + but packets of that size must be fragmented on most network and fragmenting increases possibility of packet loss. + + Using FSP in your programs + + You can easily add support for FSP v2 protocol into your programs. + Currently exists two independend libraries for FSP protocol support + and one library is in the work. + + First library is called JFSPlib. This is FSP library for Java language. + + Second library is called FSPlib. This is FSP library for C language with POSIX-like API. + + FSP support for Python PyFSP is currently work in progress. Note: PyFSP uses GPL license, not MIT/X11 like other libraries. diff --git a/include/c_extern.h b/include/c_extern.h index 1f90c05..0137df9 100644 --- a/include/c_extern.h +++ b/include/c_extern.h @@ -10,6 +10,7 @@ UBUF *client_interact (unsigned char, unsigned long, unsigned int, void init_client (const char *, unsigned short, unsigned short); int client_done (void); void client_finish(void); +extern unsigned long stat_resends, stat_iresends, stat_dupes, stat_bad, stat_ok; /* lock.c */ extern int key_persists; diff --git a/include/common_def.h b/include/common_def.h index 45a59b2..d206203 100644 --- a/include/common_def.h +++ b/include/common_def.h @@ -82,7 +82,8 @@ #define UBUF_HSIZE 12 /* 12 bytes for the header */ #define UBUF_SPACE 1024 /* maximum standard payload. */ -#define UBUF_MAXSPACE 2800 /* maximum payload supported by server */ +#define UBUF_MAXSPACE 4096 /* maximum payload supported by server */ +#define DEFAULT_SPACE 1200 /* Default packet size */ #define NBSIZE (UBUF_MAXSPACE+UBUF_SPACE) diff --git a/man/fbye.1 b/man/fbye.1 new file mode 100644 index 0000000..cf0e140 --- /dev/null +++ b/man/fbye.1 @@ -0,0 +1,20 @@ +.TH FBYE 1 "Dec 2004" FSP +.SH NAME +fbye \- terminates session with FSP database +.SH SYNOPSIS +.B fver +.SH DESCRIPTION +.LP +Command +.B fbye +terminates active session with FSP server database. Using this command +is not neceseary, because session times out after at most 60 seconds of +inactivity. Main use of this command is to remove cached session keys. +.SH ENVIRONMENT +.LP +See fsp_env(7) for list of used environment variables. +.SH "SEE ALSO" +.PD +fcatcmd(1), fcdcmd(1), fgetcmd(1), fgrabcmd(1), flscmd(1), fmkdir(1), +fprocmd(1), fput(1), frmcmd(1), frmdircmd(1), fver(1), fducmd(1), +fhostcmd(1), fspd(1), fsp_prof(5), ffindcmd(1), fsp_env(7) diff --git a/man/fsp_env.7 b/man/fsp_env.7 index b771674..7f0cfd2 100644 --- a/man/fsp_env.7 +++ b/man/fsp_env.7 @@ -1,4 +1,4 @@ -.TH "FSP ENVIRONMENT" 7 "Oct 2004" FSP "FSP Environment Variables" +.TH "FSP ENVIRONMENT" 7 "Dec 2004" FSP "FSP Environment Variables" .SH NAME Environment variables used by FSP Clients programs .SH SYNOPSIS @@ -55,7 +55,8 @@ The default value is 360. No function if program was compiled without timeout code. .TP .B FSP_DELAY -Minimum wait time before resending packet in milliseconds. +Minimum wait time before resending packet in milliseconds. This should +be set close to expected round trip time. .TP .B FSP_MAXDELAY Maximum wait time before resending packet in milliseconds. diff --git a/man/fspd.1 b/man/fspd.1 index 32d28c8..110866b 100644 --- a/man/fspd.1 +++ b/man/fspd.1 @@ -1,4 +1,4 @@ -.TH FSPD 1 "18 Oct 2004" FSP +.TH FSPD 1 "Dec 2004" FSP .SH NAME fspd, in.fspd \- File Service Protocol (FSP) server .SH SYNOPSIS @@ -83,7 +83,7 @@ bytes per second. .B -s packetsize Sets maximum allowed packet size or prefered packet size. Server must support packets up to 1024, but may prefer to send smaller packets. -It may accept packets over 1024 bytes. Default value is 1024 bytes. +It may accept packets over 1024 bytes. Default value is 1200 bytes. .LP .SH FILES @@ -102,7 +102,7 @@ A text file that is sent to the client when the directory is entered giving information about the directory. It can only be hand created by the site administrator at this time. This text file should be no more than 1022 bytes in size. Any data above this limit will be silently ignored. Name -of this file can be configured. +of this file can be changed in server configuration file. .TP .B .FSP_OK_DEL @@ -180,7 +180,7 @@ to create it. .B SIGINT | SIGTERM Server performs cleaup and exits. All connected clients will be disconnected. Because FSP is stateless protocol, if you start -server later, than can continue without breakage. +server later, clients can continue without breakage. .SH EXIT CODES .B 1 @@ -211,4 +211,4 @@ Internal terror .PD fcatcmd(1), fcdcmd(1), fgetcmd(1), fgrabcmd(1), flscmd(1), fmkdir(1), fprocmd(1), fput(1), frmcmd(1), frmdircmd(1), fver(1), fducmd(1), -fhostcmd(1), fspd(1), fsp_prof(5), ffindcmd(1) +fhostcmd(1), fspd(1), fsp_prof(5), ffindcmd(1), fbye(1), fmvcmd(1) diff --git a/server/conf.c b/server/conf.c index d5bfddf..8eb4fc0 100644 --- a/server/conf.c +++ b/server/conf.c @@ -46,7 +46,7 @@ int use_directory_mtime = 1; #endif unsigned int maxthcallowed = 0; -unsigned short packetsize = UBUF_SPACE; +unsigned short packetsize = DEFAULT_SPACE; time_t retry_timeout = 3; time_t session_timeout = 60; time_t stat_cache_timeout = 25; @@ -187,7 +187,7 @@ static void read_configuration (const char * name) else if(strcasecmp(p, "packetsize") == 0) { packetsize = atoi(q); if(packetsize == 0) - packetsize = UBUF_SPACE; + packetsize = DEFAULT_SPACE; else if(packetsize < 64 ) packetsize = 64; diff --git a/server/main.c b/server/main.c index 1918db9..f4f4731 100644 --- a/server/main.c +++ b/server/main.c @@ -78,7 +78,7 @@ static void check_required_vars (void) packetsize = UBUF_MAXSPACE; else if (packetsize == 0) - packetsize = UBUF_SPACE; + packetsize = DEFAULT_SPACE; else if(packetsize < 64) packetsize = 64; @@ -125,6 +125,10 @@ static void check_required_vars (void) static void init_random (void) { +#ifdef HAVE_SRANDOMDEV + + srandomdev(); +#else unsigned int seed; FILE *f; @@ -137,6 +141,7 @@ static void init_random (void) seed=getpid()*time(NULL); srandom(seed); +#endif } int main (int argc, char ** argv)