The in-core cache is filled with the persistent one at launch. When the "shared_file" (the records describing the shared files, see share.h) are created, a call is made to sha1_set_digest to fill the SHA1 digest part of the shared_file. If the digest isn't found in the in-core cache, it's computed, stored in the in-core cache and appended at the end of the persistent cache. If the digest is found in the cache, a check is made based on the file size and last modification time. If they're identical to the ones in the cache, the digest is considered to be accurate, and is used. If the file size or last modification time don't match, the digest is computed again and stored in the in-core cache, but it isn't stored in the persistent one. Instead, the cache is marked as dirty, and will be entirely overwritten by dump_cache, called when everything has been computed.
Data Fields | |
gchar * | file_name |
Full path name. | |
filesize_t | size |
File size. | |
time_t | mtime |
Last modification time. | |
gchar | digest [SHA1_RAW_SIZE] |
SHA1 digest as a binary string. | |
gboolean | shared |
There's a known entry for this file in the share library. |
|
SHA1 digest as a binary string.
|
|
Full path name.
|
|
Last modification time.
|
|
There's a known entry for this file in the share library.
|
|
File size.
|