Dolda2000 GitWeb
/
doldaconnect.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Clarified the dscp-tos documentation a bit.
[doldaconnect.git]
/
daemon
/
client.c
diff --git
a/daemon/client.c
b/daemon/client.c
index
bf30821
..
46766e9
100644
(file)
--- a/
daemon/client.c
+++ b/
daemon/client.c
@@
-106,6
+106,7
@@
static struct timer *hashwritetimer = NULL;
static pid_t hashjob = -1;
struct sharecache *shareroot = NULL;
static struct timer *scantimer = NULL;
static pid_t hashjob = -1;
struct sharecache *shareroot = NULL;
static struct timer *scantimer = NULL;
+int sharedfiles = 0;
unsigned long long sharesize = 0;
GCBCHAIN(sharechangecb, unsigned long long);
unsigned long long sharesize = 0;
GCBCHAIN(sharechangecb, unsigned long long);
@@
-648,6
+649,8
@@
static void freecache(struct sharecache *node)
CBCHAINDOCB(node, share_delete, node);
CBCHAINFREE(node, share_delete);
sharesize -= node->size;
CBCHAINDOCB(node, share_delete, node);
CBCHAINFREE(node, share_delete);
sharesize -= node->size;
+ if(node->f.b.type == FILE_REG)
+ sharedfiles--;
if(node->path != NULL)
free(node->path);
if(node->name != NULL)
if(node->path != NULL)
free(node->path);
if(node->name != NULL)
@@
-938,6
+941,7
@@
int doscan(int quantum)
if(S_ISREG(sb.st_mode))
{
sharesize += (n->size = sb.st_size);
if(S_ISREG(sb.st_mode))
{
sharesize += (n->size = sb.st_size);
+ sharedfiles++;
} else {
n->size = 0;
}
} else {
n->size = 0;
}
@@
-1082,6
+1086,8
@@
static void terminate(void)
{
if(hashjob != 0)
kill(hashjob, SIGHUP);
{
if(hashjob != 0)
kill(hashjob, SIGHUP);
+ if(hashwritetimer != NULL)
+ writehashcache(1);
while(shares != NULL)
freesharepoint(shares);
freecache(shareroot);
while(shares != NULL)
freesharepoint(shares);
freecache(shareroot);