X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=daemon%2Fclient.c;h=50da10dea9f8ff906b6a49a527f9014922fb4c60;hb=e194f2fdfdde54a19e3e94a63f70580b6da0854a;hp=f1731213aeca2545855579c48be90c75b8065911;hpb=6c21fc1d9e0619908e0b02006309ef59a8498cb3;p=doldaconnect.git diff --git a/daemon/client.c b/daemon/client.c index f173121..50da10d 100644 --- a/daemon/client.c +++ b/daemon/client.c @@ -539,13 +539,10 @@ static void checkhashes(void) char *path; node = shareroot->child; - while(1) + for(node = shareroot->child; node != NULL; node = nextscnode(node)) { - if(node->child != NULL) - { - node = node->child; + if(node->f.b.type != FILE_REG) continue; - } if(!node->f.b.hastth) { if((hc = findhashcache(node->dev, node->inode)) != NULL) @@ -559,19 +556,14 @@ static void checkhashes(void) { flog(LOG_WARNING, "could not hash %s, unsharing it", path); freecache(node); + free(path); + flog(LOG_INFO, "sharing %lli bytes", sharesize); + continue; } free(path); return; } } - while(node->next == NULL) - { - if((node = node->parent) == shareroot) - break; - } - if(node == shareroot) - break; - node = node->next; } }