This commit is contained in:
hsn 2003-11-08 16:35:51 +00:00
parent 095ed229a5
commit 8130150b03
6 changed files with 47 additions and 31 deletions

View File

@ -1,11 +1,15 @@
W.I.P
Version 2.8.1b16 -- 8 Nov 2003
This version fixes 2 major bugs in beta 15 release.
fspd: update mtime for directory listing after .FSP_CONTENT write
flscmd: do not list file size > 2GB as negative, same for block count
fspscan: install it when doing make install
fspd: -l logfile switch
removed crash when logfile is in use
fixed crash when logfile is in use. (from betat15)
fixed memory leak in client/util.c:get_dir_blk
fixed memory leak in client/util.c:open_dir
fixed error from 2.8.1b15 in util_stat which brokes recursive
directory listings
do not delete partial file on FSP timeout in fgetcmd
Version 2.8.1b15 -- 15 Oct 2003
Sven writes manpage for fspscan.1

2
TODO
View File

@ -33,6 +33,7 @@ random number generator in server is low random quality on low bits.
Client LIBRARY
local bind address FSP_LOCALIP
remove stale lock files if not needed, port code from fspclient.
FSP_TIMEOUT should be total number of seconds, not delay between retrys.
:low:
fver and others add support new syntax fsp://host:port/file
add sem locking method
@ -45,7 +46,6 @@ do not use global variables
CLIENTS
ALL: normalize return error codes of all clients
write new clients for new commands - fsprencmd fpasswd finfo
fgetcmd deletes partially transfered file on errors?
:low:
add support for more sane fsplist file format (as used by warez
ppl) to fhostcmd

View File

@ -187,10 +187,13 @@ static void displaydir PROTO2(LS *, stats, register int, num)
printfcn(stats, num);
if (f_recursive) {
if (f_recursive)
{
savedpath = endofpath;
for (lp = stats; num--; ++lp) {
if (!(S_ISDIR(lp->lstat.st_mode))) continue;
for (lp = stats; num--; ++lp)
{
if (!(S_ISDIR(lp->lstat.st_mode)))
continue;
p = lp->name;
if (p[0] == '.' && (!p[1] || (p[1] == '.' && !p[2]))) continue;
if (endofpath != path && endofpath[-1] != '/') *endofpath++ = '/';

View File

@ -530,10 +530,11 @@ int util_stat PROTO2(char *, path, struct stat *, sbuf)
RDIRENT **dep;
DDLIST *ddp;
UBUF *ub;
char *fpath, *ppath, *p1, *pfile;
char *fpath,*fpath2, *ppath, *p1, *pfile;
int cached=0;
fpath = util_abs_path(path);
fpath2 = strdup(fpath);
if(!strcmp(fpath,env_dir)) {
ppath = fpath;
@ -542,6 +543,7 @@ int util_stat PROTO2(char *, path, struct stat *, sbuf)
util_split_path(fpath,&ppath,&p1,&pfile);
*p1='\0';
}
/* printf("ppath `%s` pfile '%s'\n",ppath,pfile); */
/* check if we have ppath cached */
/* printf("Finding `%s` in cache.\n",ppath); */
@ -555,23 +557,14 @@ int util_stat PROTO2(char *, path, struct stat *, sbuf)
}
}
free(fpath);
fpath = util_abs_path(path);
if(!strcmp(fpath,env_dir)) {
ppath = fpath;
pfile = ".";
} else {
util_split_path(fpath,&ppath,&p1,&pfile);
}
/* if(cached) printf("Record found in cache.\n",ppath); */
if(statworks && !cached)
{
/* send a new FSP_STAT command to server */
ub = client_interact(CC_STAT,0L, strlen(fpath),
(unsigned char *) fpath+1, 0, 0);
if(ub->cmd == CC_STAT) {
ub = client_interact(CC_STAT,0L, strlen(fpath2),
(unsigned char *) fpath2+1, 0, 0);
if(ub->cmd == CC_STAT)
{
sbuf->st_uid = 0;
sbuf->st_gid = 0;
sbuf->st_atime = sbuf->st_mtime =
@ -588,6 +581,9 @@ int util_stat PROTO2(char *, path, struct stat *, sbuf)
sbuf->st_nlink = 1;
}
free(fpath);
free(fpath2);
if(ub->buf[8]==0)
{
errno = ENOENT;
@ -601,14 +597,22 @@ int util_stat PROTO2(char *, path, struct stat *, sbuf)
}
} /* CC_STAT */
if( (drp = util_opendir(ppath)) ) {
for(dep = drp->dep; *dep; dep++) {
if(!strcmp((*dep)->name,pfile)) {
if((*dep)->type & RDTYPE_DIR) sbuf->st_mode = 0777 | S_IFDIR;
else sbuf->st_mode = 0666 | S_IFREG;
if( (drp = util_opendir(ppath)) )
{
for(dep = drp->dep; *dep; dep++)
{
if(!strcmp((*dep)->name,pfile))
{
if((*dep)->type == RDTYPE_DIR)
sbuf->st_mode = 0777 | S_IFDIR;
else
sbuf->st_mode = 0666 | S_IFREG;
if((*dep)->type == RDTYPE_DIR)
sbuf->st_nlink = 2;
else
sbuf->st_nlink = 1;
if((*dep)->type & RDTYPE_DIR) sbuf->st_nlink = 2;
else sbuf->st_nlink = 1;
sbuf->st_uid = 0;
sbuf->st_gid = 0;
sbuf->st_size = BB_READ4((*dep)->bb_size);
@ -616,6 +620,7 @@ int util_stat PROTO2(char *, path, struct stat *, sbuf)
sbuf->st_ctime = BB_READ4((*dep)->bb_time);
util_closedir(drp);
free(fpath);
free(fpath2);
return(0);
}
}
@ -623,6 +628,7 @@ int util_stat PROTO2(char *, path, struct stat *, sbuf)
}
free(fpath);
free(fpath2);
errno = ENOENT;
return(-1);
}

View File

@ -112,15 +112,18 @@ PROTO4(char *, path, struct stat *, sbufp, int, mode, int, level)
fprintf(stderr,"Cannot create %s\n",name);
}
if(fp) {
if(fp)
{
if(
#ifdef COMMAND_GET
util_download
#else
util_grab_file
#endif
(path,fp, start_from) == -1) {
(path,fp, start_from) == -1)
{
fclose(fp);
if(clobbertype==C_TEMPNAME)
unlink(name);
} else
fclose(fp);

View File

@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a working configure script.
dnl tested with autoconf 2.57
AC_INIT(fsp,2.8.1b15,hsn@cybermail.net)
AC_INIT(fsp,2.8.1b16,hsn@cybermail.net)
AC_CONFIG_SRCDIR(server/main.c)
AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE