mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 20:33:31 +01:00
wrong is ok, and right is fine, but in between is apparently
totally unacceptable to me. svn:r3005
This commit is contained in:
parent
f7c6ad065e
commit
22727b4edc
@ -317,8 +317,10 @@ circuit_get_youngest_clean_open(uint8_t purpose) {
|
||||
circuit_t *youngest=NULL;
|
||||
|
||||
for (circ=global_circuitlist;circ;circ = circ->next) {
|
||||
if (CIRCUIT_IS_ORIGIN(circ) && circ->state == CIRCUIT_STATE_OPEN &&
|
||||
!circ->marked_for_close && circ->purpose == purpose &&
|
||||
if (CIRCUIT_IS_ORIGIN(circ) &&
|
||||
circ->state == CIRCUIT_STATE_OPEN &&
|
||||
!circ->marked_for_close &&
|
||||
circ->purpose == purpose &&
|
||||
!circ->timestamp_dirty &&
|
||||
(!youngest || youngest->timestamp_created < circ->timestamp_created))
|
||||
youngest = circ;
|
||||
|
@ -264,8 +264,10 @@ int circuit_stream_is_being_handled(connection_t *conn) {
|
||||
time_t now = time(NULL);
|
||||
|
||||
for (circ=global_circuitlist;circ;circ = circ->next) {
|
||||
if (CIRCUIT_IS_ORIGIN(circ) && circ->state != CIRCUIT_STATE_OPEN &&
|
||||
!circ->marked_for_close && circ->purpose == CIRCUIT_PURPOSE_C_GENERAL &&
|
||||
if (CIRCUIT_IS_ORIGIN(circ) &&
|
||||
circ->state != CIRCUIT_STATE_OPEN &&
|
||||
!circ->marked_for_close &&
|
||||
circ->purpose == CIRCUIT_PURPOSE_C_GENERAL &&
|
||||
(!circ->timestamp_dirty ||
|
||||
circ->timestamp_dirty + get_options()->NewCircuitPeriod < now)) {
|
||||
exitrouter = router_get_by_digest(circ->build_state->chosen_exit_digest);
|
||||
@ -305,7 +307,8 @@ void circuit_build_needed_circs(time_t now) {
|
||||
client_dns_clean();
|
||||
circuit_expire_old_circuits();
|
||||
|
||||
if (get_options()->RunTesting && circ &&
|
||||
if (get_options()->RunTesting &&
|
||||
circ &&
|
||||
circ->timestamp_created + TESTING_CIRCUIT_INTERVAL < now) {
|
||||
log_fn(LOG_INFO,"Creating a new testing circuit.");
|
||||
circuit_launch_by_identity(CIRCUIT_PURPOSE_C_GENERAL, NULL);
|
||||
@ -720,7 +723,7 @@ circuit_get_open_circ_or_launch(connection_t *conn,
|
||||
tor_free(exitname);
|
||||
|
||||
if (circ &&
|
||||
(desired_circuit_purpose != CIRCUIT_PURPOSE_C_GENERAL)) {
|
||||
desired_circuit_purpose != CIRCUIT_PURPOSE_C_GENERAL) {
|
||||
/* then write the service_id into circ */
|
||||
strlcpy(circ->rend_query, conn->rend_query, sizeof(circ->rend_query));
|
||||
}
|
||||
|
@ -1134,9 +1134,9 @@ connection_t *connection_get_by_identity_digest(const char *digest, int type)
|
||||
conn = carray[i];
|
||||
if (conn->type != type)
|
||||
continue;
|
||||
if (!memcmp(conn->identity_digest, digest, DIGEST_LEN)
|
||||
&& !conn->marked_for_close
|
||||
&& (!best || best->timestamp_created < conn->timestamp_created))
|
||||
if (!memcmp(conn->identity_digest, digest, DIGEST_LEN) &&
|
||||
!conn->marked_for_close &&
|
||||
(!best || best->timestamp_created < conn->timestamp_created))
|
||||
best = conn;
|
||||
}
|
||||
return best;
|
||||
|
@ -1000,8 +1000,8 @@ int connection_ap_can_use_exit(connection_t *conn, routerinfo_t *exit)
|
||||
return tor_version_as_new_as(exit->platform, "0.0.9pre1");
|
||||
}
|
||||
addr = client_dns_lookup_entry(conn->socks_request->address);
|
||||
if (router_compare_addr_to_addr_policy(addr,
|
||||
conn->socks_request->port, exit->exit_policy) < 0)
|
||||
if (router_compare_addr_to_addr_policy(addr, conn->socks_request->port,
|
||||
exit->exit_policy) < 0)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
@ -1174,8 +1174,7 @@ void nt_service_body(int argc, char **argv)
|
||||
service_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
|
||||
service_status.dwCurrentState = SERVICE_START_PENDING;
|
||||
service_status.dwControlsAccepted =
|
||||
SERVICE_ACCEPT_STOP |
|
||||
SERVICE_ACCEPT_SHUTDOWN;
|
||||
SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN;
|
||||
service_status.dwWin32ExitCode = 0;
|
||||
service_status.dwServiceSpecificExitCode = 0;
|
||||
service_status.dwCheckPoint = 0;
|
||||
@ -1280,9 +1279,9 @@ int nt_service_install()
|
||||
}
|
||||
|
||||
if ((hService = CreateService(hSCManager, GENSRV_SERVICENAME, GENSRV_DISPLAYNAME,
|
||||
SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_DEMAND_START,
|
||||
SERVICE_ERROR_IGNORE, command, NULL, NULL,
|
||||
NULL, NULL, NULL)) == NULL) {
|
||||
SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS,
|
||||
SERVICE_DEMAND_START, SERVICE_ERROR_IGNORE, command,
|
||||
NULL, NULL, NULL, NULL, NULL)) == NULL) {
|
||||
printf("Failed: CreateService()\n");
|
||||
CloseServiceHandle(hSCManager);
|
||||
free(command);
|
||||
|
@ -433,9 +433,8 @@ router_parse_routerlist_from_directory(const char *str,
|
||||
static int have_warned_about_unverified_status = 0;
|
||||
routerinfo_t *me = router_get_my_routerinfo();
|
||||
if (me) {
|
||||
if (router_update_status_from_smartlist(me, published_on,
|
||||
good_nickname_list,
|
||||
tok->tp==K_RUNNING_ROUTERS)==1 &&
|
||||
if (router_update_status_from_smartlist(me,
|
||||
published_on, good_nickname_list, tok->tp==K_RUNNING_ROUTERS)==1 &&
|
||||
me->is_verified == 0 && !have_warned_about_unverified_status) {
|
||||
log_fn(LOG_WARN,"Dirserver '%s' lists your server as unverified. Please consider sending your identity fingerprint to the tor-ops.", dirnickname);
|
||||
have_warned_about_unverified_status = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user