diff options
author | Roger Dingledine <arma@torproject.org> | 2006-10-20 19:11:12 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2006-10-20 19:11:12 +0000 |
commit | 0459db2c0d0e2af23b4db26ce4de555ee29eb7ec (patch) | |
tree | f07d4126e581d0c01d506237840c8274e61fa400 /src/or | |
parent | b27cb38dee3aa024e191a974bcf2801d4e87c0a5 (diff) | |
download | tor-0459db2c0d0e2af23b4db26ce4de555ee29eb7ec.tar.gz tor-0459db2c0d0e2af23b4db26ce4de555ee29eb7ec.zip |
checkpoint some changes as i read diffs
svn:r8780
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/connection_edge.c | 17 | ||||
-rw-r--r-- | src/or/control.c | 3 | ||||
-rw-r--r-- | src/or/directory.c | 2 | ||||
-rw-r--r-- | src/or/or.h | 4 | ||||
-rw-r--r-- | src/or/routerlist.c | 6 | ||||
-rw-r--r-- | src/or/test.c | 2 |
6 files changed, 20 insertions, 14 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 9e7173ad48..b7429788a4 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -1857,12 +1857,12 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ) /* Note: we have to use relay_send_command_from_edge here, not * connection_edge_end or connection_edge_send_command, since those require * that we have a stream connected to a circuit, and we don't connect to a - * circuit unitl we have a pending/sucessful resolve. */ + * circuit until we have a pending/successful resolve. */ if (!server_mode(get_options()) && circ->purpose != CIRCUIT_PURPOSE_S_REND_JOINED) { log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, - "Relay begin cell at non-server. Dropping."); + "Relay begin cell at non-server. Closing."); end_payload[0] = END_STREAM_REASON_EXITPOLICY; relay_send_command_from_edge(rh.stream_id, circ, RELAY_COMMAND_END, end_payload, 1, NULL); @@ -1872,7 +1872,7 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ) if (rh.command == RELAY_COMMAND_BEGIN) { if (!memchr(cell->payload+RELAY_HEADER_SIZE, 0, rh.length)) { log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, - "Relay begin cell has no \\0. Dropping."); + "Relay begin cell has no \\0. Closing."); end_payload[0] = END_STREAM_REASON_TORPROTOCOL; relay_send_command_from_edge(rh.stream_id, circ, RELAY_COMMAND_END, end_payload, 1, NULL); @@ -1881,7 +1881,7 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ) if (parse_addr_port(LOG_PROTOCOL_WARN, cell->payload+RELAY_HEADER_SIZE, &address,NULL,&port)<0) { log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, - "Unable to parse addr:port in relay begin cell. Dropping."); + "Unable to parse addr:port in relay begin cell. Closing."); end_payload[0] = END_STREAM_REASON_TORPROTOCOL; relay_send_command_from_edge(rh.stream_id, circ, RELAY_COMMAND_END, end_payload, 1, NULL); @@ -1889,7 +1889,7 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ) } if (port==0) { log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, - "Missing port in relay begin cell. Dropping."); + "Missing port in relay begin cell. Closing."); end_payload[0] = END_STREAM_REASON_TORPROTOCOL; relay_send_command_from_edge(rh.stream_id, circ, RELAY_COMMAND_END, end_payload, 1, NULL); @@ -1900,7 +1900,7 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ) if (!tor_strisprint(address)) { log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "Non-printing characters in address %s in relay " - "begin cell. Dropping.", escaped(address)); + "begin cell. Closing.", escaped(address)); end_payload[0] = END_STREAM_REASON_TORPROTOCOL; relay_send_command_from_edge(rh.stream_id, circ, RELAY_COMMAND_END, end_payload, 1, NULL); @@ -1913,7 +1913,7 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ) * and users who'd be better off with, well, single-hop proxies. */ log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, - "Attempt to open a stream on first hop of circuit. Dropping."); + "Attempt to open a stream on first hop of circuit. Closing."); end_payload[0] = END_STREAM_REASON_TORPROTOCOL; relay_send_command_from_edge(rh.stream_id, circ, RELAY_COMMAND_END, end_payload, 1, NULL); @@ -2193,7 +2193,8 @@ connection_exit_connect_dir(edge_connection_t *exit_conn) if ((err = tor_socketpair(AF_UNIX, SOCK_STREAM, 0, fd)) < 0) { log_warn(LD_NET, - "Couldn't construct socketpair (%s). Out of sockets?", + "Couldn't construct socketpair (%s). " + "Network down? Out of sockets?", tor_socket_strerror(-err)); connection_edge_end(exit_conn, END_STREAM_REASON_RESOURCELIMIT, exit_conn->cpath_layer); diff --git a/src/or/control.c b/src/or/control.c index c1e3ab5f94..05b2da2ee6 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -1438,6 +1438,9 @@ list_getinfo_options(void) "stream-status Status of each current application stream.\n" "version The current version of Tor.\n"); // XXXX Uptodate! + /* This has been hard to keep up to date. Is it worth making + * a table with names, descriptions, and functions to call, + * so there's only one place to maintain? -RD */ } /** Lookup the 'getinfo' entry <b>question</b>, and return diff --git a/src/or/directory.c b/src/or/directory.c index 37afd4b09d..274e644ec2 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -1305,7 +1305,7 @@ write_http_status_line(dir_connection_t *conn, int status, connection_write_to_buf(buf, strlen(buf), TO_CONN(conn)); } -/** Write the header for an HTTP/1.0 response onto <b>conn</b>->outbuf, +/** Write the header for an HTTP/1.0 response onto <b>conn</b>-\>outbuf, * with <b>type</b> as the Content-Type. * * If <b>length</b> is nonnegative, it is the Content-Length. diff --git a/src/or/or.h b/src/or/or.h index 21564707ca..1909bd811d 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -2347,8 +2347,8 @@ int circuit_receive_relay_cell(cell_t *cell, circuit_t *circ, void relay_header_pack(char *dest, const relay_header_t *src); void relay_header_unpack(relay_header_t *dest, const char *src); int relay_send_command_from_edge(uint16_t stream_id, circuit_t *circ, - int relay_command, const char *payload, - size_t payload_len, crypt_path_t *cpath_layer); + int relay_command, const char *payload, + size_t payload_len, crypt_path_t *cpath_layer); int connection_edge_send_command(edge_connection_t *fromconn, circuit_t *circ, int relay_command, const char *payload, size_t payload_len, diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 3ec7d7ffeb..ea5d90fb40 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -4164,7 +4164,7 @@ networkstatus_getinfo_helper_single(routerstatus_t *rs) /** If <b>question</b> is a string beginning with "ns/" in a format the * control interface expects for a GETINFO question, set *<b>answer</b> to a * newly-allocated string containing networkstatus lines for the appropriate - * ORs. Return 0 on success, -1 on failure. */ + * ORs. Return 0 on success, -1 on unrecognized question format. */ int networkstatus_getinfo_helper(const char *question, char **answer) { @@ -4175,7 +4175,7 @@ networkstatus_getinfo_helper(const char *question, char **answer) return 0; } - if (!strcmpstart(question, "ns/all")) { + if (!strcmp(question, "ns/all")) { smartlist_t *statuses = smartlist_create(); SMARTLIST_FOREACH(routerstatus_list, local_routerstatus_t *, lrs, { @@ -4202,6 +4202,8 @@ networkstatus_getinfo_helper(const char *question, char **answer) *answer = networkstatus_getinfo_helper_single(&status->status); } else { *answer = tor_strdup(""); + /* XXX this should return a 552, not a 250; but handle_getinfo_helper() + * isn't set up to handle that. That should be fixed too. :) -RD */ } return 0; } diff --git a/src/or/test.c b/src/or/test.c index 8e78dac944..c7de219701 100644 --- a/src/or/test.c +++ b/src/or/test.c @@ -1218,7 +1218,7 @@ test_mmap(void) test_streq(mapping->data, "Short file."); tor_munmap_file(mapping); - /* Make sure that we fail to map a no-longer-existant file. */ + /* Make sure that we fail to map a no-longer-existent file. */ mapping = tor_mmap_file(fname1); test_assert(mapping == NULL); |