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

View File

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

View File

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