[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r14752: Backport: fix part of bug 681: always reattach tunneled dire (in tor/branches/tor-0_2_0-patches: . src/or)
Author: nickm
Date: 2008-05-27 16:52:42 -0400 (Tue, 27 May 2008)
New Revision: 14752
Modified:
tor/branches/tor-0_2_0-patches/ChangeLog
tor/branches/tor-0_2_0-patches/src/or/connection_edge.c
tor/branches/tor-0_2_0-patches/src/or/or.h
Log:
Backport: fix part of bug 681: always reattach tunneled directory connections, regardless of setting for leavestreamsunattached.
Modified: tor/branches/tor-0_2_0-patches/ChangeLog
===================================================================
--- tor/branches/tor-0_2_0-patches/ChangeLog 2008-05-27 20:45:18 UTC (rev 14751)
+++ tor/branches/tor-0_2_0-patches/ChangeLog 2008-05-27 20:52:42 UTC (rev 14752)
@@ -1,4 +1,9 @@
Changes in version 0.2.0.27-rc - 2008-05-??
+ o Minor bugfixes (controller):
+ - When tunneling an encrypted directory connection, and its first circuit
+ fails do not leave it unattached and ask the controller to deal. Fixes
+ the second part of bug 681.
+
o New files:
- A new contrib/tor-exit-notice.html file that exit relay operators
can put on their website to help reduce abuse queries.
Modified: tor/branches/tor-0_2_0-patches/src/or/connection_edge.c
===================================================================
--- tor/branches/tor-0_2_0-patches/src/or/connection_edge.c 2008-05-27 20:45:18 UTC (rev 14751)
+++ tor/branches/tor-0_2_0-patches/src/or/connection_edge.c 2008-05-27 20:52:42 UTC (rev 14752)
@@ -543,7 +543,9 @@
{
control_event_stream_status(conn, STREAM_EVENT_FAILED_RETRIABLE, reason);
conn->_base.timestamp_lastread = time(NULL);
- if (! get_options()->LeaveStreamsUnattached) {
+ if (!get_options()->LeaveStreamsUnattached || conn->use_begindir) {
+ /* If we're attaching streams ourself, or if this connection is
+ * a tunneled directory connection, then just attach it. */
conn->_base.state = AP_CONN_STATE_CIRCUIT_WAIT;
circuit_detach_stream(TO_CIRCUIT(circ),conn);
return connection_ap_handshake_attach_circuit(conn);
Modified: tor/branches/tor-0_2_0-patches/src/or/or.h
===================================================================
--- tor/branches/tor-0_2_0-patches/src/or/or.h 2008-05-27 20:45:18 UTC (rev 14751)
+++ tor/branches/tor-0_2_0-patches/src/or/or.h 2008-05-27 20:52:42 UTC (rev 14752)
@@ -369,6 +369,12 @@
#define DIR_PURPOSE_FETCH_RENDDESC_V2 18
#define _DIR_PURPOSE_MAX 18
+#define DIR_PURPOSE_IS_UPLOAD(p) \
+ ((p)==DIR_PURPOSE_UPLOAD_DIR || \
+ (p)==DIR_PURPOSE_UPLOAD_RENDDESC || \
+ (p)==DIR_PURPOSE_UPLOAD_VOTE || \
+ (p)==DIR_PURPOSE_UPLOAD_SIGNATURES)
+
#define _EXIT_PURPOSE_MIN 1
/** This exit stream wants to do an ordinary connect. */
#define EXIT_PURPOSE_CONNECT 1
@@ -994,7 +1000,7 @@
* already retried several times. */
uint8_t num_socks_retries;
- /** True iff this connection is for a dns request only. */
+ /** True iff this connection is for a dnsserv request only. */
unsigned int is_dns_request:1;
/** True iff this stream must attach to a one-hop circuit (e.g. for