fixed du file size

This commit is contained in:
Fufu Fang 2018-07-25 00:30:31 +01:00
parent 1816b7913d
commit d979112b4e
2 changed files with 5 additions and 0 deletions

2
main.c
View File

@ -92,6 +92,8 @@ static int fs_getattr(const char *path, struct stat *stbuf)
stbuf->st_mode = S_IFREG | 0444;
stbuf->st_nlink = 1;
stbuf->st_size = link->content_length;
stbuf->st_blksize = 128*1024;
stbuf->st_blocks = (link->content_length)/512;
break;
default:
return -ENOENT;

View File

@ -574,6 +574,8 @@ void LinkTable_fill(LinkTable *linktbl)
if (this_link->type == LINK_FILE && !(this_link->content_length)) {
Link_get_stat(this_link);
} else if (this_link->type == LINK_DIR) {
this_link->time = head_link->time;
}
}
}
@ -617,6 +619,7 @@ URL: %s, HTTP %ld\n", url, http_resp);
linktbl = NULL;
return linktbl;
};
curl_easy_getinfo(curl, CURLINFO_FILETIME, &(head_link->time));
curl_easy_cleanup(curl);
/* Otherwise parsed the received data */