Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

sha1_cache_entry Struct Reference


Detailed Description

There's an in-core cache (the GHashTable sha1_cache), and a persistent copy (normally in ~/.gtk-gnutella/sha1_cache).

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.


Field Documentation

gchar sha1_cache_entry::digest[SHA1_RAW_SIZE]
 

SHA1 digest as a binary string.

gchar* sha1_cache_entry::file_name
 

Full path name.

time_t sha1_cache_entry::mtime
 

Last modification time.

gboolean sha1_cache_entry::shared
 

There's a known entry for this file in the share library.

filesize_t sha1_cache_entry::size
 

File size.


The documentation for this struct was generated from the following file:
Generated on Sun Feb 12 10:50:13 2006 for Gtk-Gnutella by doxygen 1.3.6