Mostly fixed scanning bug

This commit is contained in:
Ron Pedde 2003-11-07 04:54:24 +00:00
parent 0276f523ff
commit dd0569502c
3 changed files with 13 additions and 8 deletions

View File

@ -272,11 +272,13 @@ int daap_serialmem(DAAP_BLOCK *root, char *where) {
where+=root->size;
}
if(daap_serialmem(root->children,where))
return -1;
where += root->reported_size;
if(root->children) {
if(daap_serialmem(root->children,where))
return -1;
where += root->reported_size;
}
if(daap_serialmem(root->next,where))
return -1;
@ -301,7 +303,7 @@ int daap_serialize(DAAP_BLOCK *root, int fd, int gzip) {
int err;
uncompressed_len = root->reported_size + 8;
uncompressed=(char*)malloc(uncompressed_len);
uncompressed=(char*)malloc(uncompressed_len+1);
if(!uncompressed) {
DPRINTF(ERR_INFO,"Error allocating serialization block\n");
return -1;

View File

@ -87,12 +87,13 @@ int scan_foreground(char *path) {
pde=&de;
err=readdir_r(current_dir,&de,&pde);
if(err == -1) {
DPRINTF(ERR_DEBUG,"Error on readdir_r: %s\n",strerror(errno));
err=errno;
closedir(current_dir);
errno=err;
return -1;
}
if(!pde)
break;
@ -106,6 +107,8 @@ int scan_foreground(char *path) {
mp3file.path=mp3_path;
mp3file.fname=de.d_name;
/* Do the tag lookup here */
db_add(&mp3file);
}
}

View File

@ -1,4 +1,4 @@
web_root /home/ron/working/mt-daapd/admin-root
port 3689
admin_password secret
mp3_dir /home/ron/mp3
mp3_dir mp3