[tor-commits] [tor/master] whitespace fixes
commit 6be0e28670517048ce3ab017911cd41238543a13 Author: Nick Mathewson Date: Mon Aug 21 14:18:41 2017 -0400 whitespace fixes --- src/test/test_hs_descriptor.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/test/test_hs_descriptor.c b/src/test/test_hs_descriptor.c index b68bd108f..8f8da361d 100644 --- a/src/test/test_hs_descriptor.c +++ b/src/test/test_hs_descriptor.c @@ -19,7 +19,6 @@ #include "test_helpers.h" #include "log_test_helpers.h" - #ifdef HAVE_CFLAG_WOVERLENGTH_STRINGS DISABLE_GCC_WARNING(overlength-strings) /* We allow huge string constants in the unit tests, but not in the code @@ -569,7 +568,6 @@ test_decode_bad_signature(void *arg) /* Update approx time to dodge cert expiration */ update_approx_time(1502661599); - setup_full_capture_of_logs(LOG_WARN); ret = hs_desc_decode_plaintext(HS_DESC_BAD_SIG, &desc_plaintext); tt_int_op(ret, OP_EQ, -1); ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] whitespace fixes
commit fb97f76e71ab06abe4b4927f743f6683e7aaedab Author: Nick Mathewson Date: Mon May 8 13:57:08 2017 -0400 whitespace fixes --- src/or/channel.c| 1 - src/or/channelpadding.c | 2 +- src/or/channeltls.c | 5 +++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/or/channel.c b/src/or/channel.c index 599b00a..5b184f1 100644 --- a/src/or/channel.c +++ b/src/or/channel.c @@ -86,7 +86,6 @@ static smartlist_t *active_listeners = NULL; /* All channel_listener_t instances in LISTENING state */ static smartlist_t *finished_listeners = NULL; - /** Map from channel->global_identifier to channel. Contains the same * elements as all_channels. */ HT_HEAD(channel_gid_map, channel_s) channel_gid_map = HT_INITIALIZER(); diff --git a/src/or/channelpadding.c b/src/or/channelpadding.c index 2370827..e57408a 100644 --- a/src/or/channelpadding.c +++ b/src/or/channelpadding.c @@ -564,7 +564,7 @@ channelpadding_get_channel_idle_timeout(const channel_t *chan, unsigned int timeout; /* Non-canonical and client channels only last for 3-4.5 min when idle */ - if (!is_canonical || CHANNEL_IS_CLIENT(chan, options)) { + if (!is_canonical || CHANNEL_IS_CLIENT(chan, options)) { #define CONNTIMEOUT_CLIENTS_BASE 180 // 3 to 4.5 min timeout = CONNTIMEOUT_CLIENTS_BASE + crypto_rand_int(CONNTIMEOUT_CLIENTS_BASE/2); diff --git a/src/or/channeltls.c b/src/or/channeltls.c index 4cdd554..f44e4fc 100644 --- a/src/or/channeltls.c +++ b/src/or/channeltls.c @@ -1806,12 +1806,13 @@ channel_tls_process_netinfo_cell(cell_t *cell, channel_tls_t *chan) if (me && !TLS_CHAN_TO_BASE(chan)->is_canonical_to_peer && channel_is_canonical(TLS_CHAN_TO_BASE(chan))) { +const char *descr = + TLS_CHAN_TO_BASE(chan)->get_remote_descr(TLS_CHAN_TO_BASE(chan), 0); log_info(LD_OR, "We made a connection to a relay at %s (fp=%s) but we think " "they will not consider this connection canonical. They " "think we are at %s, but we think its %s.", - safe_str(TLS_CHAN_TO_BASE(chan)->get_remote_descr(TLS_CHAN_TO_BASE(chan), - 0)), + safe_str(descr), safe_str(hex_str(chan->conn->identity_digest, DIGEST_LEN)), safe_str(tor_addr_is_null(&my_apparent_addr) ? "" : fmt_and_decorate_addr(&my_apparent_addr)), ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] Whitespace fixes.
commit 7a37cbbea33896da54ea4785d8b08c3e5752dcd2 Author: Nick Mathewson Date: Tue Apr 25 10:54:34 2017 -0400 Whitespace fixes. --- src/common/compat_threads.c | 1 + src/common/compress.c | 1 + src/common/compress_lzma.c | 1 + src/common/compress_zlib.c | 1 + src/common/compress_zstd.c | 1 + 5 files changed, 5 insertions(+) diff --git a/src/common/compat_threads.c b/src/common/compat_threads.c index 8d026dd..d3f64f2 100644 --- a/src/common/compat_threads.c +++ b/src/common/compat_threads.c @@ -397,3 +397,4 @@ atomic_counter_get(atomic_counter_t *counter) tor_mutex_release(&counter->mutex); return val; } + diff --git a/src/common/compress.c b/src/common/compress.c index fd2cb06..5a3359a 100644 --- a/src/common/compress.c +++ b/src/common/compress.c @@ -495,3 +495,4 @@ tor_compress_init(void) tor_lzma_init(); tor_zstd_init(); } + diff --git a/src/common/compress_lzma.c b/src/common/compress_lzma.c index 906a406..953971b 100644 --- a/src/common/compress_lzma.c +++ b/src/common/compress_lzma.c @@ -321,3 +321,4 @@ tor_lzma_init(void) { atomic_counter_init(&total_lzma_allocation); } + diff --git a/src/common/compress_zlib.c b/src/common/compress_zlib.c index 3fc574c..284542e 100644 --- a/src/common/compress_zlib.c +++ b/src/common/compress_zlib.c @@ -301,3 +301,4 @@ tor_zlib_init(void) { atomic_counter_init(&total_zlib_allocation); } + diff --git a/src/common/compress_zstd.c b/src/common/compress_zstd.c index 8b8aea1..deaefc1 100644 --- a/src/common/compress_zstd.c +++ b/src/common/compress_zstd.c @@ -332,3 +332,4 @@ tor_zstd_init(void) { atomic_counter_init(&total_zstd_allocation); } + ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] whitespace fixes
commit 85a17ee2e784eeb6db32c178cbc2e2620ef3b765 Author: Nick Mathewson Date: Wed Jan 18 17:14:42 2017 -0500 whitespace fixes --- src/or/hs_intropoint.c| 1 + src/test/test_hs_intropoint.c | 15 ++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/or/hs_intropoint.c b/src/or/hs_intropoint.c index 04f8c62..db4ba79 100644 --- a/src/or/hs_intropoint.c +++ b/src/or/hs_intropoint.c @@ -592,3 +592,4 @@ hs_intro_received_introduce1(or_circuit_t *circ, const uint8_t *request, circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_TORPROTOCOL); return -1; } + diff --git a/src/test/test_hs_intropoint.c b/src/test/test_hs_intropoint.c index e126cbc..1d620e1 100644 --- a/src/test/test_hs_intropoint.c +++ b/src/test/test_hs_intropoint.c @@ -44,7 +44,8 @@ mock_send_intro_established_cell(or_circuit_t *circ) static int mock_relay_send_command_from_edge(streamid_t stream_id, circuit_t *circ, uint8_t relay_command, const char *payload, - size_t payload_len, crypt_path_t *cpath_layer, + size_t payload_len, + crypt_path_t *cpath_layer, const char *filename, int lineno) { (void) stream_id; @@ -763,12 +764,14 @@ test_received_introduce1_handling(void *arg) size_t request_len = hs_cell_introduce1_encoded_len(cell); tt_size_op(request_len, OP_GT, 0); request = tor_malloc_zero(request_len); -ssize_t encoded_len = hs_cell_introduce1_encode(request, request_len, cell); +ssize_t encoded_len = + hs_cell_introduce1_encode(request, request_len, cell); tt_size_op(encoded_len, OP_GT, 0); circ = helper_create_intro_circuit(); or_circuit_t *service_circ = helper_create_intro_circuit(); -circuit_change_purpose(TO_CIRCUIT(service_circ), CIRCUIT_PURPOSE_INTRO_POINT); +circuit_change_purpose(TO_CIRCUIT(service_circ), + CIRCUIT_PURPOSE_INTRO_POINT); /* Register the circuit in the map for the auth key of the cell. */ ed25519_public_key_t auth_key; const uint8_t *cell_auth_key = @@ -792,12 +795,14 @@ test_received_introduce1_handling(void *arg) size_t request_len = hs_cell_introduce1_encoded_len(cell) + 256; tt_size_op(request_len, OP_GT, 0); request = tor_malloc_zero(request_len + 256); -ssize_t encoded_len = hs_cell_introduce1_encode(request, request_len, cell); +ssize_t encoded_len = + hs_cell_introduce1_encode(request, request_len, cell); tt_size_op(encoded_len, OP_GT, 0); circ = helper_create_intro_circuit(); or_circuit_t *service_circ = helper_create_intro_circuit(); -circuit_change_purpose(TO_CIRCUIT(service_circ), CIRCUIT_PURPOSE_INTRO_POINT); +circuit_change_purpose(TO_CIRCUIT(service_circ), + CIRCUIT_PURPOSE_INTRO_POINT); /* Register the circuit in the map for the auth key of the cell. */ uint8_t token[REND_TOKEN_LEN]; memcpy(token, legacy_key_id, sizeof(token)); ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] Whitespace fixes from previous mechanical search-and-replaces
commit 043e9b01516c7cdcff939f2724b75155458da1b1 Author: Nick Mathewson Date: Mon Nov 14 13:01:19 2016 -0500 Whitespace fixes from previous mechanical search-and-replaces --- src/or/circpathbias.c | 2 +- src/or/entrynodes.c | 9 ++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/or/circpathbias.c b/src/or/circpathbias.c index 3df68b8..be11465 100644 --- a/src/or/circpathbias.c +++ b/src/or/circpathbias.c @@ -1355,7 +1355,7 @@ pathbias_measure_close_rate(entry_guard_t *guard) { const or_options_t *options = get_options(); guard_pathbias_t *pb = entry_guard_get_pathbias_state(guard); - + if (pb->circ_attempts > pathbias_get_min_circs(options)) { /* Note: We rely on the < comparison here to allow us to set a 0 * rate and disable the feature entirely. If refactoring, don't diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c index 90918fa..7890f83 100644 --- a/src/or/entrynodes.c +++ b/src/or/entrynodes.c @@ -1583,7 +1583,8 @@ entry_guards_parse_state_for_guard_selection( node->pb.path_bias_disabled = 1; log_info(LD_GENERAL, "Path use bias is too high (%f/%f); disabling node %s", - node->pb.circ_successes, node->pb.circ_attempts, node->nickname); + node->pb.circ_successes, node->pb.circ_attempts, + node->nickname); } } else if (!strcasecmp(line->key, "EntryGuardPathBias")) { const or_options_t *options = get_options(); @@ -1642,7 +1643,8 @@ entry_guards_parse_state_for_guard_selection( node->pb.unusable_circuits = unusable; log_info(LD_GENERAL, "Read %f/%f path bias for node %s", - node->pb.circ_successes, node->pb.circ_attempts, node->nickname); + node->pb.circ_successes, node->pb.circ_attempts, + node->nickname); /* Note: We rely on the < comparison here to allow us to set a 0 * rate and disable the feature entirely. If refactoring, don't * change to <= */ @@ -1652,7 +1654,8 @@ entry_guards_parse_state_for_guard_selection( node->pb.path_bias_disabled = 1; log_info(LD_GENERAL, "Path bias is too high (%f/%f); disabling node %s", - node->pb.circ_successes, node->pb.circ_attempts, node->nickname); + node->pb.circ_successes, node->pb.circ_attempts, + node->nickname); } } else { ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] whitespace fixes
commit 81360c4a5fde6d66a81c506af657df77d2e63cff Author: Nick Mathewson Date: Wed Dec 14 15:41:08 2016 -0500 whitespace fixes --- src/or/hs_circuitmap.h | 1 + src/or/hs_common.h | 1 + src/or/hs_intropoint.c | 2 +- src/or/hs_intropoint.h | 6 -- src/or/hs_service.c| 4 +++- src/or/hs_service.h| 1 + src/or/rendservice.c | 1 + src/test/test_hs_service.c | 1 - 8 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/or/hs_circuitmap.h b/src/or/hs_circuitmap.h index a2be97c..79767dd 100644 --- a/src/or/hs_circuitmap.h +++ b/src/or/hs_circuitmap.h @@ -67,3 +67,4 @@ hs_circuitmap_ht *get_hs_circuitmap(void); #endif /* TOR_UNIT_TESTS */ #endif /* TOR_HS_CIRCUITMAP_H */ + diff --git a/src/or/hs_common.h b/src/or/hs_common.h index 55710b7..8158d27 100644 --- a/src/or/hs_common.h +++ b/src/or/hs_common.h @@ -42,3 +42,4 @@ const uint8_t *rend_data_get_pk_digest(const rend_data_t *rend_data, int hs_v3_protocol_is_enabled(void); #endif /* TOR_HS_COMMON_H */ + diff --git a/src/or/hs_intropoint.c b/src/or/hs_intropoint.c index 67355bc..bfc7ec3 100644 --- a/src/or/hs_intropoint.c +++ b/src/or/hs_intropoint.c @@ -232,7 +232,6 @@ handle_establish_intro(or_circuit_t *circ, const uint8_t *request, return retval; } - /* Return True if circuit is suitable for becoming an intro circuit. */ int hs_intro_circuit_is_suitable(const or_circuit_t *circ) @@ -286,3 +285,4 @@ hs_intro_received_establish_intro(or_circuit_t *circ, const uint8_t *request, circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_TORPROTOCOL); return -1; } + diff --git a/src/or/hs_intropoint.h b/src/or/hs_intropoint.h index b7846a4..46d8d6f 100644 --- a/src/or/hs_intropoint.h +++ b/src/or/hs_intropoint.h @@ -16,8 +16,9 @@ enum hs_intro_auth_key_type { HS_INTRO_AUTH_KEY_TYPE_ED25519 = 0x02, }; -int hs_intro_received_establish_intro(or_circuit_t *circ, const uint8_t *request, -size_t request_len); +int hs_intro_received_establish_intro(or_circuit_t *circ, + const uint8_t *request, + size_t request_len); MOCK_DECL(int, hs_intro_send_intro_established_cell,(or_circuit_t *circ)); @@ -38,3 +39,4 @@ get_auth_key_from_establish_intro_cell(ed25519_public_key_t *auth_key_out, #endif /* HS_INTROPOINT_PRIVATE */ #endif /* TOR_HS_INTRO_H */ + diff --git a/src/or/hs_service.c b/src/or/hs_service.c index 6f0836c..3b5a3e7 100644 --- a/src/or/hs_service.c +++ b/src/or/hs_service.c @@ -126,7 +126,8 @@ generate_establish_intro_cell(const uint8_t *circuit_key_material, crypto_mac_sha3_256(mac, sizeof(mac), circuit_key_material, circuit_key_material_len, cell_bytes_tmp, -encoded_len - (ED25519_SIG_LEN + 2 + TRUNNEL_SHA3_256_LEN)); +encoded_len - + (ED25519_SIG_LEN + 2 + TRUNNEL_SHA3_256_LEN)); /* Write the MAC to the cell */ uint8_t *handshake_ptr = hs_cell_establish_intro_getarray_handshake_mac(cell); @@ -173,3 +174,4 @@ generate_establish_intro_cell(const uint8_t *circuit_key_material, } #endif /* TOR_UNIT_TESTS */ + diff --git a/src/or/hs_service.h b/src/or/hs_service.h index a54a960..994521f 100644 --- a/src/or/hs_service.h +++ b/src/or/hs_service.h @@ -29,3 +29,4 @@ get_establish_intro_payload(uint8_t *buf, size_t buf_len, #endif /* HS_SERVICE_PRIVATE */ #endif /* TOR_HS_SERVICE_H */ + diff --git a/src/or/rendservice.c b/src/or/rendservice.c index 9a39090..00ede48 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -4484,3 +4484,4 @@ rend_service_non_anonymous_mode_enabled(const or_options_t *options) tor_assert(rend_service_non_anonymous_mode_consistent(options)); return options->HiddenServiceNonAnonymousMode ? 1 : 0; } + diff --git a/src/test/test_hs_service.c b/src/test/test_hs_service.c index 195e506..8890c11 100644 --- a/src/test/test_hs_service.c +++ b/src/test/test_hs_service.c @@ -106,7 +106,6 @@ struct testcase_t hs_service_tests[] = { { "gen_establish_intro_cell_bad", test_gen_establish_intro_cell_bad, TT_FORK, NULL, NULL }, - END_OF_TESTCASES }; ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] whitespace fixes
commit 32854aef28f5ff94fc60647c9881576141574aba Author: Nick Mathewson Date: Thu Nov 3 08:55:54 2016 -0400 whitespace fixes --- src/or/channeltls.c| 10 +- src/or/circuitbuild.c | 1 - src/or/connection_or.c | 4 ++-- src/or/or.h| 4 src/or/routerkeys.c| 3 ++- src/or/torcert.c | 3 +-- src/test/test_link_handshake.c | 5 ++--- src/test/test_routerkeys.c | 1 - src/test/testing_rsakeys.c | 1 + 9 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/or/channeltls.c b/src/or/channeltls.c index 1af75e6..5117672 100644 --- a/src/or/channeltls.c +++ b/src/or/channeltls.c @@ -1889,7 +1889,8 @@ channel_tls_process_certs_cell(var_cell_t *cell, channel_tls_t *chan) tor_cert_t *ed_cert = tor_cert_parse(cert_body, cert_len); if (!ed_cert) { log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, - "Received undecodable Ed certificate in CERTS cell from %s:%d", + "Received undecodable Ed certificate " + "in CERTS cell from %s:%d", safe_str(chan->conn->base_.address), chan->conn->base_.port); } else { @@ -2310,10 +2311,9 @@ channel_tls_process_authenticate_cell(var_cell_t *cell, channel_tls_t *chan) chan->conn->handshake_state->authenticated_rsa = 1; chan->conn->handshake_state->digest_received_data = 0; { -crypto_pk_t *identity_rcvd = - tor_tls_cert_get_key(chan->conn->handshake_state->certs->id_cert); -const common_digests_t *id_digests = - tor_x509_cert_get_id_digests(chan->conn->handshake_state->certs->id_cert); +tor_x509_cert_t *id_cert = chan->conn->handshake_state->certs->id_cert; +crypto_pk_t *identity_rcvd = tor_tls_cert_get_key(id_cert); +const common_digests_t *id_digests = tor_x509_cert_get_id_digests(id_cert); const ed25519_public_key_t *ed_identity_received = NULL; if (! sig_is_rsa) { diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index b2fbd27..0881f23 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -84,7 +84,6 @@ channel_connect_for_circuit(const tor_addr_t *addr, uint16_t port, { channel_t *chan; - chan = channel_connect(addr, port, id_digest, NULL // Ed25519 id. ); diff --git a/src/or/connection_or.c b/src/or/connection_or.c index c6d5bb5..eb67f06 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -2544,8 +2544,8 @@ connection_or_compute_authenticate_cell_body(or_connection_t *conn, ssize_t len2 = auth1_parse(&tmp, out, len, ctx); if (!tmp) { /* LCOV_EXCL_START */ - log_warn(LD_BUG, "Unable to parse signed part of AUTH1 data that we just " - "encoded"); + log_warn(LD_BUG, "Unable to parse signed part of AUTH1 data that " + "we just encoded"); goto err; /* LCOV_EXCL_STOP */ } diff --git a/src/or/or.h b/src/or/or.h index 1fc4b16..d305eac 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -1373,10 +1373,6 @@ typedef struct listener_connection_t { * authchallenge_type_is_better(). */ - - - - /** The length of the part of the AUTHENTICATE cell body that the client and * server can generate independently (when using RSA_SHA256_TLSSECRET). It * contains everything except the client's timestamp, the client's randomly diff --git a/src/or/routerkeys.c b/src/or/routerkeys.c index b6f20e6..8d9a132 100644 --- a/src/or/routerkeys.c +++ b/src/or/routerkeys.c @@ -1029,7 +1029,8 @@ should_make_new_ed_keys(const or_options_t *options, const time_t now) #undef EXPIRES_SOON #ifdef TOR_UNIT_TESTS -/* Helper for unit tests: populate the ed25519 keys without saving or loading */ +/* Helper for unit tests: populate the ed25519 keys without saving or + * loading */ void init_mock_ed_keys(const crypto_pk_t *rsa_identity_key) { diff --git a/src/or/torcert.c b/src/or/torcert.c index 4259363..852def9 100644 --- a/src/or/torcert.c +++ b/src/or/torcert.c @@ -603,7 +603,6 @@ or_handshake_certs_ed25519_ok(int severity, return 1; } - /** * Check the Ed certificates and/or the RSA certificates, as appropriate. If * we obtained an Ed25519 identity, set *ed_id_out. If we obtained an RSA @@ -646,5 +645,5 @@ or_handshake_certs_check_both(int severity, *rsa_id_out = tor_x509_cert_get_id_digests(certs->id_cert); } } - } + diff --git a/src/test/test_link_handshake.c b/src/test/test_link_handshake.c index bf5ff67..5273f33 100644 --- a/src/test/test_link_handshake.c +++ b/src/test/test_link_handshake.c @@ -872,7 +872,6 @@ CERTS_FAIL(server_wrong_labels_1, REENCODE(); }) - static void test_link_handshake_send_authchallenge(void *arg) { @@ -1087,7 +1086,6 @@ AUTHCHALLENGE_FAIL(nonzero_circid, require_failure_message = "It had a nonzero circuit ID"; d->cell->circ_id = 1
[tor-commits] [tor/master] Whitespace fixes
commit 04b8af9dc0389e8a3d1779e883b999240dec3a2b Author: Nick Mathewson Date: Wed Oct 26 08:39:04 2016 -0400 Whitespace fixes --- src/or/scheduler.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/or/scheduler.c b/src/or/scheduler.c index ae2e950..033e6d1 100644 --- a/src/or/scheduler.c +++ b/src/or/scheduler.c @@ -35,8 +35,8 @@ static uint32_t sched_max_flush_cells = 16; * This module implements a scheduler algorithm, to decide * which channels should send/receive when. * - * The earliest versions of Tor approximated a kind of round-robin system among - * active connections, but only approximated it. + * The earliest versions of Tor approximated a kind of round-robin system + * among active connections, but only approximated it. * * Now, write scheduling works by keeping track of which channels can * accept cells, and have cells to write. From the scheduler's perspective, @@ -44,9 +44,9 @@ static uint32_t sched_max_flush_cells = 16; * * * - * Not open for writes, no cells to send . - * Not much to do here, and the channel will have scheduler_state == - * SCHED_CHAN_IDLE + * Not open for writes, no cells to send. + * Not much to do here, and the channel will have scheduler_state + * == SCHED_CHAN_IDLE * Transitions from: * * Open for writes/has cells by simultaneously draining all circuit @@ -63,9 +63,9 @@ static uint32_t sched_max_flush_cells = 16; * * Open for writes, no cells to send * - * Not much here either; this will be the state an idle but open channel - * can be expected to settle in. It will have scheduler_state == - * SCHED_CHAN_WAITING_FOR_CELLS + * Not much here either; this will be the state an idle but open + * channel can be expected to settle in. It will have scheduler_state + * == SCHED_CHAN_WAITING_FOR_CELLS * Transitions from: * * Not open for writes/no cells by flushing some of the output ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] whitespace fixes
commit bc9a0f82b3436dad2aa09c1b68c0c230751d48dd Author: Nick Mathewson Date: Tue Jun 28 11:14:42 2016 -0400 whitespace fixes --- src/or/connection_or.c | 2 +- src/or/routerlist.c| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/or/connection_or.c b/src/or/connection_or.c index 5c4461f..9730e1a 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -1750,7 +1750,7 @@ connection_or_client_learned_peer_id(or_connection_t *conn, const int is_fallback_fingerprint = router_digest_is_fallback_dir( conn->identity_digest); const int is_authority_fingerprint = router_digest_is_trusted_dir( - conn->identity_digest); + conn->identity_digest); int severity; const char *extra_log = ""; diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 432c64d..49d7680 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -1408,7 +1408,7 @@ router_get_fallback_dirserver_by_digest(const char *digest) * or 0 if no such fallback is in the list of fallback_dir_servers. * (fallback_dir_servers is affected by the FallbackDir and * UseDefaultFallbackDirs torrc options.) - * The list of fallback directories includes the list of authorities. + * The list of fallback directories includes the list of authorities. */ int router_digest_is_fallback_dir(const char *digest) ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] whitespace fixes
commit 2729f166cb715f0f4aff8779f0fadebafc56a70c Author: Nick Mathewson Date: Tue May 17 20:08:03 2016 -0400 whitespace fixes --- src/or/dirserv.c | 5 +++-- src/or/router.c | 15 --- src/or/routerlist.c | 3 ++- src/or/routerparse.c | 7 --- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/or/dirserv.c b/src/or/dirserv.c index c97e3bc..dafaed8 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -261,7 +261,7 @@ dirserv_router_get_status(const routerinfo_t *router, const char **msg, /* This has an ed25519 identity key. */ if (KEYPIN_MISMATCH == keypin_check((const uint8_t*)router->cache_info.identity_digest, - router->cache_info.signing_key_cert->signing_key.pubkey)) { + router->cache_info.signing_key_cert->signing_key.pubkey)) { log_fn(severity, LD_DIR, "Descriptor from router %s has an Ed25519 key, " "but the keys don't match what they were before.", @@ -2898,7 +2898,8 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key, listbadexits); if (ri->cache_info.signing_key_cert) { -memcpy(vrs->ed25519_id, ri->cache_info.signing_key_cert->signing_key.pubkey, +memcpy(vrs->ed25519_id, + ri->cache_info.signing_key_cert->signing_key.pubkey, ED25519_PUBKEY_LEN); } diff --git a/src/or/router.c b/src/or/router.c index 772a855..aa4acf6 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -2036,7 +2036,8 @@ router_build_fresh_descriptor(routerinfo_t **r, extrainfo_t **e) routerinfo_free(ri); return -1; } - ri->cache_info.signing_key_cert = tor_cert_dup(get_master_signing_key_cert()); + ri->cache_info.signing_key_cert = +tor_cert_dup(get_master_signing_key_cert()); get_platform_str(platform, sizeof(platform)); ri->platform = tor_strdup(platform); @@ -2560,9 +2561,9 @@ router_dump_router_to_string(routerinfo_t *router, char ed_cert_base64[256]; char ed_fp_base64[ED25519_BASE64_LEN+1]; if (base64_encode(ed_cert_base64, sizeof(ed_cert_base64), - (const char*)router->cache_info.signing_key_cert->encoded, - router->cache_info.signing_key_cert->encoded_len, - BASE64_ENCODE_MULTILINE) < 0) { +(const char*)router->cache_info.signing_key_cert->encoded, +router->cache_info.signing_key_cert->encoded_len, +BASE64_ENCODE_MULTILINE) < 0) { log_err(LD_BUG,"Couldn't base64-encode signing key certificate!"); goto err; } @@ -2600,9 +2601,9 @@ router_dump_router_to_string(routerinfo_t *router, int tap_cc_len = 0; uint8_t *tap_cc = make_tap_onion_key_crosscert(tap_key, - &router->cache_info.signing_key_cert->signing_key, - router->identity_pkey, - &tap_cc_len); +&router->cache_info.signing_key_cert->signing_key, +router->identity_pkey, +&tap_cc_len); if (!tap_cc) { log_warn(LD_BUG,"make_tap_onion_key_crosscert failed!"); goto err; diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 2634e0d..f9247cb 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -5215,7 +5215,8 @@ routerinfo_incompatible_with_extrainfo(const crypto_pk_t *identity_pkey, goto err; /* different servers */ } - if (! tor_cert_opt_eq(sd->signing_key_cert,ei->cache_info.signing_key_cert)) { + if (! tor_cert_opt_eq(sd->signing_key_cert, +ei->cache_info.signing_key_cert)) { if (msg) *msg = "Extrainfo signing key cert didn't match routerinfo"; goto err; /* different servers */ } diff --git a/src/or/routerparse.c b/src/or/routerparse.c index a7c29aa..91025c1 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -1405,7 +1405,8 @@ router_parse_entry_from_string(const char *s, const char *end, log_warn(LD_DIR, "Couldn't parse ed25519 cert"); goto err; } - router->cache_info.signing_key_cert = cert; /* makes sure it gets freed.*/ + /* makes sure it gets freed. */ + router->cache_info.signing_key_cert = cert; if (cert->cert_type != CERT_TYPE_ID_SIGNING || ! cert->signing_key_included) { @@ -1600,8 +1601,8 @@ router_parse_entry_from_string(const char *s, const char *end, } if (tok->n_args >= 2) { - if (digest256_from_base64(router->cache_info.extra_info_digest256, tok->args[1]) - < 0) { + if (digest256_from_base64(router->cache_info.extra_info_digest256, +tok->args[1]) < 0) { log_warn(LD_DIR, "Invalid extra info digest256 %s", escaped(tok->args[1])); } _
[tor-commits] [tor/master] Whitespace fixes
commit c0568a89d93e05d98f4ef57d0b7bb659a357dbef Author: Nick Mathewson Date: Sat Mar 26 09:54:31 2016 -0400 Whitespace fixes --- src/common/sandbox.c | 1 - src/or/dircollate.c | 3 ++- src/or/entrynodes.c | 6 -- src/test/test_util.c | 1 - 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/common/sandbox.c b/src/common/sandbox.c index 7365d7a..96429ce 100644 --- a/src/common/sandbox.c +++ b/src/common/sandbox.c @@ -1891,7 +1891,6 @@ sandbox_cfg_allow_chown_filename(sandbox_cfg_t **cfg, char *file) return 0; } - int sandbox_cfg_allow_chmod_filename(sandbox_cfg_t **cfg, char *file) { diff --git a/src/or/dircollate.c b/src/or/dircollate.c index ed52f0a..3f9d78f 100644 --- a/src/or/dircollate.c +++ b/src/or/dircollate.c @@ -34,7 +34,8 @@ ddmap_entry_free(ddmap_entry_t *e) tor_free(e); } -/** Return a new empty ddmap_entry, with n_votes elements in vrs_list. */ +/** Return a new empty ddmap_entry, with n_votes elements in + * vrs_list. */ static ddmap_entry_t * ddmap_entry_new(int n_votes) { diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c index 8dbfeae..310a948 100644 --- a/src/or/entrynodes.c +++ b/src/or/entrynodes.c @@ -1822,7 +1822,8 @@ get_configured_bridge_by_addr_port_digest(const tor_addr_t *addr, * bridge with no known digest whose address matches addr:port, * return 1. Else return 0. If digest is NULL, check for * address/port matches only. */ -int addr_is_a_configured_bridge(const tor_addr_t *addr, +int +addr_is_a_configured_bridge(const tor_addr_t *addr, uint16_t port, const char *digest) { @@ -1834,7 +1835,8 @@ int addr_is_a_configured_bridge(const tor_addr_t *addr, * ei->identity_digest, or a bridge with no known digest whose address * matches ei->addr:ei->port, return 1. Else return 0. * If ei->onion_key is NULL, check for address/port matches only. */ -int extend_info_is_a_configured_bridge(const extend_info_t *ei) +int +extend_info_is_a_configured_bridge(const extend_info_t *ei) { const char *digest = ei->onion_key ? ei->identity_digest : NULL; return addr_is_a_configured_bridge(&ei->addr, ei->port, digest); diff --git a/src/test/test_util.c b/src/test/test_util.c index 11eb18d..8e5c9bf 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -821,7 +821,6 @@ test_util_parse_http_time(void *arg) T("2038-02-17 06:13:20"); #endif - tt_int_op(-1,OP_EQ, parse_http_time("2004-08-zz 99-99x99 GMT", &a_time)); tt_int_op(-1,OP_EQ, parse_http_time("2011-03-32 00:00:00 GMT", &a_time)); tt_int_op(-1,OP_EQ, parse_http_time("2011-03-30 24:00:00 GMT", &a_time)); ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] Whitespace fixes
commit a8d69895897056fcc313914e9d611d3c9008e17c Author: Nick Mathewson Date: Wed Feb 10 15:35:46 2016 -0500 Whitespace fixes --- src/common/crypto.h | 4 ++-- src/common/tortls.h | 6 -- src/or/channeltls.c | 3 ++- src/or/dirserv.h | 6 +++--- src/or/routerparse.c | 3 ++- src/or/routerparse.h | 3 ++- src/test/test_dir.c | 6 -- 7 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/common/crypto.h b/src/common/crypto.h index f1e4981..9535c4e 100644 --- a/src/common/crypto.h +++ b/src/common/crypto.h @@ -102,7 +102,6 @@ typedef enum { #define N_DIGEST_ALGORITHMS (DIGEST_SHA3_512+1) #define N_COMMON_DIGEST_ALGORITHMS (DIGEST_SHA256+1) - /** A set of all the digests we commonly compute, taken on a single * string. Any digests that are shorter than 512 bits are right-padded * with 0 bits. @@ -193,7 +192,8 @@ int crypto_pk_private_hybrid_decrypt(crypto_pk_t *env, char *to, int crypto_pk_asn1_encode(crypto_pk_t *pk, char *dest, size_t dest_len); crypto_pk_t *crypto_pk_asn1_decode(const char *str, size_t len); int crypto_pk_get_digest(const crypto_pk_t *pk, char *digest_out); -int crypto_pk_get_common_digests(crypto_pk_t *pk, common_digests_t *digests_out); +int crypto_pk_get_common_digests(crypto_pk_t *pk, + common_digests_t *digests_out); int crypto_pk_get_fingerprint(crypto_pk_t *pk, char *fp_out,int add_space); int crypto_pk_get_hashed_fingerprint(crypto_pk_t *pk, char *fp_out); diff --git a/src/common/tortls.h b/src/common/tortls.h index 97ca8fd..d235ca5 100644 --- a/src/common/tortls.h +++ b/src/common/tortls.h @@ -237,8 +237,10 @@ tor_x509_cert_t *tor_x509_cert_decode(const uint8_t *certificate, size_t certificate_len); void tor_x509_cert_get_der(const tor_x509_cert_t *cert, const uint8_t **encoded_out, size_t *size_out); -const common_digests_t *tor_x509_cert_get_id_digests(const tor_x509_cert_t *cert); -const common_digests_t *tor_x509_cert_get_cert_digests(const tor_x509_cert_t *cert); +const common_digests_t *tor_x509_cert_get_id_digests( + const tor_x509_cert_t *cert); +const common_digests_t *tor_x509_cert_get_cert_digests( + const tor_x509_cert_t *cert); int tor_tls_get_my_certs(int server, const tor_x509_cert_t **link_cert_out, const tor_x509_cert_t **id_cert_out); diff --git a/src/or/channeltls.c b/src/or/channeltls.c index a4c5708..016ef75 100644 --- a/src/or/channeltls.c +++ b/src/or/channeltls.c @@ -1819,7 +1819,8 @@ channel_tls_process_certs_cell(var_cell_t *cell, channel_tls_t *chan) chan->conn->handshake_state->authenticated = 1; { - const common_digests_t *id_digests = tor_x509_cert_get_id_digests(id_cert); + const common_digests_t *id_digests = +tor_x509_cert_get_id_digests(id_cert); crypto_pk_t *identity_rcvd; if (!id_digests) ERR("Couldn't compute digests for key in ID cert"); diff --git a/src/or/dirserv.h b/src/or/dirserv.h index 25a2a91..df23450 100644 --- a/src/or/dirserv.h +++ b/src/or/dirserv.h @@ -63,9 +63,9 @@ int directory_too_idle_to_fetch_descriptors(const or_options_t *options, cached_dir_t *dirserv_get_consensus(const char *flavor_name); void dirserv_set_cached_consensus_networkstatus(const char *consensus, -const char *flavor_name, -const common_digests_t *digests, -time_t published); + const char *flavor_name, + const common_digests_t *digests, + time_t published); void dirserv_clear_old_networkstatuses(time_t cutoff); int dirserv_get_routerdesc_fingerprints(smartlist_t *fps_out, const char *key, const char **msg, diff --git a/src/or/routerparse.c b/src/or/routerparse.c index 7323f80..2173213 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -3445,7 +3445,8 @@ networkstatus_parse_vote_from_string(const char *s, const char **eos_out, /** Return the common_digests_t that holds the digests of the * flavor_name-flavored networkstatus according to the detached - * signatures document sigs, allocating a new common_digests_t as neeeded. */ + * signatures document sigs, allocating a new common_digests_t as + * neeeded. */ static common_digests_t * detached_get_digests(ns_detached_signatures_t *sigs, const char *flavor_name) { diff --git a/src/or/routerparse.h b/src/or/routerparse.h index 4745740..723d5d8 100644 --- a/src/or/routerparse.h +++ b/src/or/routerparse.h @@ -14,7 +14,8 @@ int router_get_router_hash(const char *s, size_t s_len, char *digest); int router_get_dir_hash(const char *s, char *digest); -int router_get_networkstatus_v3_
[tor-commits] [tor/master] Whitespace fixes.
commit bb8ec2e1c61e7083cda37845ad40bc0997a16901 Author: rl1987 Date: Mon Oct 12 21:13:01 2015 +0300 Whitespace fixes. --- src/test/test_dns.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/test_dns.c b/src/test/test_dns.c index 510fec1..f316de2 100644 --- a/src/test/test_dns.c +++ b/src/test/test_dns.c @@ -342,7 +342,7 @@ create_valid_exitconn(void) /* * Given that exitconn->base_.address is IP address string, we - * want dns_resolve_impl() to parse it and store in + * want dns_resolve_impl() to parse it and store in * exitconn->base_.addr. We expect dns_resolve_impl to return 1. * Lastly, we want it to set the TTL value to default one for DNS queries. */ @@ -361,7 +361,7 @@ NS(test_main)(void *arg) edge_connection_t *exitconn = create_valid_exitconn(); - TO_CONN(exitconn)->address = tor_strdup("8.8.8.8"); + TO_CONN(exitconn)->address = tor_strdup("8.8.8.8"); retval = dns_resolve_impl(exitconn, 1, on_circ, NULL, &made_pending, NULL); @@ -371,7 +371,7 @@ NS(test_main)(void *arg) tt_int_op(retval,==,1); tt_assert(tor_addr_eq(resolved_addr, (const tor_addr_t *)&addr_to_compare)); tt_int_op(exitconn->address_ttl,==,DEFAULT_DNS_TTL); - + done: tor_free(on_circ); tor_free(TO_CONN(exitconn)->address); @@ -401,7 +401,7 @@ NS(test_main)(void *arg) edge_connection_t *exitconn = create_valid_exitconn(); or_circuit_t *on_circ = tor_malloc_zero(sizeof(or_circuit_t)); - TO_CONN(exitconn)->address = tor_strdup("torproject.org"); + TO_CONN(exitconn)->address = tor_strdup("torproject.org"); NS_MOCK(router_my_exit_policy_is_reject_star); ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] whitespace fixes
commit e8814816c752846d72cf9a55c6f785f3c483e3e2 Author: Nick Mathewson Date: Thu Apr 30 13:38:39 2015 -0400 whitespace fixes --- src/or/control.c|8 +++- src/or/rendclient.c |6 +++--- src/or/rendcommon.c |7 --- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/or/control.c b/src/or/control.c index 4578f2d..950e989 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -3414,13 +3414,13 @@ handle_control_hsfetch(control_connection_t *conn, uint32_t len, * always send a fetch command. */ rend_client_fetch_v2_desc(rend_query, hsdirs); -done: + done: SMARTLIST_FOREACH(args, char *, cp, tor_free(cp)); smartlist_free(args); /* Contains data pointer that we don't own thus no cleanup. */ smartlist_free(hsdirs); rend_data_free(rend_query); -exit: + exit: return 0; } @@ -5753,7 +5753,6 @@ node_describe_longname_by_id,(const char *id_digest)) return longname; } - /** Return either the onion address if the given pointer is a non empty * string else the unknown string. */ static const char * @@ -5773,11 +5772,10 @@ rend_hsaddress_str_or_unknown(const char *onion_address) /* All checks are good so return the given onion address. */ str_ret = onion_address; -end: + end: return str_ret; } - /** send HS_DESC requested event. * * rend_query is used to fetch requested onion address and auth type. diff --git a/src/or/rendclient.c b/src/or/rendclient.c index 834759c..d0c4b87 100644 --- a/src/or/rendclient.c +++ b/src/or/rendclient.c @@ -780,7 +780,7 @@ fetch_v2_desc_by_descid(const char *desc_id, const rend_data_t *rend_query, /* Everything went well. */ ret = 0; -end: + end: return ret; } @@ -847,7 +847,7 @@ fetch_v2_desc_by_addr(rend_data_t *query, smartlist_t *hsdirs) "we already tried them all unsuccessfully."); ret = 0; -end: + end: memwipe(descriptor_id, 0, sizeof(descriptor_id)); return ret; } @@ -877,7 +877,7 @@ rend_client_fetch_v2_desc(rend_data_t *query, smartlist_t *hsdirs) goto error; } -error: + error: return ret; } diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c index 5fe00da..9384220 100644 --- a/src/or/rendcommon.c +++ b/src/or/rendcommon.c @@ -934,7 +934,7 @@ rend_valid_descriptor_id(const char *query) return 1; -invalid: + invalid: return 0; } @@ -1429,7 +1429,7 @@ compute_desc_id(rend_data_t *rend_data) } } -end: + end: return ret; } @@ -1498,7 +1498,8 @@ rend_data_client_create(const char *onion_address, const char *desc_id, return rend_data; -error: + error: rend_data_free(rend_data); return NULL; } + ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] whitespace fixes
commit c3894473fee0199de50904973abb75fe2935451f Author: Nick Mathewson Date: Thu Apr 23 09:36:43 2015 -0400 whitespace fixes --- src/common/crypto.c |2 +- src/or/main.c |3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/crypto.c b/src/common/crypto.c index f0d4fbb..f338114 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -2506,7 +2506,7 @@ static const char base64_encode_table[64] = { * bytes. Return the number of bytes written on success; -1 if * destlen is too short, or other failure. * - * If flags&BASE64_ENCODE_MULTILINE is true, return encoded + * If flags&BASE64_ENCODE_MULTILINE is true, return encoded * output in multiline format (64 character, `\n' terminated lines). */ int diff --git a/src/or/main.c b/src/or/main.c index 22b006a..3fb7de6 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -1623,7 +1623,8 @@ run_scheduled_events(time_t now) time_to.check_for_correct_dns < now && ! router_my_exit_policy_is_reject_star()) { if (!time_to.check_for_correct_dns) { - time_to.check_for_correct_dns = crypto_rand_time_range(now, now + 120) + 60; + time_to.check_for_correct_dns = +crypto_rand_time_range(now + 60, now + 180); } else { dns_launch_correctness_checks(); time_to.check_for_correct_dns = now + 12*3600 + ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] whitespace fixes
commit afe10e47079daa19162b046281055c535cc2d485 Author: Nick Mathewson Date: Wed Feb 18 10:55:56 2015 -0500 whitespace fixes --- src/test/test_helpers.c |3 --- 1 file changed, 3 deletions(-) diff --git a/src/test/test_helpers.c b/src/test/test_helpers.c index 8f4a3a9..c3ca0c3 100644 --- a/src/test/test_helpers.c +++ b/src/test/test_helpers.c @@ -31,7 +31,6 @@ get_yesterday_date_str(void) return buf; } - /* NOP replacement for router_descriptor_is_older_than() */ static int router_descriptor_is_older_than_replacement(const routerinfo_t *router, @@ -85,5 +84,3 @@ helper_setup_fake_routerlist(void) UNMOCK(router_descriptor_is_older_than); } - - ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] whitespace fixes
commit 034e2788f812852ed530b42291b3e07c7dc85d84 Author: Nick Mathewson Date: Fri Jan 23 11:18:28 2015 -0500 whitespace fixes --- src/or/circuitbuild.h |3 ++- src/or/config.c |1 - src/or/cpuworker.c |1 - src/or/directory.c |1 - src/or/directory.h |3 ++- src/or/routerlist.c |6 +++--- src/test/test_crypto_slow.c |1 - src/test/test_routerlist.c |2 +- src/test/test_util_slow.c |1 + 9 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/or/circuitbuild.h b/src/or/circuitbuild.h index 7d49530..c72016d 100644 --- a/src/or/circuitbuild.h +++ b/src/or/circuitbuild.h @@ -22,7 +22,8 @@ origin_circuit_t *circuit_establish_circuit(uint8_t purpose, extend_info_t *exit, int flags); int circuit_handle_first_hop(origin_circuit_t *circ); -void circuit_n_chan_done(channel_t *chan, int status, int close_origin_circuits); +void circuit_n_chan_done(channel_t *chan, int status, + int close_origin_circuits); int inform_testing_reachability(void); int circuit_timeout_want_to_count_circ(origin_circuit_t *circ); int circuit_send_next_onion_skin(origin_circuit_t *circ); diff --git a/src/or/config.c b/src/or/config.c index 91fbe97..568baec 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -5758,7 +5758,6 @@ parse_port_config(smartlist_t *out, return 0; } /* end if (listenaddrs) */ - /* No ListenAddress lines. If there's no FooPort, then maybe make a default * one. */ if (! ports) { diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c index 39d2079..0785c67 100644 --- a/src/or/cpuworker.c +++ b/src/or/cpuworker.c @@ -366,7 +366,6 @@ cpuworker_onion_handshake_replyfn(void *work_) } log_debug(LD_OR,"onionskin_answer succeeded. Yay."); - done_processing: memwipe(&rpl, 0, sizeof(rpl)); memwipe(job, 0, sizeof(*job)); diff --git a/src/or/directory.c b/src/or/directory.c index 348d971..d2b6b86 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -236,7 +236,6 @@ dir_fetch_type(int dir_purpose, int router_purpose, const char *resource) return type; } - /** Return true iff identity_digest is the digest of a router which * says that it caches extrainfos. (If is_authority we always * believe that to be true.) */ diff --git a/src/or/directory.h b/src/or/directory.h index 51e6ed3..4899eb5 100644 --- a/src/or/directory.h +++ b/src/or/directory.h @@ -123,7 +123,8 @@ int download_status_get_n_failures(const download_status_t *dls); /* Used only by directory.c and test_dir.c */ STATIC int parse_http_url(const char *headers, char **url); -STATIC int purpose_needs_anonymity(uint8_t dir_purpose, uint8_t router_purpose); +STATIC int purpose_needs_anonymity(uint8_t dir_purpose, + uint8_t router_purpose); STATIC dirinfo_type_t dir_fetch_type(int dir_purpose, int router_purpose, const char *resource); #endif diff --git a/src/or/routerlist.c b/src/or/routerlist.c index dacf980..fe92ac0 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -1442,7 +1442,7 @@ router_pick_directory_server_impl(dirinfo_type_t type, int flags, const networkstatus_t *consensus = networkstatus_get_latest_consensus(); const int requireother = ! (flags & PDS_ALLOW_SELF); const int fascistfirewall = ! (flags & PDS_IGNORE_FASCISTFIREWALL); - const int no_serverdesc_fetching = (flags & PDS_NO_EXISTING_SERVERDESC_FETCH); + const int no_serverdesc_fetching =(flags & PDS_NO_EXISTING_SERVERDESC_FETCH); const int no_microdesc_fetching = (flags & PDS_NO_EXISTING_MICRODESC_FETCH); const int for_guard = (flags & PDS_FOR_GUARD); int try_excluding = 1, n_excluded = 0, n_busy = 0; @@ -4265,7 +4265,8 @@ MOCK_IMPL(STATIC void, initiate_descriptor_downloads, if (b64_256) { digest256_to_base64(cp, smartlist_get(digests, lo)); } else { - base16_encode(cp, enc_digest_len, smartlist_get(digests, lo), digest_len); + base16_encode(cp, enc_digest_len, smartlist_get(digests, lo), +digest_len); } smartlist_add(tmp, cp); } @@ -4372,7 +4373,6 @@ launch_descriptor_downloads(int purpose, "tried downloading descriptors recently. Downloading.", descname); } - } } diff --git a/src/test/test_crypto_slow.c b/src/test/test_crypto_slow.c index 94fd69d..a0f6cdc 100644 --- a/src/test/test_crypto_slow.c +++ b/src/test/test_crypto_slow.c @@ -10,7 +10,6 @@ #include "crypto_s2k.h" #include "crypto_pwbox.h" - /** Run unit tests for our secret-to-key passphrase hashing functionality. */ static void test_crypto_s2k_rfc2440(void *arg) diff --git a/src/test/test_routerlist.c b/src/test/test_routerlist.c index 390b691..381a592 100644 --- a/src/test/test_routerlist.c +++ b/src/test/test_routerlist.c @@ -7,7 +7,6
[tor-commits] [tor/master] Whitespace fixes on 13291 fix
commit 15b0bf0aad53655a22430dbdf7d23f1f273f0877 Author: Nick Mathewson Date: Mon Sep 29 09:39:21 2014 -0400 Whitespace fixes on 13291 fix --- src/test/test_util.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/test_util.c b/src/test/test_util.c index 693cc06..c67aa71 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -2856,7 +2856,7 @@ test_util_fgets_eagain(void *ptr) #define MATCH_PROCESS_STATUS(s1,s2) ((s1) == (s2)) #else -/* work around a race condition of the timing of SIGCHLD handler updates +/* work around a race condition of the timing of SIGCHLD handler updates * to the process_handle's fields, and checks of those fields * * TODO: Once we can signal failure to exec, change PROCESS_STATUS_RUNNING to @@ -2909,11 +2909,11 @@ run_util_spawn_background(const char *argv[], const char *expected_out, /* When a spawned process forks, fails, then exits very quickly, * (this typically occurs when exec fails) * there is a race condition between the SIGCHLD handler - * updating the process_handle's fields, and this test + * updating the process_handle's fields, and this test * checking the process status in those fields. * The SIGCHLD update can occur before or after the code below executes. * This causes intermittent failures in spawn_background_fail(), - * typically when the machine is under load. + * typically when the machine is under load. * We use PROCESS_STATUS_RUNNING_OR_NOTRUNNING to avoid this issue. */ /* the race condition affects the change in @@ -2924,7 +2924,7 @@ run_util_spawn_background(const char *argv[], const char *expected_out, notify_pending_waitpid_callbacks(); /* the race condition affects the change in * process_handle->waitpid_cb to NULL, - * so we skip the check if expected_status is ambiguous, + * so we skip the check if expected_status is ambiguous, * that is, PROCESS_STATUS_RUNNING_OR_NOTRUNNING */ tt_assert(process_handle->waitpid_cb != NULL || expected_status == PROCESS_STATUS_RUNNING_OR_NOTRUNNING); ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] Whitespace fixes
commit b45bfba2ce3754aa8107717e638b325dd30f05ed Author: Nick Mathewson Date: Mon Sep 29 08:48:22 2014 -0400 Whitespace fixes --- src/or/config.c|1 - src/test/test_crypto.c | 13 - 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/or/config.c b/src/or/config.c index 16acec7..3d9e1d2 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1676,7 +1676,6 @@ options_act(const or_options_t *old_options) connection_or_update_token_buckets(get_connection_array(), options); } - /* Only collect directory-request statistics on relays and bridges. */ options->DirReqStatistics = options->DirReqStatistics_option && server_mode(options); diff --git a/src/test/test_crypto.c b/src/test/test_crypto.c index 32ea2f6..795c603 100644 --- a/src/test/test_crypto.c +++ b/src/test/test_crypto.c @@ -1051,7 +1051,8 @@ test_crypto_pwbox(void *arg) (void)arg; for (i = 0; i < ARRAY_LENGTH(flags); ++i) { -tt_int_op(0, ==, crypto_pwbox(&boxed, &len, (const uint8_t*)msg, strlen(msg), +tt_int_op(0, ==, crypto_pwbox(&boxed, &len, + (const uint8_t*)msg, strlen(msg), pw, strlen(pw), flags[i])); tt_assert(boxed); tt_assert(len > 128+32); @@ -1065,13 +1066,16 @@ test_crypto_pwbox(void *arg) tor_free(decoded); -tt_int_op(UNPWBOX_BAD_SECRET, ==, crypto_unpwbox(&decoded, &dlen, boxed, len, +tt_int_op(UNPWBOX_BAD_SECRET, ==, crypto_unpwbox(&decoded, &dlen, + boxed, len, pw, strlen(pw)-1)); boxed[len-1] ^= 1; -tt_int_op(UNPWBOX_BAD_SECRET, ==, crypto_unpwbox(&decoded, &dlen, boxed, len, +tt_int_op(UNPWBOX_BAD_SECRET, ==, crypto_unpwbox(&decoded, &dlen, + boxed, len, pw, strlen(pw))); boxed[0] = 255; -tt_int_op(UNPWBOX_CORRUPTED, ==, crypto_unpwbox(&decoded, &dlen, boxed, len, +tt_int_op(UNPWBOX_CORRUPTED, ==, crypto_unpwbox(&decoded, &dlen, +boxed, len, pw, strlen(pw))); tor_free(boxed); @@ -1080,7 +1084,6 @@ test_crypto_pwbox(void *arg) done: tor_free(boxed); tor_free(decoded); - } /** Test AES-CTR encryption and decryption with IV. */ ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] Whitespace fixes
commit 2e951f8dda4046d940b9268a8f02fe221098ab58 Author: rl1987 Date: Sun Sep 14 17:07:05 2014 +0300 Whitespace fixes --- src/or/policies.c |9 - src/test/test_policy.c |8 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/or/policies.c b/src/or/policies.c index 9739fd5..ffeda1f 100644 --- a/src/or/policies.c +++ b/src/or/policies.c @@ -62,11 +62,10 @@ static const char *private_nets[] = { NULL }; - -static int policies_parse_exit_policy_internal(config_line_t *cfg, +static int policies_parse_exit_policy_internal(config_line_t *cfg, smartlist_t **dest, int ipv6_exit, - int rejectprivate, + int rejectprivate, uint32_t local_address, int add_default_policy); @@ -957,7 +956,7 @@ exit_policy_remove_redundancies(smartlist_t *dest) static int policies_parse_exit_policy_internal(config_line_t *cfg, smartlist_t **dest, int ipv6_exit, -int rejectprivate, +int rejectprivate, uint32_t local_address, int add_default_policy) { @@ -985,7 +984,7 @@ policies_parse_exit_policy_internal(config_line_t *cfg, smartlist_t **dest, return 0; } -int +int policies_parse_exit_policy(config_line_t *cfg, smartlist_t **dest, exit_policy_parser_cfg_t options, uint32_t local_address) diff --git a/src/test/test_policy.c b/src/test/test_policy.c index 5f044d0..f1196c2 100644 --- a/src/test/test_policy.c +++ b/src/test/test_policy.c @@ -47,8 +47,8 @@ test_policy_summary_helper(const char *policy_str, line.value = (char *)policy_str; line.next = NULL; - r = policies_parse_exit_policy(&line, &policy, - EXIT_POLICY_IPV6_ENABLED | + r = policies_parse_exit_policy(&line, &policy, + EXIT_POLICY_IPV6_ENABLED | EXIT_POLICY_ADD_DEFAULT ,0); test_eq(r, 0); summary = policy_summarize(policy, AF_INET); @@ -199,10 +199,10 @@ test_policies_general(void *arg) line.key = (char*)"foo"; line.value = (char*)"accept *:80,reject private:*,reject *:*"; line.next = NULL; - + test_assert(0 == policies_parse_exit_policy(&line,&policy, EXIT_POLICY_IPV6_ENABLED | - EXIT_POLICY_ADD_DEFAULT,0)); + EXIT_POLICY_ADD_DEFAULT,0)); test_assert(policy); //test_streq(policy->string, "accept *:80"); //test_streq(policy->next->string, "reject *:*"); ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] Whitespace fixes
commit 991545acf19039b2d8ca895bdcf53bb5f2770c31 Author: Nick Mathewson Date: Sun Aug 24 13:32:39 2014 -0400 Whitespace fixes --- src/common/sandbox.c | 90 +- src/common/torgzip.c |1 + src/or/circuitlist.c |1 - 3 files changed, 2 insertions(+), 90 deletions(-) diff --git a/src/common/sandbox.c b/src/common/sandbox.c index e735feb..e215fe2 100644 --- a/src/common/sandbox.c +++ b/src/common/sandbox.c @@ -99,7 +99,7 @@ static sandbox_cfg_t *filter_dynamic = NULL; #undef SCMP_CMP #define SCMP_CMP(a,b,c) ((struct scmp_arg_cmp){(a),(b),(c),0}) #define SCMP_CMP_STR(a,b,c) \ - ((struct scmp_arg_cmp){(a),(b),(intptr_t)(void*)(c),0}) + ((struct scmp_arg_cmp) {(a),(b),(intptr_t)(void*)(c),0}) #define SCMP_CMP4(a,b,c,d) ((struct scmp_arg_cmp){(a),(b),(c),(d)}) /* We use a wrapper here because these masked comparisons seem to be pretty * verbose. Also, it's important to cast to scmp_datum_t before negating the @@ -1173,28 +1173,6 @@ sandbox_cfg_allow_stat_filename(sandbox_cfg_t **cfg, char *file) } int -sandbox_cfg_allow_stat_filename_array(sandbox_cfg_t **cfg, ...) -{ - int rc = 0; - char *fn = NULL; - - va_list ap; - va_start(ap, cfg); - - while ((fn = va_arg(ap, char*)) != NULL) { -rc = sandbox_cfg_allow_stat_filename(cfg, fn); -if (rc) { - log_err(LD_BUG,"(Sandbox) sandbox_cfg_allow_stat_filename_array fail"); - goto end; -} - } - - end: - va_end(ap); - return 0; -} - -int sandbox_cfg_allow_open_filename(sandbox_cfg_t **cfg, char *file) { sandbox_cfg_t *elem = NULL; @@ -1230,28 +1208,6 @@ sandbox_cfg_allow_rename(sandbox_cfg_t **cfg, char *file1, char *file2) } int -sandbox_cfg_allow_open_filename_array(sandbox_cfg_t **cfg, ...) -{ - int rc = 0; - char *fn = NULL; - - va_list ap; - va_start(ap, cfg); - - while ((fn = va_arg(ap, char*)) != NULL) { -rc = sandbox_cfg_allow_open_filename(cfg, fn); -if (rc) { - log_err(LD_BUG,"(Sandbox) sandbox_cfg_allow_open_filename_array fail"); - goto end; -} - } - - end: - va_end(ap); - return 0; -} - -int sandbox_cfg_allow_openat_filename(sandbox_cfg_t **cfg, char *file) { sandbox_cfg_t *elem = NULL; @@ -1268,28 +1224,6 @@ sandbox_cfg_allow_openat_filename(sandbox_cfg_t **cfg, char *file) return 0; } -int -sandbox_cfg_allow_openat_filename_array(sandbox_cfg_t **cfg, ...) -{ - int rc = 0; - char *fn = NULL; - - va_list ap; - va_start(ap, cfg); - - while ((fn = va_arg(ap, char*)) != NULL) { -rc = sandbox_cfg_allow_openat_filename(cfg, fn); -if (rc) { - log_err(LD_BUG,"(Sandbox) sandbox_cfg_allow_openat_filename_array fail"); - goto end; -} - } - - end: - va_end(ap); - return 0; -} - #if 0 int sandbox_cfg_allow_execve(sandbox_cfg_t **cfg, const char *com) @@ -1308,28 +1242,6 @@ sandbox_cfg_allow_execve(sandbox_cfg_t **cfg, const char *com) return 0; } -int -sandbox_cfg_allow_execve_array(sandbox_cfg_t **cfg, ...) -{ - int rc = 0; - char *fn = NULL; - - va_list ap; - va_start(ap, cfg); - - while ((fn = va_arg(ap, char*)) != NULL) { - -rc = sandbox_cfg_allow_execve(cfg, fn); -if (rc) { - log_err(LD_BUG,"(Sandbox) sandbox_cfg_allow_execve_array failed"); - goto end; -} - } - - end: - va_end(ap); - return 0; -} #endif /** Cache entry for getaddrinfo results; used when sandboxing is implemented diff --git a/src/common/torgzip.c b/src/common/torgzip.c index 26ce218..b4688bf 100644 --- a/src/common/torgzip.c +++ b/src/common/torgzip.c @@ -586,3 +586,4 @@ tor_zlib_get_total_allocation(void) { return total_zlib_allocation; } + diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index e04b4b9..35c5236 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -2083,7 +2083,6 @@ circuits_handle_oom(size_t current_allocation) circ->global_circuitlist_idx = circ_sl_idx; } SMARTLIST_FOREACH_END(circ); - /* Now sort the connection array ... */ now_ms_for_buf_cmp = now_ms; smartlist_sort(connection_array, conns_compare_by_buffer_age_); ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] Whitespace fixes
commit 2994f00199096860c4cbdfcb6b7d82918d637b27 Author: Nick Mathewson Date: Wed Aug 20 15:32:35 2014 -0400 Whitespace fixes --- src/test/test_entrynodes.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c index bf014f1..00efa81 100644 --- a/src/test/test_entrynodes.c +++ b/src/test/test_entrynodes.c @@ -561,18 +561,18 @@ test_entry_is_time_to_retry(void *arg) retval = entry_is_time_to_retry(test_guard,now); tt_int_op(retval,==,1); - + test_guard->last_attempted = now - (60*60 - 1); retval = entry_is_time_to_retry(test_guard,now); tt_int_op(retval,==,0); - + test_guard->unreachable_since = now - (6*60*60 + 1); test_guard->last_attempted = now - (4*60*60 + 1); retval = entry_is_time_to_retry(test_guard,now); tt_int_op(retval,==,1); - + test_guard->unreachable_since = now - (3*24*60*60 - 1); test_guard->last_attempted = now - (4*60*60 + 1); @@ -682,7 +682,7 @@ static const struct testcase_setup_t fake_network = { }; struct testcase_t entrynodes_tests[] = { - { "entry_is_time_to_retry", test_entry_is_time_to_retry, + { "entry_is_time_to_retry", test_entry_is_time_to_retry, TT_FORK, NULL, NULL }, { "choose_random_entry_no_guards", test_choose_random_entry_no_guards, TT_FORK, &fake_network, NULL }, ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] whitespace fixes
commit dd362b52f35a1654969a96082372ee25a9710002 Author: Nick Mathewson Date: Mon Jun 16 15:18:02 2014 -0400 whitespace fixes --- src/common/util_process.c |3 ++- src/common/util_process.h |1 + src/or/circuitlist.c |1 - src/or/circuitmux.c |1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/util_process.c b/src/common/util_process.c index 8ccf7f3..d6ef590 100644 --- a/src/common/util_process.c +++ b/src/common/util_process.c @@ -52,7 +52,8 @@ process_map_entry_hash_(const waitpid_callback_t *ent) } static INLINE unsigned int -process_map_entries_eq_(const waitpid_callback_t *a, const waitpid_callback_t *b) +process_map_entries_eq_(const waitpid_callback_t *a, +const waitpid_callback_t *b) { return a->pid == b->pid; } diff --git a/src/common/util_process.h b/src/common/util_process.h index 877702c..0b268b8 100644 --- a/src/common/util_process.h +++ b/src/common/util_process.h @@ -23,3 +23,4 @@ void notify_pending_waitpid_callbacks(void); #endif #endif + diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index a2dd07f..f3a8350 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -1122,7 +1122,6 @@ circuit_id_when_marked_unusable_on_channel(circid_t circ_id, channel_t *chan) return found->made_placeholder_at; } - /** Return the circuit that a given edge connection is using. */ circuit_t * circuit_get_by_edge_conn(edge_connection_t *conn) diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c index 563166e..55580d5 100644 --- a/src/or/circuitmux.c +++ b/src/or/circuitmux.c @@ -1944,3 +1944,4 @@ circuitmux_count_queued_destroy_cells(const channel_t *chan, return n_destroy_cells; } + ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] whitespace fixes
commit 9be105f94badd2a9ab1674b3c2b427df33426ecd Author: Nick Mathewson Date: Fri Jan 17 12:41:56 2014 -0500 whitespace fixes --- src/common/sandbox.c |1 - src/or/connection_edge.c |1 - 2 files changed, 2 deletions(-) diff --git a/src/common/sandbox.c b/src/common/sandbox.c index 0b67b18..dec6bfe 100644 --- a/src/common/sandbox.c +++ b/src/common/sandbox.c @@ -411,7 +411,6 @@ sb_socket(scmp_filter_ctx ctx, sandbox_cfg_t *filter) if (rc) return rc; - rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(socket), 3, SCMP_CMP(0, SCMP_CMP_EQ, PF_INET), SCMP_CMP(1, SCMP_CMP_EQ, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK), diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index d5969ae..4ca926e 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -2089,7 +2089,6 @@ connection_ap_handshake_socks_resolved_addr(entry_connection_t *conn, } } - /** Send an answer to an AP connection that has requested a DNS lookup via * SOCKS. The type should be one of RESOLVED_TYPE_(IPV4|IPV6|HOSTNAME) or -1 * for unreachable; the answer should be in the format specified in the socks ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] Whitespace fixes
commit 2b781613b07336e68d662fb9b10d2505f1e24ee1 Author: Nick Mathewson Date: Sun Nov 4 21:52:28 2012 -0500 Whitespace fixes --- src/or/config.c |1 + src/or/geoip.c |4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/or/config.c b/src/or/config.c index 338c670..dca49f5 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -5609,3 +5609,4 @@ config_maybe_load_geoip_files_(const or_options_t *options, || !geoip_is_loaded(AF_INET6))) config_load_geoip_file_(AF_INET6, options->GeoIPv6File, "geoip6"); } + diff --git a/src/or/geoip.c b/src/or/geoip.c index 3036ee2..2fd77d8 100644 --- a/src/or/geoip.c +++ b/src/or/geoip.c @@ -73,8 +73,8 @@ geoip_get_country(const char *country) return (country_t)idx; } -/** Add an entry to a GeoIP table, mapping all IP addresses between low and - * high, inclusive, to the 2-letter country code country. */ +/** Add an entry to a GeoIP table, mapping all IP addresses between low + * and high, inclusive, to the 2-letter country code country. */ static void geoip_add_entry(const tor_addr_t *low, const tor_addr_t *high, const char *country) ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] Whitespace fixes
commit aca325eb0c6b34ba0e1ef8df16c1cf44a98f9b6f Author: Nick Mathewson Date: Tue Sep 18 16:16:17 2012 -0400 Whitespace fixes --- src/or/circuitbuild.c | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 6bd1eb3..ffc7b5e 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -2646,11 +2646,11 @@ pathbias_count_first_hop(origin_circuit_t *circ) char *rate_msg = NULL; /* Completely ignore one hop circuits */ - if (circ->build_state->onehop_tunnel || - circ->build_state->desired_path_len == 1) { + if (circ->build_state->onehop_tunnel || + circ->build_state->desired_path_len == 1) { /* Check for inconsistency */ -if (circ->build_state->desired_path_len != 1 || -!circ->build_state->onehop_tunnel) { +if (circ->build_state->desired_path_len != 1 || +!circ->build_state->onehop_tunnel) { if ((rate_msg = rate_limit_log(&first_hop_notice_limit, approx_time( { log_info(LD_BUG, @@ -2756,11 +2756,11 @@ pathbias_count_success(origin_circuit_t *circ) char *rate_msg = NULL; /* Ignore one hop circuits */ - if (circ->build_state->onehop_tunnel || - circ->build_state->desired_path_len == 1) { + if (circ->build_state->onehop_tunnel || + circ->build_state->desired_path_len == 1) { /* Check for consistency */ -if (circ->build_state->desired_path_len != 1 || -!circ->build_state->onehop_tunnel) { +if (circ->build_state->desired_path_len != 1 || +!circ->build_state->onehop_tunnel) { if ((rate_msg = rate_limit_log(&success_notice_limit, approx_time( { log_info(LD_BUG, ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] Whitespace fixes.
commit 0770e4ccdbda2e71ad0a45d528b125df5b8db1a3 Author: Linus Nordberg Date: Wed Sep 5 19:40:15 2012 +0200 Whitespace fixes. --- src/common/address.c |2 +- src/or/dirvote.c |3 ++- src/or/dirvote.h |3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/common/address.c b/src/common/address.c index e5862be..dffbcaf 100644 --- a/src/common/address.c +++ b/src/common/address.c @@ -1697,7 +1697,6 @@ tor_addr_hostname_is_local(const char *name) !strcasecmpend(name, ".local"); } - /** Return a newly allocated tor_addr_port_t with addr and port filled in. */ tor_addr_port_t * @@ -1709,3 +1708,4 @@ tor_addr_port_new(const tor_addr_t *addr, uint16_t port) ap->port = port; return ap; } + diff --git a/src/or/dirvote.c b/src/or/dirvote.c index 082a1ef..8e85b2b 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -485,7 +485,8 @@ compute_routerstatus_consensus(smartlist_t *votes, int consensus_method, } SMARTLIST_FOREACH_END(rs); smartlist_sort(alt_orports, _compare_orports); -most_alt_orport = smartlist_get_most_frequent(alt_orports, _compare_orports); +most_alt_orport = smartlist_get_most_frequent(alt_orports, + _compare_orports); if (most_alt_orport) { memcpy(best_alt_orport_out, most_alt_orport, sizeof(tor_addr_port_t)); log_debug(LD_DIR, "\"a\" line winner for %s is %s:%d", diff --git a/src/or/dirvote.h b/src/or/dirvote.h index b3feeff..6211218 100644 --- a/src/or/dirvote.h +++ b/src/or/dirvote.h @@ -96,7 +96,8 @@ networkstatus_t * dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key, authority_cert_t *cert); -microdesc_t *dirvote_create_microdescriptor(const routerinfo_t *ri, int consensus_method); +microdesc_t *dirvote_create_microdescriptor(const routerinfo_t *ri, +int consensus_method); ssize_t dirvote_format_microdesc_vote_line(char *out, size_t out_len, const microdesc_t *md, int consensus_method_low, ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] whitespace fixes
commit 5579bc0eafc7ef426922e23340a5f885f8e8d4e9 Author: Nick Mathewson Date: Wed Jan 11 14:53:17 2012 -0500 whitespace fixes --- changes/clean_asprintf |2 +- src/or/control.c |1 - src/or/router.c|3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/changes/clean_asprintf b/changes/clean_asprintf index 6138201..ebaabd7 100644 --- a/changes/clean_asprintf +++ b/changes/clean_asprintf @@ -2,4 +2,4 @@ - Use the smartlist_add_asprintf alias more consistently throughout the codebase. - Convert more instances of tor_snprintf+tor_strdup into - tor_asprintf. \ No newline at end of file + tor_asprintf. diff --git a/src/or/control.c b/src/or/control.c index 2548a5c..1d2d8dd 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -1815,7 +1815,6 @@ circuit_describe_status_for_controller(origin_circuit_t *circ) if (circ->rend_data != NULL) { smartlist_add_asprintf(descparts, "REND_QUERY=%s", circ->rend_data->onion_address); - } { diff --git a/src/or/router.c b/src/or/router.c index f8aa1e3..0339e68 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -1973,7 +1973,8 @@ router_dump_router_to_string(char *s, size_t maxlen, routerinfo_t *router, format_iso_time(published, router->cache_info.published_on); if (router->declared_family && smartlist_len(router->declared_family)) { -char *family = smartlist_join_strings(router->declared_family, " ", 0, NULL); +char *family = smartlist_join_strings(router->declared_family, + " ", 0, NULL); tor_asprintf(&family_line, "family %s\n", family); tor_free(family); } else { ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] whitespace fixes
commit 7f0fb8e6083128ff20b30d8cd29c220e9427d95e Author: Nick Mathewson Date: Mon May 30 15:21:06 2011 -0400 whitespace fixes --- src/common/compat_libevent.h |5 + src/common/util.h|2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/common/compat_libevent.h b/src/common/compat_libevent.h index 1decc8d..89b2563 100644 --- a/src/common/compat_libevent.h +++ b/src/common/compat_libevent.h @@ -9,15 +9,12 @@ struct event; struct event_base; - #ifdef HAVE_EVENT2_EVENT_H #include -#else -#ifndef EVUTIL_SOCKET_DEFINED +#elif !defined(EVUTIL_SOCKET_DEFINED) #define EVUTIL_SOCKET_DEFINED #define evutil_socket_t int #endif -#endif void configure_libevent_logging(void); void suppress_libevent_log_msg(const char *msg); diff --git a/src/common/util.h b/src/common/util.h index ebbcf78..d657db6 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -276,7 +276,7 @@ typedef struct ratelim_t { char *rate_limit_log(ratelim_t *lim, time_t now); /* File helpers */ -ssize_t write_all(tor_socket_t fd, const char *buf, size_t count, int isSocket); +ssize_t write_all(tor_socket_t fd, const char *buf, size_t count,int isSocket); ssize_t read_all(tor_socket_t fd, char *buf, size_t count, int isSocket); /** Return values from file_status(); see that function's documentation ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] whitespace fixes to pass 'make check-spaces'
commit c2775196f79b9dba70d517663004e1783873f35c Author: Roger Dingledine Date: Tue Mar 15 16:59:58 2011 -0400 whitespace fixes to pass 'make check-spaces' --- src/or/connection.c | 10 ++ src/or/relay.c | 24 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/or/connection.c b/src/or/connection.c index ff23646..b586b43 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -3264,7 +3264,7 @@ _connection_write_to_buf_impl(const char *string, size_t len, * conn->write_event won't be set yet. Otherwise, write data from * this conn as the socket is available. */ if (conn->write_event) { - connection_start_writing(conn); +connection_start_writing(conn); } if (zlib) { conn->outbuf_flushlen += buf_datalen(conn->outbuf) - old_datalen; @@ -3845,9 +3845,11 @@ assert_connection_ok(connection_t *conn, time_t now) * EXIT_CONN_STATE_RESOLVING while the conn is not yet marked to writing. * */ tor_assert((conn->type == CONN_TYPE_EXIT && - conn->state == EXIT_CONN_STATE_RESOLVING) || - connection_is_writing(conn) || conn->write_blocked_on_bw || -(CONN_IS_EDGE(conn) && TO_EDGE_CONN(conn)->edge_blocked_on_circ)); +conn->state == EXIT_CONN_STATE_RESOLVING) || + connection_is_writing(conn) || + conn->write_blocked_on_bw || + (CONN_IS_EDGE(conn) && +TO_EDGE_CONN(conn)->edge_blocked_on_circ)); } if (conn->hold_open_until_flushed) diff --git a/src/or/relay.c b/src/or/relay.c index 17ce7db..81a6497 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -1031,9 +1031,9 @@ connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ, relay_header_t rh; unsigned domain = layer_hint?LD_APP:LD_EXIT; int reason; - int optimistic_data = 0; /* Set to 1 if we receive data on a stream - that's in the EXIT_CONN_STATE_RESOLVING - or EXIT_CONN_STATE_CONNECTING states.*/ + int optimistic_data = 0; /* Set to 1 if we receive data on a stream +* that's in the EXIT_CONN_STATE_RESOLVING +* or EXIT_CONN_STATE_CONNECTING states. */ tor_assert(cell); tor_assert(circ); @@ -1055,16 +1055,16 @@ connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ, if (conn && !connection_state_is_open(TO_CONN(conn))) { if (conn->_base.type == CONN_TYPE_EXIT && - (conn->_base.state == EXIT_CONN_STATE_CONNECTING || - conn->_base.state == EXIT_CONN_STATE_RESOLVING) && - rh.command == RELAY_COMMAND_DATA) { - /* We're going to allow DATA cells to be delivered to an exit -* node in state EXIT_CONN_STATE_CONNECTING or -* EXIT_CONN_STATE_RESOLVING. This speeds up HTTP, for example. */ - optimistic_data = 1; +(conn->_base.state == EXIT_CONN_STATE_CONNECTING || + conn->_base.state == EXIT_CONN_STATE_RESOLVING) && +rh.command == RELAY_COMMAND_DATA) { + /* Allow DATA cells to be delivered to an exit node in state + * EXIT_CONN_STATE_CONNECTING or EXIT_CONN_STATE_RESOLVING. + * This speeds up HTTP, for example. */ + optimistic_data = 1; } else { - return connection_edge_process_relay_cell_not_open( -&rh, cell, circ, conn, layer_hint); + return connection_edge_process_relay_cell_not_open( + &rh, cell, circ, conn, layer_hint); } } ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits