return;
}
-
#if defined(TOR_IS_MULTITHREADED) && !defined(MS_WINDOWS)
#define TIME_FNS_NEED_LOCKS
#endif
int spawn_func(int (*func)(void *), void *data);
void spawn_exit(void);
-
#if defined(MS_WINDOWS)
#define USE_WIN32_THREADS
#define TOR_IS_MULTITHREADED 1
#define tor_mutex_new() ((tor_mutex_t*)tor_malloc(sizeof(int)))
#define tor_mutex_acquire(m) do { } while (0)
#define tor_mutex_release(m) do { } while (0)
-#define tor_mutex_free(m) do { tor_free(m); } while(0)
+#define tor_mutex_free(m) do { tor_free(m); } while (0)
#define tor_get_thread_id() (1UL)
#endif
-
#endif
-
}
}
-
#define CONTROL_CMD_FRAGMENTHEADER 0x0010
#define CONTROL_CMD_FRAGMENT 0x0011
/** If there is a complete control message waiting on buf, then store
tor_assert(buf->mem);
tor_assert(buf->datalen <= buf->len);
}
-
*router_out = choice;
return 0;
}
-
/* For now, we only use testing circuits to see if our ORPort is
reachable. So, if this circuit ends at us, remember that. */
routerinfo_t *exit = router_get_by_digest(circ->build_state->chosen_exit_digest);
- if(exit && router_is_me(exit)) {
+ if (exit && router_is_me(exit)) {
log_fn(LOG_NOTICE,"Your ORPort is reachable from the outside. Excellent.");
router_orport_found_reachable();
}
return 1;
}
-
/** Try to find a safe live circuit for CONN_TYPE_AP connection conn. If
* we don't find one: if conn cannot be handled by any known nodes,
* warn and return -1 (conn needs to die);
return 0;
}
}
-
return best;
}
-
/** Return the connection with id <b>id</b> if it is not already
* marked for close.
*/
return NULL;
}
-
/** Return a connection of type <b>type</b> that is not marked for
* close.
*/
tor_assert(0);
}
}
-
return connection_edge_end(conn, reason, cpath_layer);
}
-
/** Connection <b>conn</b> has finished writing and has no bytes left on
* its outbuf.
*
}
}
-
/** A client-side struct to remember requests to rewrite addresses
* to new addresses. These structs make up a tree, with addressmap
* below as its root.
tor_assert(conn);
tor_assert(conn->type == CONN_TYPE_OR);
- switch(conn->state) {
+ switch (conn->state) {
case OR_CONN_STATE_PROXY_READING:
return connection_or_read_proxy_response(conn);
case OR_CONN_STATE_OPEN:
assert_connection_ok(conn,0);
- switch(conn->state) {
+ switch (conn->state) {
case OR_CONN_STATE_PROXY_FLUSHING:
log_fn(LOG_DEBUG,"finished sending CONNECT to proxy.");
conn->state = OR_CONN_STATE_PROXY_READING;
return 0;
}
-
if (!(circ = circuit_get_by_global_id(circ_id))) {
send_control_error(conn, ERR_NO_CIRC, "No circuit found with given ID");
return 0;
static void
_free_cached_resolve(struct cached_resolve *r) {
- while(r->pending_connections) {
+ while (r->pending_connections) {
struct pending_connection_t *victim = r->pending_connections;
r->pending_connections = victim->next;
tor_free(victim);
/** Write all statistics to the log, with log level 'severity'. Called
* in response to a SIGUSR1. */
-static void
+static void
dumpstats(int severity) {
int i;
connection_t *conn;
return -1;
switch (get_options()->command) {
case CMD_RUN_TOR:
-#ifdef MS_WINDOWS_SERVICE
+#ifdef MS_WINDOWS_SERVICE
service_status.dwCurrentState = SERVICE_RUNNING;
#endif
do_main_loop();