Commit 22727b4e authored by Roger Dingledine's avatar Roger Dingledine
Browse files

wrong is ok, and right is fine, but in between is apparently

totally unacceptable to me.


svn:r3005
parent f7c6ad06
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -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;
+34 −31
Original line number Diff line number Diff line
@@ -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));
    }
+24 −24
Original line number Diff line number Diff line
@@ -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;
+5 −5
Original line number Diff line number Diff line
@@ -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;
}
+30 −31
Original line number Diff line number Diff line
@@ -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);
Loading