Tor  0.4.7.0-alpha-dev
Data Fields
spooled_resource_t Struct Reference

#include <dirserv.h>

Data Fields

unsigned spool_eagerly: 1
 
dir_spool_source_bitfield_t spool_source: 7
 
uint8_t digest [DIGEST256_LEN]
 
struct cached_dir_tcached_dir_ref
 
struct consensus_cache_entry_tconsensus_cache_entry
 
const uint8_t * cce_body
 
size_t cce_len
 
off_t cached_dir_offset
 

Detailed Description

Object to remember the identity of an object that we are spooling, or about to spool, in response to a directory request.

(Why do we spool? Because some directory responses are very large, and we don't want to just shove the complete answer into the output buffer: that would take a ridiculous amount of RAM.)

If the spooled resource is relatively small (like microdescriptors, descriptors, etc), we look them up by ID as needed, and add the whole thing onto the output buffer at once. If the spooled reseource is big (like networkstatus documents), we reference-count it, and add it a few K at a time.

Definition at line 42 of file dirserv.h.

Field Documentation

◆ cached_dir_offset

off_t cached_dir_offset

The current offset into cached_dir or cce_body. Only used when spool_eagerly is false

Definition at line 71 of file dirserv.h.

◆ cached_dir_ref

struct cached_dir_t* cached_dir_ref

A large object that we're spooling. Holds a reference count. Only used when spool_eagerly is false.

Definition at line 60 of file dirserv.h.

Referenced by spooled_resource_estimate_size(), and spooled_resource_free_().

◆ consensus_cache_entry

struct consensus_cache_entry_t* consensus_cache_entry

A different kind of large object that we might be spooling. Also reference-counted. Also only used when spool_eagerly is false.

Definition at line 65 of file dirserv.h.

Referenced by spooled_resource_estimate_size(), and spooled_resource_free_().

◆ digest

uint8_t digest[DIGEST256_LEN]

Tells us the specific object to spool.

Definition at line 55 of file dirserv.h.

Referenced by dirserv_spool_sort_comparison_(), and spooled_resource_lookup_cached_dir().

◆ spool_eagerly

unsigned spool_eagerly

If true, we add the entire object to the outbuf. If false, we spool the object a few K at a time.

Definition at line 47 of file dirserv.h.

Referenced by spooled_resource_estimate_size(), spooled_resource_flush_some(), spooled_resource_lookup_body(), and spooled_resource_lookup_cached_dir().

◆ spool_source

dir_spool_source_bitfield_t spool_source

Tells us what kind of object to get, and how to look it up.

Definition at line 51 of file dirserv.h.

Referenced by spooled_resource_estimate_size(), and spooled_resource_lookup_body().


The documentation for this struct was generated from the following file: