mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 13:53:31 +01:00
minor cleanups
svn:r8622
This commit is contained in:
parent
8ba5471de3
commit
06e5b2283c
@ -65,9 +65,9 @@ Changes in version 0.1.2.2-alpha - 2006-10-??
|
||||
a hostname; any router can call itself Unnamed; directory
|
||||
authorities will never allocate Unnamed to any particular router;
|
||||
clients won't believe that any router is the canonical Unnamed.
|
||||
- Only include function names in log messages for debugging messages;
|
||||
in other cases, the content of the message should be clear on its
|
||||
own, and including the function name only seems to confuse users.
|
||||
- Only include function names in log messages for info/debug messages.
|
||||
For notice/warn/err, the content of the message should be clear on
|
||||
its own, and printing the function name only seems to confuse users.
|
||||
- Avoid some false positives during reachability testing: don't try
|
||||
to test via a server that's on the same /24 as us.
|
||||
- New controller event to alert the controller when our server
|
||||
@ -176,7 +176,7 @@ Changes in version 0.1.2.2-alpha - 2006-10-??
|
||||
- Be clearer that the *ListenAddress directives can be repeated
|
||||
multiple times.
|
||||
|
||||
(stopped at r8519)
|
||||
(stopped at r8536)
|
||||
- Build correctly for use on OS X platforms with case-sensitive
|
||||
filesystems.
|
||||
|
||||
|
@ -727,7 +727,7 @@ TODO:
|
||||
with a REASON_NOTDIRECTORY RELAY_END cell.
|
||||
|
||||
[RELAY_BEGIN_DIR was not supported before Tor 0.1.2.2-alpha; clients
|
||||
SHOULD NOT send it to routers running earlier version of Tor.]
|
||||
SHOULD NOT send it to routers running earlier versions of Tor.]
|
||||
|
||||
6.3. Closing streams
|
||||
|
||||
|
@ -542,7 +542,7 @@ smartlist_heapify(smartlist_t *sl,
|
||||
}
|
||||
|
||||
/** Insert <b>item</b> into the heap stored in <b>sl</b>, where order
|
||||
* is determined by <b>compare</b> */
|
||||
* is determined by <b>compare</b>. */
|
||||
void
|
||||
smartlist_pqueue_add(smartlist_t *sl,
|
||||
int (*compare)(const void *a, const void *b),
|
||||
@ -636,7 +636,7 @@ strmap_entries_eq(strmap_entry_t *a, strmap_entry_t *b)
|
||||
return !strcmp(a->key, b->key);
|
||||
}
|
||||
|
||||
/** Helper: return a hash value for a strmap_entry_t */
|
||||
/** Helper: return a hash value for a strmap_entry_t. */
|
||||
static INLINE unsigned int
|
||||
strmap_entry_hash(strmap_entry_t *a)
|
||||
{
|
||||
@ -650,7 +650,7 @@ digestmap_entries_eq(digestmap_entry_t *a, digestmap_entry_t *b)
|
||||
return !memcmp(a->key, b->key, DIGEST_LEN);
|
||||
}
|
||||
|
||||
/** Helper: return a hash value for a digest_map_t */
|
||||
/** Helper: return a hash value for a digest_map_t. */
|
||||
static INLINE unsigned int
|
||||
digestmap_entry_hash(digestmap_entry_t *a)
|
||||
{
|
||||
@ -1051,7 +1051,7 @@ digestmap_isempty(digestmap_t *map)
|
||||
return HT_EMPTY(&map->head);
|
||||
}
|
||||
|
||||
/** Return the number of items in <b>map</b> */
|
||||
/** Return the number of items in <b>map</b>. */
|
||||
int
|
||||
strmap_size(strmap_t *map)
|
||||
{
|
||||
|
@ -1816,7 +1816,7 @@ entry_guard_set_status(entry_guard_t *e, routerinfo_t *ri,
|
||||
return changed;
|
||||
}
|
||||
|
||||
/** Return true iff enought time has passed since we last tried connect to the
|
||||
/** Return true iff enough time has passed since we last tried connect to the
|
||||
* unreachable guard <b>e</b> that we're willing to try again. */
|
||||
static int
|
||||
entry_is_time_to_retry(entry_guard_t *e, time_t now)
|
||||
@ -1896,7 +1896,7 @@ is_an_entry_guard(char *digest)
|
||||
}
|
||||
|
||||
/** Dump a description of our list of entry guards to the log at level
|
||||
* <b>severity</b> */
|
||||
* <b>severity</b>. */
|
||||
static void
|
||||
log_entry_guards(int severity)
|
||||
{
|
||||
|
@ -2144,7 +2144,7 @@ connection_exit_connect(edge_connection_t *edge_conn)
|
||||
* bridge connection with a socketpair, create a new directory conn, and join
|
||||
* them together. Return 0 on success (or if there was an error we could send
|
||||
* back an end cell for). Return -1 if the circuit needs to be torn down.
|
||||
* Either connects exit_conn, or frees it, or marks it as appropriate.
|
||||
* Either connects exit_conn, or frees it, or marks it, as appropriate.
|
||||
*/
|
||||
static int
|
||||
connection_exit_connect_dir(edge_connection_t *exit_conn)
|
||||
@ -2187,7 +2187,6 @@ connection_exit_connect_dir(edge_connection_t *exit_conn)
|
||||
if (connection_add(TO_CONN(exit_conn))<0) {
|
||||
connection_edge_end(exit_conn, END_STREAM_REASON_RESOURCELIMIT,
|
||||
exit_conn->cpath_layer);
|
||||
/* XXXX Have I got the free/mark distinction right? -NM */
|
||||
connection_free(TO_CONN(exit_conn));
|
||||
connection_free(TO_CONN(dir_conn));
|
||||
return 0;
|
||||
|
@ -66,23 +66,23 @@ const char control_c_id[] =
|
||||
* because it use used both as a list of v0 event types, and as indices
|
||||
* into the bitfield to determine which controllers want which events.
|
||||
*/
|
||||
#define _EVENT_MIN 0x0001
|
||||
#define EVENT_CIRCUIT_STATUS 0x0001
|
||||
#define EVENT_STREAM_STATUS 0x0002
|
||||
#define EVENT_OR_CONN_STATUS 0x0003
|
||||
#define EVENT_BANDWIDTH_USED 0x0004
|
||||
#define EVENT_LOG_OBSOLETE 0x0005
|
||||
#define EVENT_NEW_DESC 0x0006
|
||||
#define EVENT_DEBUG_MSG 0x0007
|
||||
#define EVENT_INFO_MSG 0x0008
|
||||
#define EVENT_NOTICE_MSG 0x0009
|
||||
#define EVENT_WARN_MSG 0x000A
|
||||
#define EVENT_ERR_MSG 0x000B
|
||||
#define LAST_V0_EVENT 0x000B
|
||||
#define EVENT_ADDRMAP 0x000C
|
||||
#define _EVENT_MIN 0x0001
|
||||
#define EVENT_CIRCUIT_STATUS 0x0001
|
||||
#define EVENT_STREAM_STATUS 0x0002
|
||||
#define EVENT_OR_CONN_STATUS 0x0003
|
||||
#define EVENT_BANDWIDTH_USED 0x0004
|
||||
#define EVENT_LOG_OBSOLETE 0x0005
|
||||
#define EVENT_NEW_DESC 0x0006
|
||||
#define EVENT_DEBUG_MSG 0x0007
|
||||
#define EVENT_INFO_MSG 0x0008
|
||||
#define EVENT_NOTICE_MSG 0x0009
|
||||
#define EVENT_WARN_MSG 0x000A
|
||||
#define EVENT_ERR_MSG 0x000B
|
||||
#define LAST_V0_EVENT 0x000B
|
||||
#define EVENT_ADDRMAP 0x000C
|
||||
#define EVENT_AUTHDIR_NEWDESCS 0x000D
|
||||
#define EVENT_DESCCHANGED 0x000E
|
||||
#define _EVENT_MAX 0x000E
|
||||
#define EVENT_DESCCHANGED 0x000E
|
||||
#define _EVENT_MAX 0x000E
|
||||
|
||||
/** Array mapping from message type codes to human-readable message
|
||||
* type names. Used for compatibility with version 0 of the control
|
||||
|
@ -129,6 +129,8 @@ directory_get_from_dirserver(uint8_t purpose, const char *resource,
|
||||
int directconn = !purpose_is_private(purpose);
|
||||
authority_type_t type;
|
||||
|
||||
/* FFFF we could break this switch into its own function, and call
|
||||
* it elsewhere in directory.c. -RD */
|
||||
switch (purpose) {
|
||||
case DIR_PURPOSE_FETCH_NETWORKSTATUS:
|
||||
case DIR_PURPOSE_FETCH_SERVERDESC:
|
||||
@ -182,7 +184,7 @@ directory_get_from_dirserver(uint8_t purpose, const char *resource,
|
||||
if (!directconn) {
|
||||
/* Never use fascistfirewall; we're going via Tor. */
|
||||
if (purpose == DIR_PURPOSE_FETCH_RENDDESC) {
|
||||
/* only ask authdirservers, any of them will do */
|
||||
/* only ask hidserv authorities, any of them will do */
|
||||
rs = router_pick_trusteddirserver(HIDSERV_AUTHORITY, 0, 0,
|
||||
retry_if_no_servers);
|
||||
} else {
|
||||
@ -191,7 +193,7 @@ directory_get_from_dirserver(uint8_t purpose, const char *resource,
|
||||
retry_if_no_servers);
|
||||
/* If we have any hope of building an indirect conn, we know some router
|
||||
* descriptors. If (rs==NULL), we can't build circuits anyway, so
|
||||
* there's no point in falling back to the authorities in this case. */
|
||||
* there's no point in falling back to the authorities in this case. */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2535,7 +2535,7 @@ typedef struct trusted_dir_server_t {
|
||||
/** True iff this server is an authority for the newer ("v2") directory
|
||||
* protocol. */
|
||||
unsigned int is_v2_authority:1;
|
||||
/** True iff this server is an authority for hidden services */
|
||||
/** True iff this server is an authority for hidden services. */
|
||||
unsigned int is_hidserv_authority:1;
|
||||
|
||||
int n_networkstatus_failures; /**< How many times have we asked for this
|
||||
|
@ -361,10 +361,10 @@ init_keys(void)
|
||||
crypto_pk_get_digest(get_identity_key(), digest);
|
||||
if (!router_digest_is_trusted_dir(digest)) {
|
||||
add_trusted_dir_server(options->Nickname, NULL,
|
||||
(uint16_t)options->DirPort, digest,
|
||||
options->V1AuthoritativeDir, /* v1 authority */
|
||||
1, /* v2 authority */
|
||||
options->HSAuthoritativeDir /* hidserv authority */);
|
||||
(uint16_t)options->DirPort, digest,
|
||||
options->V1AuthoritativeDir, /* v1 authority */
|
||||
1, /* v2 authority */
|
||||
options->HSAuthoritativeDir /*hidserv authority*/);
|
||||
}
|
||||
return 0; /* success */
|
||||
}
|
||||
|
@ -2294,8 +2294,8 @@ router_set_networkstatus(const char *s, time_t arrived_at,
|
||||
}
|
||||
base16_encode(fp, HEX_DIGEST_LEN+1, ns->identity_digest, DIGEST_LEN);
|
||||
if (!(trusted_dir =
|
||||
router_get_trusteddirserver_by_digest(ns->identity_digest))
|
||||
|| !trusted_dir->is_v2_authority) {
|
||||
router_get_trusteddirserver_by_digest(ns->identity_digest)) ||
|
||||
!trusted_dir->is_v2_authority) {
|
||||
log_info(LD_DIR, "Network status was signed, but not by an authoritative "
|
||||
"directory we recognize.");
|
||||
if (!get_options()->DirPort) {
|
||||
|
Loading…
Reference in New Issue
Block a user