From: fredrik Date: Sat, 3 Jun 2006 20:09:41 +0000 (+0000) Subject: Handle errors while hashing better. X-Git-Tag: 0.1~15 X-Git-Url: http://git.dolda2000.com/gitweb/?p=doldaconnect.git;a=commitdiff_plain;h=e194f2fdfdde54a19e3e94a63f70580b6da0854a Handle errors while hashing better. git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@641 959494ce-11ee-0310-bf91-de5d638817bd --- 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; } }