Commit Graph

8027 Commits

Author SHA1 Message Date
Robert Hogan 22ab997e83 Handle null conn->requested_resource rather than assert
Per arma's comments in bug1138
2010-09-12 14:10:16 +01:00
Robert Hogan 5799cdd9d3 Nick points out:
tor_assert(!conn->_base.purpose == DIR_PURPOSE_FETCH_EXTRAINFO)
!=
tor_assert(conn->_base.purpose != DIR_PURPOSE_FETCH_EXTRAINFO)
!!
2010-09-02 22:17:43 +01:00
Robert Hogan 2086588efe Amend per Sebastian's comments:
- Move checks for extra_info to callers
 - Change argument name from failed to descs
 - Use strlen("fp/") instead of a magic number
 - I passed on the suggestion to rename functions from *_failed() to
   *_handle_failure(). There are a lot of these so for now just follow
   the house style.
2010-09-02 22:17:27 +01:00
Robert Hogan d6744d611f Fall back to direct descriptor request to bridges when
requests to authorities fail due to a network error.

Bug#1138
"When a Tor client starts up using a bridge, and UpdateBridgesFromAuthority
is set, Tor will go to the authority first and look up the bridge by
fingerprint. If the bridge authority is filtered, Tor will never notice that
the bridge authority lookup failed. So it will never fall back."

Add connection_dir_bridge_routerdesc_failed(), a function for unpacking
the bridge information from a failed request, and ensure
connection_dir_request_failed() calls it if the failed request
was for a bridge descriptor.

Test:

1. for ip in `grep -iR 'router ' cached-descriptors|cut -d ' ' -f 3`;
do sudo iptables -A OUTPUT -p tcp -d $ip -j DROP; done
2. remove all files from user tor directory
3. Put the following in torrc:

UseBridges 1
UpdateBridgesFromAuthority 1
Bridge 85.108.88.19:443 7E1B28DB47C175392A0E8E4A287C7CB8686575B7

4. Launch tor - it should fall back to downloading descriptors
   directly from the bridge.

Initial patch reviewed and corrected by mingw-san.
2010-08-16 21:15:49 +01:00
Roger Dingledine a207d9db4c fix another piece of 1741 2010-08-14 04:22:08 -04:00
Roger Dingledine e50857b67f changes entry for bug 1741 2010-08-13 20:50:51 -04:00
Mike Perry 5b0c0e1f89 Add check for CIRCUIT_PURPOSE_S_REND_JOINED.
These circuits stick around much longer than others on the server side for
performance reasons. Their lifetime is controlled by the client.
2010-08-13 20:46:33 -04:00
Roger Dingledine b1a5888553 fix a memory leak introduced by df1ef2f0f0 2010-08-13 17:30:50 -04:00
Roger Dingledine 1ac1f048ef minor formatting / comment fixes 2010-08-13 17:18:45 -04:00
Roger Dingledine 45c6b5de17 tiny change i found in my other sandbox 2010-08-11 01:48:29 -04:00
Roger Dingledine 0087a37bed tiny changes i found in my sandbox 2010-08-09 18:50:49 -04:00
Nick Mathewson f060b18e6c Fix a rare bug in rend_fn tests when the randomly generated port is 0
Since the rend code doesn't like the port to be 0, we shouldn't generate
the port by declaring crypto_rand_int(65536); instead we should
say crypto_rand_int(65535)+1.

Diagnosed by Matt Edman; fixes bug 1808.
2010-08-07 14:31:58 -04:00
Karsten Loesing 83626ec91c Move exit-stats code to the end of rephist.c. 2010-08-05 13:05:33 +02:00
Sebastian Hahn d365bc965d Only delay counting bridge users if we were a relay before 2010-08-05 13:05:32 +02:00
Karsten Loesing 166c2f4d92 Allow enabling or disabling *Statistics while Tor is running.
With this patch we stop scheduling when we should write statistics using a
single timestamp in run_scheduled_events(). Instead, we remember when a
statistics interval starts separately for each statistic type in geoip.c
and rephist.c. Every time run_scheduled_events() tries to write stats to
disk, it learns when it should schedule the next such attempt.

This patch also enables all statistics to be stopped and restarted at a
later time.

This patch comes with a few refactorings, some of which were not easily
doable without the patch.
2010-08-05 13:05:25 +02:00
Nick Mathewson 51377ae1bb Merge commit 'sebastian/mlockall' 2010-08-03 10:50:18 -04:00
Nick Mathewson b4e2d0607d Merge commit 'sebastian/distcheck' 2010-08-03 10:07:57 -04:00
Nick Mathewson 6d8b932659 Merge commit 'origin/maint-0.2.1' 2010-08-03 09:13:17 -04:00
Karsten Loesing f206209abf Update to the August 1 2010 Maxmind GeoLite Country database. 2010-08-03 13:04:09 +02:00
Sebastian Hahn ddf5020ea8 Fix 'make distcheck'
We were leaving doc/config.log and src/or/micro-revision.i in
place during a make clean. Fix that.
2010-08-03 00:48:59 +02:00
Nick Mathewson 9265190b16 Merge branch 'bug1384' 2010-08-02 12:53:52 -04:00
Sebastian Hahn a9d055c5c5 Fix a compile warning on OS X 10.6
Also update the changes file to contain a note on which bug was
fixed by this.
2010-08-02 18:45:17 +02:00
Chris Ball 73a4c0690e Bug #919: Don't rebind ports if we receive SIGHUP while hibernating. 2010-08-02 12:14:01 -04:00
Chris Ball 9ffa977981 Bug #928: Disallow BridgeRelay 1 and ORPort 0 configuration 2010-08-02 12:04:04 -04:00
Chris Ball 600ba86f4a Bug #1107: Complain if PublishServerDescriptor receives 0 or 1 in a list
0 or 1 should only be passed as the sole argument. Warn for now, reject
in 0.2.3.x.
2010-08-02 12:02:06 -04:00
Nick Mathewson fbfaa7bbc4 Merge commit 'sebastian/bug1776_v2' 2010-08-02 11:32:49 -04:00
Nick Mathewson 4504640b10 Merge branch 'bug1094_v2' 2010-08-02 11:11:02 -04:00
Chris Ball 1470eb2e91 Bug #1222: Clarify new circuit after sleep notice
("Application request when we're believed to be offline." ->
 "Application request when we haven't used client functionality lately.")
2010-07-31 16:58:49 -04:00
Nick Mathewson 49b0eb7a32 Fix up geoip unit tests to know about ?? 2010-07-31 15:21:08 -04:00
Nick Mathewson b175c584d5 Set up the geoip country table right even if not called normally 2010-07-31 15:21:08 -04:00
Nick Mathewson 4dd4d240b7 Move the "nowhereland" logic into geoip.c 2010-07-31 15:21:00 -04:00
Nick Mathewson 8fca6fb2aa Make "Nowhere" explicitly listable in torrc.
We already had the country code ?? indicating an unknown country, so all we
needed to do to make unknown countries excludable was to make the ?? code
discoverable.
2010-07-31 15:00:06 -04:00
Nick Mathewson 39378bf182 Warn when encounter the same (non-list) option twice in the same place
It's okay to get (say) a SocksPort line in the torrc, and then a
SocksPort on the command line to override it, and then a SocksPort via
a controller to override *that*.  But if there are two occurrences of
SocksPort in the torrc, or on the command line, or in a single SETCONF
command, then the user is likely confused.  Our old code would not
help unconfuse the user, but would instead silently ignore all but
the last occurrence.

This patch changes the behavior so that if the some option is passed
more than once to any torrc, command line, or SETCONF (each of which
coincidentally corresponds to a call to config_assign()), and the
option is not a type that allows multiple occurrences (LINELIST or
LINELIST_X), then we can warn the user.

This closes trac entry 1384.
2010-07-31 13:16:48 -04:00
Sebastian Hahn 9ca311f622 Allow using regular relays as bridges 2010-07-31 10:24:24 +02:00
Linus Nordberg da49a7267f Fix typos, make all \brief's conformant, end sentences with a period. 2010-07-28 17:42:33 +02:00
Sebastian Hahn 986dd554f4 Move the header for bandwidth_weight_rule_to_string into reasons.h 2010-07-27 10:00:47 +02:00
Sebastian Hahn 7b2b1b587d Don't include crypto, compat and util.h in or.h 2010-07-27 10:00:46 +02:00
Sebastian Hahn 02a57bbda5 Add the new header files to noinst_HEADERS
Also add a changes/ file.
2010-07-27 10:00:46 +02:00
Sebastian Hahn 05072723cb Create routerparse.h 2010-07-27 10:00:46 +02:00
Sebastian Hahn df9d42cef5 Create rephist.h 2010-07-27 10:00:46 +02:00
Sebastian Hahn 52e6e915fb Create rendmid.h 2010-07-27 10:00:45 +02:00
Sebastian Hahn b0cd4551ab Create relay.h 2010-07-27 10:00:45 +02:00
Sebastian Hahn cc060ea220 Create reasons.h 2010-07-27 10:00:45 +02:00
Sebastian Hahn 7bd8dee463 Create policies.h 2010-07-27 10:00:45 +02:00
Sebastian Hahn f6852fe031 Create onion.h 2010-07-27 10:00:45 +02:00
Sebastian Hahn af0c954bc5 Create ntmain.h 2010-07-27 10:00:39 +02:00
Sebastian Hahn 69fcbbaa89 Create networkstatus.h 2010-07-27 07:58:16 +02:00
Sebastian Hahn 86d6bfe448 Create microdesc.h 2010-07-27 07:58:16 +02:00
Sebastian Hahn 0f1548ab18 Create main.h 2010-07-27 07:58:16 +02:00
Sebastian Hahn a86f464f6b Create hibernate.h 2010-07-27 07:58:16 +02:00