Browse Source

Spell-check strings and comments

svn:r3052
Nick Mathewson 19 years ago
parent
commit
b457cfb5eb

+ 4 - 4
src/common/compat.c

@@ -112,7 +112,7 @@ int tor_vsnprintf(char *str, size_t size, const char *format, va_list args)
 
 #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.
  */
@@ -123,7 +123,7 @@ uint16_t get_uint16(const char *cp)
   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.
  */
@@ -249,7 +249,7 @@ tor_socketpair(int family, int type, int protocol, int fd[2])
     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;
@@ -646,7 +646,7 @@ struct { int code; const char *msg; } windows_socket_errors[] = {
   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"),

+ 1 - 1
src/common/container.c

@@ -242,7 +242,7 @@ void smartlist_insert(smartlist_t *sl, int idx, void *val)
 }
 
 /**
- * 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>&amp;SPLIT_SKIP_SPACE is true, remove initial and
  * trailing space from each entry.  If

+ 6 - 6
src/common/crypto.c

@@ -1078,7 +1078,7 @@ crypto_cipher_decrypt(crypto_cipher_env_t *env, unsigned char *to,
 }
 
 /** 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)
@@ -1087,7 +1087,7 @@ 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)
@@ -1100,7 +1100,7 @@ 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)
 {
@@ -1388,7 +1388,7 @@ void crypto_dh_free(crypto_dh_env_t *dh)
 /* 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)
 {
@@ -1417,7 +1417,7 @@ 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;
@@ -1474,7 +1474,7 @@ void crypto_pseudo_rand(unsigned char *to, unsigned int n)
   }
 }
 
-/** 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;

+ 3 - 3
src/common/util.c

@@ -168,7 +168,7 @@ char *tor_strndup(const char *s, size_t n) {
   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.
    */
@@ -256,7 +256,7 @@ int tor_strpartition(char *dest, size_t dest_len,
   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.
@@ -385,7 +385,7 @@ const char *find_whitespace(const char *s) {
  * 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,

+ 1 - 1
src/or/buffers.c

@@ -70,7 +70,7 @@ static INLINE int buf_ensure_capacity(buf_t *buf, size_t capacity)
 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

+ 1 - 1
src/or/circuituse.c

@@ -604,7 +604,7 @@ static int did_circs_fail_last_period = 0;
 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;
   }
 

+ 5 - 5
src/or/config.c

@@ -329,7 +329,7 @@ options_act(void) {
 
   /* 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))
@@ -499,7 +499,7 @@ static config_var_t *config_find_option(const char *key)
       return &config_vars[i];
     }
   }
-  /* Okay, unrecogized options */
+  /* Okay, unrecognized options */
   return NULL;
 }
 
@@ -1522,7 +1522,7 @@ static char *get_windows_conf_root(void)
   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,
@@ -1909,7 +1909,7 @@ add_single_log_option(or_options_t *options, int minSeverity, int maxSeverity,
 }
 
 /** 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)
 {
@@ -2077,7 +2077,7 @@ parse_redirect_line(smartlist_t *result, struct config_line_t *line)
 /** 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)
 {

+ 1 - 1
src/or/connection.c

@@ -1005,7 +1005,7 @@ int connection_handle_write(connection_t *conn) {
 
   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.");

+ 1 - 1
src/or/dirserv.c

@@ -899,7 +899,7 @@ static int generate_runningrouters(crypto_pk_env_t *private_key)
   }
   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); */
 

+ 2 - 2
src/or/hibernate.c

@@ -64,7 +64,7 @@ typedef enum {
  *    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.
  */
 
@@ -153,7 +153,7 @@ accounting_parse_options(or_options_t *options, int validate_only)
   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;

+ 2 - 2
src/or/main.c

@@ -1247,9 +1247,9 @@ int nt_service_install()
    *    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.

+ 1 - 1
src/or/rendclient.c

@@ -5,7 +5,7 @@ const char rendclient_c_id[] = "$Id$";
 
 /**
  * \file rendclient.c
- * \brief Client code to access location-hiddenn services.
+ * \brief Client code to access location-hidden services.
  **/
 
 #include "or.h"

+ 2 - 2
src/or/rendmid.c

@@ -81,7 +81,7 @@ rend_mid_establish_intro(circuit_t *circ, const char *request, size_t request_le
     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) {
@@ -199,7 +199,7 @@ rend_mid_establish_rendezvous(circuit_t *circ, const char *request, size_t reque
     goto err;
   }
 
-  /* Acknlowedge the request. */
+  /* Acknowledge the request. */
   if (connection_edge_send_command(NULL,circ,
                                    RELAY_COMMAND_RENDEZVOUS_ESTABLISHED,
                                    "", 0, NULL)<0) {

+ 2 - 2
src/or/rendservice.c

@@ -209,7 +209,7 @@ int rend_config_services(or_options_t *options, int validate_only)
       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;
     }
@@ -925,7 +925,7 @@ rend_consider_services_upload(time_t now) {
 }
 
 /** 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)

+ 2 - 2
src/or/rephist.c

@@ -18,7 +18,7 @@ typedef struct link_history_t {
   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;
@@ -599,7 +599,7 @@ rep_hist_get_bandwidth_lines(void)
       /* 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;
 

+ 1 - 1
src/or/routerlist.c

@@ -786,7 +786,7 @@ router_add_to_routerlist(routerinfo_t *router) {
       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.

+ 2 - 2
src/or/routerparse.c

@@ -1409,7 +1409,7 @@ int tor_version_as_new_as(const char *platform, const char *cutoff) {
   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 */
@@ -1423,7 +1423,7 @@ int tor_version_as_new_as(const char *platform, const char *cutoff) {
   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 */
   }