#ifndef UNALIGNED_INT_ACCESS_OK
/**
- * Read a 16-bit value beginning at <b>cp</b>. Equaivalent to
+ * Read a 16-bit value beginning at <b>cp</b>. Equivalent to
* *(uint16_t*)(cp), but will not cause segfaults on platforms that forbid
* unaligned memory access.
*/
return v;
}
/**
- * Read a 32-bit value beginning at <b>cp</b>. Equaivalent to
+ * Read a 32-bit value beginning at <b>cp</b>. Equivalent to
* *(uint32_t*)(cp), but will not cause segfaults on platforms that forbid
* unaligned memory access.
*/
memset(&listen_addr, 0, sizeof(listen_addr));
listen_addr.sin_family = AF_INET;
listen_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
- listen_addr.sin_port = 0; /* kernel choses port. */
+ listen_addr.sin_port = 0; /* kernel chooses port. */
if (bind(listener, (struct sockaddr *) &listen_addr, sizeof (listen_addr))
== -1)
goto tidy_up_and_fail;
E(WSAENETRESET, "Network dropped connection on reset"),
E(WSAECONNABORTED, "Software caused connection abort"),
E(WSAECONNRESET, "Connection reset by peer"),
- E(WSAENOBUFS, "No buffer space avaialable"),
+ E(WSAENOBUFS, "No buffer space available"),
E(WSAEISCONN, "Socket is already connected"),
E(WSAENOTCONN, "Socket is not connected"),
E(WSAESHUTDOWN, "Cannot send after socket shutdown"),
}
/**
- * Split a string <b>str</b> along all occurences of <b>sep</b>,
+ * Split a string <b>str</b> along all occurrences of <b>sep</b>,
* adding the split strings, in order, to <b>sl</b>. If
* <b>flags</b>&SPLIT_SKIP_SPACE is true, remove initial and
* trailing space from each entry. If
}
/** Move the position of the cipher stream backwards by <b>delta</b> bytes.
- * Return 0 on suuccess, -1 on failure.
+ * Return 0 on success, -1 on failure.
*/
int
crypto_cipher_rewind(crypto_cipher_env_t *env, long delta)
}
/** Move the position of the cipher stream forwards by <b>delta</b> bytes.
- * Return 0 on suuccess, -1 on failure.
+ * Return 0 on success, -1 on failure.
*/
int
crypto_cipher_advance(crypto_cipher_env_t *env, long delta)
/** Compute the SHA1 digest of <b>len</b> bytes in data stored in
* <b>m</b>. Write the DIGEST_LEN byte result into <b>digest</b>.
- * Return 0 on suuccess, -1 on failure.
+ * Return 0 on success, -1 on failure.
*/
int crypto_digest(unsigned char *digest, const unsigned char *m, int len)
{
/* random numbers */
/** Seed OpenSSL's random number generator with DIGEST_LEN bytes from the
- * operating system. Return 0 on suuccess, -1 on failure.
+ * operating system. Return 0 on success, -1 on failure.
*/
int crypto_seed_rng(void)
{
return -1;
}
RAND_seed(buf, DIGEST_LEN);
- /* And add the current screen state to the entopy pool for
+ /* And add the current screen state to the entropy pool for
* good measure. */
RAND_screen();
return 0;
}
}
-/** Return a pseudorandom integer, choosen uniformly from the values
+/** Return a pseudorandom integer, chosen uniformly from the values
* between 0 and max-1. */
int crypto_pseudo_rand_int(unsigned int max) {
unsigned int val;
char *dup;
tor_assert(s);
dup = tor_malloc(n+1);
- /* Performance note: Ordinarly we prefer strlcpy to strncpy. But
+ /* Performance note: Ordinarily we prefer strlcpy to strncpy. But
* this function gets called a whole lot, and platform strncpy is
* much faster than strlcpy when strlen(s) is much longer than n.
*/
return 0;
}
-/** Return a pointer to a NUL-terminated hexidecimal string encoding
+/** Return a pointer to a NUL-terminated hexadecimal string encoding
* the first <b>fromlen</b> bytes of <b>from</b>. (fromlen must be \<= 32.) The
* result does not need to be deallocated, but repeated calls to
* hex_str will trash old results.
* are converted; or if there are unconverted characters and next is NULL; or
* if the parsed value is not between min and max. When no error occurs,
* return the parsed value and set *ok (if provided) to 1. When an error
- * ocurs, return 0 and set *ok (if provided) to 0.
+ * occurs, return 0 and set *ok (if provided) to 0.
*/
long
tor_parse_long(const char *s, int base, long min, long max,
static INLINE void buf_shrink_if_underfull(buf_t *buf) {
size_t new_len;
/* If the buffer is at least .25 full, or if shrinking the buffer would
- * put it onder MIN_BUF_SHRINK_SIZE, don't do it. */
+ * put it under MIN_BUF_SHRINK_SIZE, don't do it. */
if (buf->datalen >= buf->len/4 || buf->len < 2*MIN_BUF_SHRINK_SIZE)
return;
/* Shrink new_len by powers of 2 until: datalen is at least 1/4 of
circuit_t *circuit_launch_by_identity(uint8_t purpose, const char *exit_digest)
{
if (!has_fetched_directory) {
- log_fn(LOG_DEBUG,"Haven't fetched directory yet; cancelling circuit launch.");
+ log_fn(LOG_DEBUG,"Haven't fetched directory yet; canceling circuit launch.");
return NULL;
}
/* Set up accounting */
if (accounting_parse_options(options, 0)<0) {
- log_fn(LOG_ERR,"Error in accouting options");
+ log_fn(LOG_ERR,"Error in accounting options");
return -1;
}
if (accounting_is_enabled(options))
return &config_vars[i];
}
}
- /* Okay, unrecogized options */
+ /* Okay, unrecognized options */
return NULL;
}
if (is_set)
return path;
- /* Find X:\documents and settings\username\applicatation data\ .
+ /* Find X:\documents and settings\username\application data\ .
* We would use SHGetSpecialFolder path, but that wasn't added until IE4.
*/
if (!SUCCEEDED(SHGetSpecialFolderLocation(NULL, CSIDL_APPDATA,
}
/** Convert all old-style logging options to new-style Log options. Return 0
- * on success, -1 on faulure. */
+ * on success, -1 on failure. */
static int
normalize_log_options(or_options_t *options)
{
/** Read the contents of a DirServer line from <b>line</b>. Return 0
* if the line is well-formed, and 0 if it isn't. If
* <b>validate_only</b> is 0, and the line is well-formed, then add
- * the dirserver desribed in the line as a valid server. */
+ * the dirserver described in the line as a valid server. */
static int
parse_dir_server_line(const char *line, int validate_only)
{
conn->timestamp_lastwritten = now;
- /* Sometimes, "writeable" means "connected". */
+ /* Sometimes, "writable" means "connected". */
if (connection_state_is_connecting(conn)) {
if (getsockopt(conn->s, SOL_SOCKET, SO_ERROR, (void*)&e, &len) < 0) {
log_fn(LOG_WARN,"getsockopt() syscall failed?! Please report to tor-ops.");
}
runningrouters_is_dirty = 0;
- /* We don't cache runnning-routers to disk, so there's no point in
+ /* We don't cache running-routers to disk, so there's no point in
* authdirservers caching it. */
/* dirserv_set_cached_directory(the_runningrouters, time(NULL), 1); */
* connections, but provide bandwidth until we run out.
* 5. Then we hibernate until the end of the interval.
*
- * If the interval ends before we run out of bandwdith, we go back to
+ * If the interval ends before we run out of bandwidth, we go back to
* step one.
*/
case UNIT_MONTH:
d = tor_parse_long(smartlist_get(items,1), 10, 1, 28, &ok, NULL);
if (!ok) {
- log_fn(LOG_WARN, "Monthy accounting must start begin on a day between 1 and 28");
+ log_fn(LOG_WARN, "Monthly accounting must start begin on a day between 1 and 28");
goto err;
}
break;
* separate process (as now) or that can install and run itself
* as an NT service. I have no idea how hard this is.
*
- * Notes about develiping NT services:
+ * Notes about developing NT services:
*
- * 1. Don't count on your CWD. If an abolute path is not given, the
+ * 1. Don't count on your CWD. If an absolute path is not given, the
* fopen() function goes wrong.
* 2. The parameters given to the nt_service_body() function differ
* from those given to main() function.
/**
* \file rendclient.c
- * \brief Client code to access location-hiddenn services.
+ * \brief Client code to access location-hidden services.
**/
#include "or.h"
circuit_mark_for_close(c);
}
- /* Acknlowedge the request. */
+ /* Acknowledge the request. */
if (connection_edge_send_command(NULL,circ,
RELAY_COMMAND_INTRO_ESTABLISHED,
"", 0, NULL)<0) {
goto err;
}
- /* Acknlowedge the request. */
+ /* Acknowledge the request. */
if (connection_edge_send_command(NULL,circ,
RELAY_COMMAND_RENDEZVOUS_ESTABLISHED,
"", 0, NULL)<0) {
continue;
}
if (!service) {
- log_fn(LOG_WARN, "HiddenServicePort with no preceeding HiddenServiceDir directive");
+ log_fn(LOG_WARN, "HiddenServicePort with no preceding HiddenServiceDir directive");
rend_service_free(service);
return -1;
}
}
/** Log the status of introduction points for all rendezvous services
- * at log severity <b>serverity</b>.
+ * at log severity <b>severity</b>.
*/
void
rend_service_dump_stats(int severity)
time_t since;
/** When did we most recently note a change to this link */
time_t changed;
- /** How many times did extending from OR1 to OR2 succeeed? */
+ /** How many times did extending from OR1 to OR2 succeed? */
unsigned long n_extend_ok;
/** How many times did extending from OR1 to OR2 fail? */
unsigned long n_extend_fail;
/* We haven't been through the circular array yet; time starts at i=0.*/
i = 0;
else
- /* We've been arround the array at least once. The next i to be
+ /* We've been around the array at least once. The next i to be
overwritten is the oldest. */
i = b->next_max_idx;
if (router->is_verified) {
/* The new verified router replaces the old one; remove the
* old one. And carry on to the end of the list, in case
- * there are more old unverifed routers with this nickname
+ * there are more old unverified routers with this nickname
*/
/* mark-for-close connections using the old key, so we can
* make new ones with the new key.
char tmp[128];
if (tor_version_parse(cutoff, &cutoff_version)<0) {
- log_fn(LOG_WARN,"Bug: cutoff version '%s' unparsable.",cutoff);
+ log_fn(LOG_WARN,"Bug: cutoff version '%s' unparseable.",cutoff);
return 0;
}
if (strcmpstart(platform,"Tor ")) /* nonstandard Tor; be safe and say yes */
strlcpy(tmp, start, s-start+1);
if (tor_version_parse(tmp, &router_version)<0) {
- log_fn(LOG_INFO,"Router version '%s' unparsable.",tmp);
+ log_fn(LOG_INFO,"Router version '%s' unparseable.",tmp);
return 1; /* be safe and say yes */
}