Commit 3cdf2d67 authored by Roger Dingledine's avatar Roger Dingledine
Browse files

it's amazing what a bit of punctuation can do for appearances


svn:r1843
parent 07871a8a
...@@ -172,7 +172,7 @@ crypto_pk_env_t *_crypto_new_pk_env_rsa(RSA *rsa) ...@@ -172,7 +172,7 @@ crypto_pk_env_t *_crypto_new_pk_env_rsa(RSA *rsa)
return env; return env;
} }
/** used by tortls.c: return the RSA* from a crypto_pk_env_t */ /** used by tortls.c: return the RSA* from a crypto_pk_env_t. */
RSA *_crypto_pk_env_get_rsa(crypto_pk_env_t *env) RSA *_crypto_pk_env_get_rsa(crypto_pk_env_t *env)
{ {
return env->key; return env->key;
...@@ -1062,9 +1062,9 @@ crypto_digest_assign(crypto_digest_env_t *into, ...@@ -1062,9 +1062,9 @@ crypto_digest_assign(crypto_digest_env_t *into,
/* DH */ /* DH */
/** Shared P parameter for our DH key exchanged */ /** Shared P parameter for our DH key exchanged. */
static BIGNUM *dh_param_p = NULL; static BIGNUM *dh_param_p = NULL;
/** Shared G parameter for our DH key exchanges */ /** Shared G parameter for our DH key exchanges. */
static BIGNUM *dh_param_g = NULL; static BIGNUM *dh_param_g = NULL;
/** Initialize dh_param_p and dh_param_g if they are not already /** Initialize dh_param_p and dh_param_g if they are not already
...@@ -1332,7 +1332,7 @@ void crypto_pseudo_rand(unsigned int n, unsigned char *to) ...@@ -1332,7 +1332,7 @@ void crypto_pseudo_rand(unsigned int n, unsigned char *to)
} }
/** Return a pseudorandom integer, choosen uniformly from the values /** Return a pseudorandom integer, choosen uniformly from the values
* between 0 and max-1 */ * between 0 and max-1. */
int crypto_pseudo_rand_int(unsigned int max) { int crypto_pseudo_rand_int(unsigned int max) {
unsigned int val; unsigned int val;
unsigned int cutoff; unsigned int cutoff;
......
...@@ -23,15 +23,15 @@ ...@@ -23,15 +23,15 @@
/** Information for a single logfile; only used in log.c */ /** Information for a single logfile; only used in log.c */
typedef struct logfile_t { typedef struct logfile_t {
struct logfile_t *next; /**< Next logfile_t in the linked list */ struct logfile_t *next; /**< Next logfile_t in the linked list. */
const char *filename; /**< Filename to open */ const char *filename; /**< Filename to open. */
FILE *file; /**< Stream to receive log messages */ FILE *file; /**< Stream to receive log messages. */
int needs_close; /**< Boolean: true if the stream gets closed on shutdown. */ int needs_close; /**< Boolean: true if the stream gets closed on shutdown. */
int loglevel; /**< Lowest severity level to send to this stream. */ int loglevel; /**< Lowest severity level to send to this stream. */
int max_loglevel; /**< Highest severity level to send to this stream. */ int max_loglevel; /**< Highest severity level to send to this stream. */
} logfile_t; } logfile_t;
/** Helper: map a log severity to descriptive string */ /** Helper: map a log severity to descriptive string. */
static INLINE const char *sev_to_string(int severity) { static INLINE const char *sev_to_string(int severity) {
switch(severity) { switch(severity) {
case LOG_DEBUG: return "debug"; case LOG_DEBUG: return "debug";
...@@ -43,7 +43,7 @@ static INLINE const char *sev_to_string(int severity) { ...@@ -43,7 +43,7 @@ static INLINE const char *sev_to_string(int severity) {
} }
} }
/** Linked list of logfile_t */ /** Linked list of logfile_t. */
static logfile_t *logfiles = NULL; static logfile_t *logfiles = NULL;
/** Helper: Format a log message into a fixed-sized buffer. (This is /** Helper: Format a log message into a fixed-sized buffer. (This is
...@@ -126,7 +126,7 @@ void _log(int severity, const char *format, ...) ...@@ -126,7 +126,7 @@ void _log(int severity, const char *format, ...)
va_end(ap); va_end(ap);
} }
/** Output a message to the log, prefixed with a function name <b>fn</b> */ /** Output a message to the log, prefixed with a function name <b>fn</b>. */
void _log_fn(int severity, const char *fn, const char *format, ...) void _log_fn(int severity, const char *fn, const char *format, ...)
{ {
va_list ap; va_list ap;
...@@ -135,7 +135,7 @@ void _log_fn(int severity, const char *fn, const char *format, ...) ...@@ -135,7 +135,7 @@ void _log_fn(int severity, const char *fn, const char *format, ...)
va_end(ap); va_end(ap);
} }
/** Close all open log files */ /** Close all open log files. */
void close_logs() void close_logs()
{ {
logfile_t *victim; logfile_t *victim;
...@@ -178,7 +178,7 @@ void add_stream_log(int loglevel, const char *name, FILE *stream) ...@@ -178,7 +178,7 @@ void add_stream_log(int loglevel, const char *name, FILE *stream)
/** /**
* Add a log handler to send messages to <b>filename</b>. If opening * Add a log handler to send messages to <b>filename</b>. If opening
* the logfile fails, -1 is returned and errno is set appropriately * the logfile fails, -1 is returned and errno is set appropriately
* (by fopen) * (by fopen).
*/ */
int add_file_log(int loglevel, const char *filename) int add_file_log(int loglevel, const char *filename)
{ {
......
...@@ -38,18 +38,18 @@ typedef struct tor_tls_context_st { ...@@ -38,18 +38,18 @@ typedef struct tor_tls_context_st {
} tor_tls_context; } tor_tls_context;
/** Holds a SSL object and its associated data. Members are only /** Holds a SSL object and its associated data. Members are only
* accessed from within tortls.c * accessed from within tortls.c.
*/ */
struct tor_tls_st { struct tor_tls_st {
SSL *ssl; /**< An OpenSSL SSL object */ SSL *ssl; /**< An OpenSSL SSL object. */
int socket; /**< The underlying file descriptor for this TLS connection */ int socket; /**< The underlying file descriptor for this TLS connection. */
enum { enum {
TOR_TLS_ST_HANDSHAKE, TOR_TLS_ST_OPEN, TOR_TLS_ST_GOTCLOSE, TOR_TLS_ST_HANDSHAKE, TOR_TLS_ST_OPEN, TOR_TLS_ST_GOTCLOSE,
TOR_TLS_ST_SENTCLOSE, TOR_TLS_ST_CLOSED TOR_TLS_ST_SENTCLOSE, TOR_TLS_ST_CLOSED
} state; /**< The current SSL state, depending on which operations have } state; /**< The current SSL state, depending on which operations have
* completed successfully. */ * completed successfully. */
int isServer; int isServer;
int wantwrite_n; /**< 0 normally, >0 if we returned wantwrite last time */ int wantwrite_n; /**< 0 normally, >0 if we returned wantwrite last time. */
}; };
static X509* tor_tls_create_certificate(crypto_pk_env_t *rsa, static X509* tor_tls_create_certificate(crypto_pk_env_t *rsa,
...@@ -59,7 +59,7 @@ static X509* tor_tls_create_certificate(crypto_pk_env_t *rsa, ...@@ -59,7 +59,7 @@ static X509* tor_tls_create_certificate(crypto_pk_env_t *rsa,
unsigned int lifetime); unsigned int lifetime);
/** Global tls context. We keep it here because nobody else needs to /** Global tls context. We keep it here because nobody else needs to
* touch it */ * touch it. */
static tor_tls_context *global_tls_context = NULL; static tor_tls_context *global_tls_context = NULL;
/** True iff tor_tls_init() has been called. */ /** True iff tor_tls_init() has been called. */
static int tls_library_is_initialized = 0; static int tls_library_is_initialized = 0;
......
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
#include "or.h" #include "or.h"
extern or_options_t options; /**< command-line and config-file options */ extern or_options_t options; /* command-line and config-file options */
/** keep statistics about how many of each type of cell we've received */ /** Keep statistics about how many of each type of cell we've received. */
unsigned long stats_n_padding_cells_processed = 0; unsigned long stats_n_padding_cells_processed = 0;
unsigned long stats_n_create_cells_processed = 0; unsigned long stats_n_create_cells_processed = 0;
unsigned long stats_n_created_cells_processed = 0; unsigned long stats_n_created_cells_processed = 0;
......
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
/********* START VARIABLES **********/ /********* START VARIABLES **********/
extern or_options_t options; /**< command-line and config-file options */ extern or_options_t options; /* command-line and config-file options */
/** Array of strings to make conn-\>type human-readable */ /** Array of strings to make conn-\>type human-readable. */
char *conn_type_to_string[] = { char *conn_type_to_string[] = {
"", /* 0 */ "", /* 0 */
"OP listener", /* 1 */ "OP listener", /* 1 */
...@@ -30,7 +30,7 @@ char *conn_type_to_string[] = { ...@@ -30,7 +30,7 @@ char *conn_type_to_string[] = {
"CPU worker", /* 11 */ "CPU worker", /* 11 */
}; };
/** Array of string arrays to make {conn-\>type,conn-\>state} human-readable */ /** Array of string arrays to make {conn-\>type,conn-\>state} human-readable. */
char *conn_state_to_string[][_CONN_TYPE_MAX+1] = { char *conn_state_to_string[][_CONN_TYPE_MAX+1] = {
{ NULL }, /* no type associated with 0 */ { NULL }, /* no type associated with 0 */
{ NULL }, /* op listener, obsolete */ { NULL }, /* op listener, obsolete */
......
...@@ -1487,7 +1487,7 @@ int connection_ap_can_use_exit(connection_t *conn, routerinfo_t *exit) ...@@ -1487,7 +1487,7 @@ int connection_ap_can_use_exit(connection_t *conn, routerinfo_t *exit)
* below as its root. * below as its root.
*/ */
struct client_dns_entry { struct client_dns_entry {
uint32_t addr; /**< The resolved IP of this entry */ uint32_t addr; /**< The resolved IP of this entry. */
time_t expires; /**< At what second does addr expire? */ time_t expires; /**< At what second does addr expire? */
int n_failures; /**< How many times has this entry failed to resolve so far? */ int n_failures; /**< How many times has this entry failed to resolve so far? */
}; };
......
/* Copyright 2003 Roger Dingledine. */ /* Copyright 2003-2004 Roger Dingledine. */
/* See LICENSE for licensing information */ /* See LICENSE for licensing information */
/* $Id$ */ /* $Id$ */
...@@ -11,27 +11,27 @@ ...@@ -11,27 +11,27 @@
**/ **/
#include "or.h" #include "or.h"
extern or_options_t options; /**< command-line and config-file options */ extern or_options_t options; /* command-line and config-file options */
/** The maximum number of cpuworker processes we will keep around */ /** The maximum number of cpuworker processes we will keep around. */
#define MAX_CPUWORKERS 16 #define MAX_CPUWORKERS 16
/** The minimum number of cpuworker processes we will keep around */ /** The minimum number of cpuworker processes we will keep around. */
#define MIN_CPUWORKERS 1 #define MIN_CPUWORKERS 1
/** The tag specifies which circuit this onionskin was from */ /** The tag specifies which circuit this onionskin was from. */
#define TAG_LEN 8 #define TAG_LEN 8
/** How many bytes are sent from tor to the cpuworker? */ /** How many bytes are sent from tor to the cpuworker? */
#define LEN_ONION_QUESTION (1+TAG_LEN+ONIONSKIN_CHALLENGE_LEN) #define LEN_ONION_QUESTION (1+TAG_LEN+ONIONSKIN_CHALLENGE_LEN)
/** How many bytes are sent from the cpuworker back to tor? */ /** How many bytes are sent from the cpuworker back to tor? */
#define LEN_ONION_RESPONSE (1+TAG_LEN+ONIONSKIN_REPLY_LEN+40+32) #define LEN_ONION_RESPONSE (1+TAG_LEN+ONIONSKIN_REPLY_LEN+40+32)
/** How many cpuworkers we have running right now */ /** How many cpuworkers we have running right now. */
static int num_cpuworkers=0; static int num_cpuworkers=0;
/** How many of the running cpuworkers have an assigned task right now */ /** How many of the running cpuworkers have an assigned task right now. */
static int num_cpuworkers_busy=0; static int num_cpuworkers_busy=0;
/** We need to spawn new cpuworkers whenever we rotate the onion keys /** We need to spawn new cpuworkers whenever we rotate the onion keys
* on platforms where execution contexts==processes. This variable stores * on platforms where execution contexts==processes. This variable stores
* the last time we got a key rotation event.*/ * the last time we got a key rotation event. */
static time_t last_rotation_time=0; static time_t last_rotation_time=0;
int cpuworker_main(void *data); int cpuworker_main(void *data);
...@@ -312,7 +312,7 @@ static void spawn_enough_cpuworkers(void) { ...@@ -312,7 +312,7 @@ static void spawn_enough_cpuworkers(void) {
} }
} }
/** Take a pending task from the queue and assign it to 'cpuworker' */ /** Take a pending task from the queue and assign it to 'cpuworker'. */
static void process_pending_task(connection_t *cpuworker) { static void process_pending_task(connection_t *cpuworker) {
circuit_t *circ; circuit_t *circ;
......
...@@ -29,14 +29,14 @@ extern or_options_t options; /* command-line and config-file options */ ...@@ -29,14 +29,14 @@ extern or_options_t options; /* command-line and config-file options */
#define MAX_IDLE_DNSWORKERS 10 #define MAX_IDLE_DNSWORKERS 10
/** Possible outcomes from hostname lookup: permanent failure, /** Possible outcomes from hostname lookup: permanent failure,
* transient (retryable) failure, and success */ * transient (retryable) failure, and success. */
#define DNS_RESOLVE_FAILED_TRANSIENT 1 #define DNS_RESOLVE_FAILED_TRANSIENT 1
#define DNS_RESOLVE_FAILED_PERMANENT 2 #define DNS_RESOLVE_FAILED_PERMANENT 2
#define DNS_RESOLVE_SUCCEEDED 3 #define DNS_RESOLVE_SUCCEEDED 3
/** How many dnsworkers we have running right now */ /** How many dnsworkers we have running right now. */
int num_dnsworkers=0; int num_dnsworkers=0;
/** How many of the running dnsworkers have an assigned task right now */ /** How many of the running dnsworkers have an assigned task right now. */
int num_dnsworkers_busy=0; int num_dnsworkers_busy=0;
/** Linked list of connections waiting for a DNS answer. */ /** Linked list of connections waiting for a DNS answer. */
...@@ -51,13 +51,13 @@ struct pending_connection_t { ...@@ -51,13 +51,13 @@ struct pending_connection_t {
*/ */
struct cached_resolve { struct cached_resolve {
SPLAY_ENTRY(cached_resolve) node; SPLAY_ENTRY(cached_resolve) node;
char address[MAX_ADDRESSLEN]; /**< The hostname to be resolved */ char address[MAX_ADDRESSLEN]; /**< The hostname to be resolved. */
uint32_t addr; /**< IPv4 addr for <b>address</b>. */ uint32_t addr; /**< IPv4 addr for <b>address</b>. */
char state; /**< 0 is pending; 1 means answer is valid; 2 means resolve failed */ char state; /**< 0 is pending; 1 means answer is valid; 2 means resolve failed. */
#define CACHE_STATE_PENDING 0 #define CACHE_STATE_PENDING 0
#define CACHE_STATE_VALID 1 #define CACHE_STATE_VALID 1
#define CACHE_STATE_FAILED 2 #define CACHE_STATE_FAILED 2
uint32_t expire; /**< Remove items from cache after this time */ uint32_t expire; /**< Remove items from cache after this time. */
struct pending_connection_t *pending_connections; struct pending_connection_t *pending_connections;
struct cached_resolve *next; struct cached_resolve *next;
}; };
...@@ -70,7 +70,7 @@ int dnsworker_main(void *data); ...@@ -70,7 +70,7 @@ int dnsworker_main(void *data);
static int spawn_dnsworker(void); static int spawn_dnsworker(void);
static void spawn_enough_dnsworkers(void); static void spawn_enough_dnsworkers(void);
/** Splay tree of cached_resolve objects */ /** Splay tree of cached_resolve objects. */
static SPLAY_HEAD(cache_tree, cached_resolve) cache_root; static SPLAY_HEAD(cache_tree, cached_resolve) cache_root;
/** Function to compare hashed resolves on their addresses; used to /** Function to compare hashed resolves on their addresses; used to
...@@ -84,7 +84,7 @@ static int compare_cached_resolves(struct cached_resolve *a, ...@@ -84,7 +84,7 @@ static int compare_cached_resolves(struct cached_resolve *a,
SPLAY_PROTOTYPE(cache_tree, cached_resolve, node, compare_cached_resolves); SPLAY_PROTOTYPE(cache_tree, cached_resolve, node, compare_cached_resolves);
SPLAY_GENERATE(cache_tree, cached_resolve, node, compare_cached_resolves); SPLAY_GENERATE(cache_tree, cached_resolve, node, compare_cached_resolves);
/** Initialize the DNS cache */ /** Initialize the DNS cache. */
static void init_cache_tree(void) { static void init_cache_tree(void) {
SPLAY_INIT(&cache_root); SPLAY_INIT(&cache_root);
} }
...@@ -95,7 +95,7 @@ void dns_init(void) { ...@@ -95,7 +95,7 @@ void dns_init(void) {
spawn_enough_dnsworkers(); spawn_enough_dnsworkers();
} }
/** Linked list of resolved addresses, oldest to newest */ /** Linked list of resolved addresses, oldest to newest. */
static struct cached_resolve *oldest_cached_resolve = NULL; static struct cached_resolve *oldest_cached_resolve = NULL;
static struct cached_resolve *newest_cached_resolve = NULL; static struct cached_resolve *newest_cached_resolve = NULL;
......
...@@ -19,8 +19,8 @@ static int init_from_config(int argc, char **argv); ...@@ -19,8 +19,8 @@ static int init_from_config(int argc, char **argv);
/* declared in connection.c */ /* declared in connection.c */
extern char *conn_state_to_string[][_CONN_TYPE_MAX+1]; extern char *conn_state_to_string[][_CONN_TYPE_MAX+1];
or_options_t options; /**< command-line and config-file options */ or_options_t options; /**< Command-line and config-file options. */
int global_read_bucket; /**< max number of bytes I can read this second */ int global_read_bucket; /**< Max number of bytes I can read this second. */
/** What was the read bucket before the last call to prepare_for_pool? /** What was the read bucket before the last call to prepare_for_pool?
* (used to determine how many bytes we've read). */ * (used to determine how many bytes we've read). */
...@@ -38,12 +38,12 @@ static connection_t *connection_array[MAXCONNECTIONS] = ...@@ -38,12 +38,12 @@ static connection_t *connection_array[MAXCONNECTIONS] =
/** Array of pollfd objects for calls to poll(). */ /** Array of pollfd objects for calls to poll(). */
static struct pollfd poll_array[MAXCONNECTIONS]; static struct pollfd poll_array[MAXCONNECTIONS];
static int nfds=0; /**< number of connections currently active */ static int nfds=0; /**< Number of connections currently active. */
#ifndef MS_WINDOWS /* do signal stuff only on unix */ #ifndef MS_WINDOWS /* do signal stuff only on unix */
static int please_dumpstats=0; /**< whether we should dump stats during the loop */ static int please_dumpstats=0; /**< Whether we should dump stats during the loop. */
static int please_reset=0; /**< whether we just got a sighup */ static int please_reset=0; /**< Whether we just got a sighup. */
static int please_reap_children=0; /**< whether we should waitpid for exited children */ static int please_reap_children=0; /**< Whether we should waitpid for exited children. */
#endif /* signal stuff */ #endif /* signal stuff */
/** We set this to 1 when we've fetched a dir, to know whether to complain /** We set this to 1 when we've fetched a dir, to know whether to complain
......
This diff is collapsed.
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
extern or_options_t options; /* command-line and config-file options */ extern or_options_t options; /* command-line and config-file options */
/** exposed for test.c */ void get_platform_str(char *platform, int len); /** Exposed for test.c. */ void get_platform_str(char *platform, int len);
/************************************************************/ /************************************************************/
...@@ -305,9 +305,9 @@ void router_retry_connections(void) { ...@@ -305,9 +305,9 @@ void router_retry_connections(void) {
* OR descriptor generation. * OR descriptor generation.
*/ */
/** my routerinfo. */ /** My routerinfo. */
static routerinfo_t *desc_routerinfo = NULL; static routerinfo_t *desc_routerinfo = NULL;
/** string representation of my descriptor, signed by me. */ /** String representation of my descriptor, signed by me. */
static char descriptor[8192]; static char descriptor[8192];
/** OR only: try to upload our signed descriptor to all the directory servers /** OR only: try to upload our signed descriptor to all the directory servers
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment