summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changes/bug139934
-rw-r--r--src/common/log.c6
-rw-r--r--src/or/connection.c4
-rw-r--r--src/or/control.c6
-rw-r--r--src/test/test.c3
-rw-r--r--src/test/test_dir.c1
6 files changed, 17 insertions, 7 deletions
diff --git a/changes/bug13993 b/changes/bug13993
new file mode 100644
index 0000000000..bf99559822
--- /dev/null
+++ b/changes/bug13993
@@ -0,0 +1,4 @@
+ o Minor bugfixes (logging):
+ - Don't log messages to stdout twice when starting up. Fixes bug
+ 13993; bugfix on 0.2.6.1-alpha.
+
diff --git a/src/common/log.c b/src/common/log.c
index bbad7f1dac..e8cc30c312 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -1062,6 +1062,12 @@ flush_log_messages_from_startup(void)
if (! logfile_wants_message(lf, msg->severity, msg->domain))
continue;
+ /* We configure a temporary startup log that goes to stdout, so we
+ * shouldn't replay to stdout/stderr*/
+ if (lf->fd == STDOUT_FILENO || lf->fd == STDERR_FILENO) {
+ continue;
+ }
+
logfile_deliver(lf, msg->fullmsg, strlen(msg->fullmsg), msg->msg,
msg->domain, msg->severity, &callbacks_deferred);
}
diff --git a/src/or/connection.c b/src/or/connection.c
index 0ce4f72209..79ae178a56 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -1601,7 +1601,6 @@ connection_init_accepted_conn(connection_t *conn,
return 0;
}
-
static int
connection_connect_sockaddr(connection_t *conn,
const struct sockaddr *sa,
@@ -1688,11 +1687,10 @@ connection_connect_sockaddr(connection_t *conn,
*socket_error = SOCK_ERRNO(ENOBUFS);
return -1;
}
- return inprogress ? 0 : 1;
+ return inprogress ? 0 : 1;
}
-
/** Take conn, make a nonblocking socket; try to connect to
* addr:port (they arrive in *host order*). If fail, return -1 and if
* applicable put your best guess about errno into *<b>socket_error</b>.
diff --git a/src/or/control.c b/src/or/control.c
index 24e1479b50..064b745c9f 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1886,13 +1886,15 @@ circuit_describe_status_for_controller(origin_circuit_t *circ)
if (circ->socks_username_len > 0) {
char* socks_username_escaped = esc_for_log_len(circ->socks_username,
(size_t) circ->socks_username_len);
- smartlist_add_asprintf(descparts, "SOCKS_USERNAME=%s", socks_username_escaped);
+ smartlist_add_asprintf(descparts, "SOCKS_USERNAME=%s",
+ socks_username_escaped);
tor_free(socks_username_escaped);
}
if (circ->socks_password_len > 0) {
char* socks_password_escaped = esc_for_log_len(circ->socks_password,
(size_t) circ->socks_password_len);
- smartlist_add_asprintf(descparts, "SOCKS_PASSWORD=%s", socks_password_escaped);
+ smartlist_add_asprintf(descparts, "SOCKS_PASSWORD=%s",
+ socks_password_escaped);
tor_free(socks_password_escaped);
}
diff --git a/src/test/test.c b/src/test/test.c
index 7995af3c69..78932a4b7a 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -106,7 +106,8 @@ test_onion_handshake(void *arg)
/* client handshake 2 */
memset(c_keys, 0, 40);
- tt_assert(! onion_skin_TAP_client_handshake(c_dh, s_buf, c_keys, 40, NULL));
+ tt_assert(! onion_skin_TAP_client_handshake(c_dh, s_buf, c_keys,
+ 40, NULL));
tt_mem_op(c_keys,OP_EQ, s_keys, 40);
memset(s_buf, 0, 40);
diff --git a/src/test/test_dir.c b/src/test/test_dir.c
index 849bbdbef6..a949f5de73 100644
--- a/src/test/test_dir.c
+++ b/src/test/test_dir.c
@@ -3079,7 +3079,6 @@ test_dir_packages(void *arg)
ADD(2, "cbc 99.1.11.1.2 http://example.com/ cubehash=ahooy");
ADD(2, "cbc 99.1.11.1.2 http://example.com/ cubehash=ahooy");
-
res = compute_consensus_package_lines(votes);
tt_assert(res);
tt_str_op(res, ==,