2
SCons build framework now has full support for distcc and ccache
3
seq. number is now random
5
test received command reply
6
fixed typo in configure.ac
7
./test program can take optional port number
2
new configure tests for stdint.h patch from Brian Masney
9
new configure tests for stdint.h patch from Brian Masney
3
SCons build framework improved, now support CC from command line
10
SCons build framework improved, now support CC from command line
2
make more tests on received packet -- improve resistance against certain
4
SCons build framework improved
5
fixed typo in configure.ac
2
use stdint.h if avaiable - should fix Mac OSX build problem
7
use stdint.h if avaiable - should fix Mac OSX build problem
3
SCons build framework improved
8
SCons build framework improved
5
Added build time checks for various members of dirent structure.
10
Added build time checks for various members of dirent structure.
6
fsplib should built on IRIX as result.
11
fsplib should built on IRIX as result.
8
scons build system fix: prefix now works, fixed install target,
13
SCons build system fix: prefix now works, fixed install target,
9
compile with -O by default
14
compile with -O by default
10
Filter symlinks from non native directory listings
15
Filter symlinks from non native directory listings
1
# Process this file with autoconf to produce a configure script.
1
# Process this file with autoconf to produce a configure script.
3
AC_PREREQ(2.59)
3
AC_PREREQ(2.59)
4
AC_INIT(fsplib,0.5,hsn@netmag.cz)
4
AC_INIT(fsplib,0.6,hsn@netmag.cz)
5
AM_INIT_AUTOMAKE()
5
AM_INIT_AUTOMAKE()
6
AM_MAINTAINER_MODE
6
AM_MAINTAINER_MODE
7
AC_CONFIG_SRCDIR([fsplib.c])
7
AC_CONFIG_SRCDIR([fsplib.c])
47
CFLAGS="$CFLAGS $ac_cv_prog_gcc_flags"
47
CFLAGS="$CFLAGS $ac_cv_prog_gcc_flags"
48
if test "${enable_maintainer_mode+set}" = set; then
48
if test "${enable_maintainer_mode+set}" = set; then
49
CFLAGS="-g3 -O0 -DMAINTAINER_MODE $ac_cv_prog_gcc_flags"
49
CFLAGS="-g3 -O0 -DMAINTAINER_MODE $ac_cv_prog_gcc_flags"
50
AC_CHECK_LIB(efence,EF_Abort)
50
AC_CHECK_LIB(efence,EF_Abort)
53
# Checks for libraries.
53
# Checks for libraries.
55
# Checks for header files.
55
# Checks for header files.
56
C_CHECK_HEADERS(stdint.h)
56
AC_CHECK_HEADERS(stdint.h)
58
# Checks for typedefs, structures, and compiler characteristics.
58
# Checks for typedefs, structures, and compiler characteristics.
59
AC_CHECK_MEMBER(struct dirent.d_namlen,AC_DEFINE(HAVE_DIRENT_NAMLEN,1,[Define if struct dirent has member d_namlen]),,[#include <sys/types.h>
59
AC_CHECK_MEMBER(struct dirent.d_namlen,AC_DEFINE(HAVE_DIRENT_NAMLEN,1,[Define if struct dirent has member d_namlen]),,[#include <sys/types.h>
87
return -1;
87
return -1;
96
errno = 0;
90
errno = 0;
97
return 0;
91
return 0;
250
/* get the next key */
244
/* get the next key */
251
p->key = client_get_key((FSP_LOCK *)s->lock);
245
p->key = client_get_key((FSP_LOCK *)s->lock);
247
retry = random() & 0xfff8;
253
dupes = retry = 0;
252
dupes = retry = 0;
254
s->seq = (s-> seq + 0x08) & 0xfff8;
255
t_delay = 0;
253
t_delay = 0;
256
/* compute initial delay here */
254
/* compute initial delay here */
257
/* we are using hardcoded value for now */
255
/* we are using hardcoded value for now */
363
continue;
361
continue;
364
/* check command code */
365
if( (rpkt->cmd != p->cmd) && (rpkt->cmd != FSP_CC_ERR))
371
/* check correct filepos */
372
if( (rpkt->pos != p->pos) && ( p->cmd == FSP_CC_GET_DIR ||
373
p->cmd == FSP_CC_GET_FILE || p->cmd == FSP_CC_UP_LOAD ||
374
p->cmd == FSP_CC_GRAB_FILE || p->cmd == FSP_CC_INFO) )
366
/* now we have a correct packet */
380
/* now we have a correct packet */
368
/* compute rtt delay */
382
/* compute rtt delay */
460
s->fd=fd;
474
s->fd=fd;
461
s->timeout=300000; /* 5 minutes */
475
s->timeout=300000; /* 5 minutes */
462
s->maxdelay=60000; /* 1 minute */
476
s->maxdelay=60000; /* 1 minute */
463
s->seq=random();
477
s->seq=random() & 0xfff8;
464
if ( password )
478
if ( password )
465
s->password = strdup(password);
479
s->password = strdup(password);
466
return s;
480
return s;
524
pos = -1;
538
pos = -1;
527
if ( in.cmd != FSP_CC_GET_DIR )
541
if ( in.cmd == FSP_CC_ERR )
529
/* bad reply from the server */
543
/* bad reply from the server */
530
pos = -1;
544
pos = -1;
569
free(dir->data);
583
free(dir->data);
570
free(dir);
584
free(dir);
572
return NULL;
587
return NULL;
576
dir->blocksize=blocksize;
591
dir->blocksize=blocksize;
577
dir->dirname=strdup(dirname);
592
dir->dirname=strdup(dirname);
578
dir->datasize=pos;
593
dir->datasize=pos;
580
return dir;
596
return dir;
850
file->err=1;
866
file->err=1;
851
return done/size;
867
return done/size;
853
if(file->in.cmd != FSP_CC_GET_FILE)
869
if(file->in.cmd == FSP_CC_ERR)
855
errno = EIO;
871
errno = EIO;
856
file->err=1;
872
file->err=1;
916
file->err=1;
932
file->err=1;
917
return done/size;
933
return done/size;
919
if(file->in.cmd != FSP_CC_UP_LOAD)
935
if(file->in.cmd == FSP_CC_ERR)
921
errno = EIO;
937
errno = EIO;
922
file->err=1;
938
file->err=1;
985
file->err=1;
1001
file->err=1;
986
return -1;
1002
return -1;
988
if(file->in.cmd != FSP_CC_UP_LOAD)
1004
if(file->in.cmd == FSP_CC_ERR)
990
errno = EIO;
1006
errno = EIO;
991
file->err=1;
1007
file->err=1;
1143
if(in.cmd != FSP_CC_INSTALL)
1159
if(in.cmd == FSP_CC_ERR)
1146
errno = EPERM;
1162
errno = EPERM;
1164
if(fsp_transaction(s,&out,&in))
1180
if(fsp_transaction(s,&out,&in))
1165
return -1;
1181
return -1;
1167
if(in.cmd != FSP_CC_GET_PRO || in.pos != FSP_PRO_BYTES)
1183
if(in.cmd == FSP_CC_ERR)
1188
if(in.pos != FSP_PRO_BYTES)
1169
errno = ENOMSG;
1190
errno = ENOMSG;
1170
return -1;
1191
return -1;
1190
if(fsp_transaction(s,&out,&in))
1211
if(fsp_transaction(s,&out,&in))
1191
return -1;
1212
return -1;
1193
if(in.cmd != FSP_CC_STAT)
1214
if(in.cmd == FSP_CC_ERR)
1195
errno = ENOTSUP;
1216
errno = ENOTSUP;
1196
return -1;
1217
return -1;
1272
if(fsp_transaction(s,&out,&in))
1293
if(fsp_transaction(s,&out,&in))
1273
return -1;
1294
return -1;
1275
if(in.cmd != FSP_CC_RENAME)
1296
if(in.cmd == FSP_CC_ERR)
1277
errno = EPERM;
1298
errno = EPERM;
1278
return -1;
1299
return -1;
2
#include <assert.h>
2
#include <assert.h>
3
#include <dirent.h>
3
#include <dirent.h>
4
#include <unistd.h>
4
#include <unistd.h>
5
#include <sys/stat.h>
6
#include <sys/stat.h>
6
#include "fsplib.h"
7
#include "fsplib.h"
14
FSP_FILE *f;
15
FSP_FILE *f;
15
struct dirent *d;
16
struct dirent *d;
16
FSP_DIR *dir;
17
FSP_DIR *dir;
18
printf("Checking for fsp/udp service\n");
20
printf("Checking for fsp/udp service\n");
19
s=fsp_open_session("localhost",0,NULL);
21
s=fsp_open_session("localhost",0,NULL);
20
assert(s);
22
assert(s);
21
fsp_close_session(s);
23
fsp_close_session(s);
23
printf("Running tests against fspd on localhost 2000\n");
25
if(argc>1)
24
s=fsp_open_session("localhost",2000,NULL);
26
port=atoi(argv[1]);
27
printf("Running tests against fspd on localhost %d\n",port);
28
s=fsp_open_session("localhost",port,NULL);
25
assert(s);
29
assert(s);
26
s->timeout=9000;
30
s->timeout=9000;