summaryrefslogtreecommitdiff
path: root/src/or/connection.c
AgeCommit message (Collapse)Author
2014-09-02Fix a number of clang analyzer false-positivesNick Mathewson
Most of these are in somewhat non-obvious code where it is probably a good idea to initialize variables and add extra assertions anyway. Closes 13036. Patches from "teor".
2014-07-16src/or/connection.c: expose bucket_millis_empty for bufferevents testAnthony G. Basile
Currently tor fails to build its test when enabled with bufferevents because an #ifndef USE_BUFFEREVENTS hides bucket_millis_empty() and friends. This is fine if we don't run tests, but if we do, we need these functions in src/or/libtor-testing.a when linking src/test/test. This patch moves the functions outside the #ifndef and exposes them. See downstream bug: https://bugs.gentoo.org/show_bug.cgi?id=510124
2014-06-11Merge remote-tracking branch 'public/ticket6799_024_v2_squashed'Nick Mathewson
Conflicts: src/or/channel.c src/or/circuitlist.c src/or/connection.c Conflicts involved removal of next_circ_id and addition of unusable-circid tracking.
2014-06-11Replace last_added_nonpadding with last_had_circuitsNick Mathewson
The point of the "idle timeout" for connections is to kill the connection a while after it has no more circuits. But using "last added a non-padding cell" as a proxy for that is wrong, since if the last circuit is closed from the other side of the connection, we will not have sent anything on that connection since well before the last circuit closed. This is part of fixing 6799. When applied to 0.2.5, it is also a fix for 12023.
2014-06-11Give each or_connection_t a slightly randomized idle_timeoutNick Mathewson
Instead of killing an or_connection_t that has had no circuits for the last 3 minutes, give every or_connection_t a randomized timeout, so that an observer can't so easily infer from the connection close time the time at which its last circuit closed. Also, increase the base timeout for canonical connections from 3 minutes to 15 minutes. Fix for ticket 6799.
2014-05-14Use tor_getpw{nam,uid} wrappers to fix bug 11946Nick Mathewson
When running with User set, we frequently try to look up our information in the user database (e.g., /etc/passwd). The seccomp2 sandbox setup doesn't let us open /etc/passwd, and probably shouldn't. To fix this, we have a pair of wrappers for getpwnam and getpwuid. When a real call to getpwnam or getpwuid fails, they fall back to a cached value, if the uid/gid matches. (Granting access to /etc/passwd isn't possible with the way we handle opening files through the sandbox. It's not desirable either.)
2014-04-25Merge branch 'scanbuild_fixes'Nick Mathewson
2014-04-18scan-build: get_proxy_addrport should always set its outputsNick Mathewson
When get_proxy_addrport returned PROXY_NONE, it would leave addr/port unset. This is inconsistent, and could (if we used the function in a stupid way) lead to undefined behavior. Bugfix on 5b050a9b0, though I don't think it affects tor-as-it-is.
2014-04-18Merge remote-tracking branch 'public/bug11553_024' into bug11553_025Nick Mathewson
Conflicts: src/or/channel.h
2014-04-18Switch to random allocation on circuitIDs.Nick Mathewson
Fixes a possible root cause of 11553 by only making 64 attempts at most to pick a circuitID. Previously, we would test every possible circuit ID until we found one or ran out. This algorithm succeeds probabilistically. As the comment says: This potentially causes us to give up early if our circuit ID space is nearly full. If we have N circuit IDs in use, then we will reject a new circuit with probability (N / max_range) ^ MAX_CIRCID_ATTEMPTS. This means that in practice, a few percent of our circuit ID capacity will go unused. The alternative here, though, is to do a linear search over the whole circuit ID space every time we extend a circuit, which is not so great either. This makes new vs old clients distinguishable, so we should try to batch it with other patches that do that, like 11438.
2014-04-16Merge remote-tracking branch 'andrea/bug11304'Nick Mathewson
2014-04-15Call connection_or_close_for_error() properly if write_to_buf() ever fails ↵Andrea Shepard
on an orconn
2014-04-15Close orconns correctly through channels when setting DisableNetwork to 1Andrea Shepard
2014-04-02Fix make_socket_reusable() on windows. Bug not in any released TorNick Mathewson
2014-03-27Don't warn when setsockopt(SO_REUSEABLE) on accept()ed socket says EINVALNick Mathewson
This should fix bug10081. I believe this bug pertains to OSX behavior, not any Tor behavior change.
2014-03-18Take out remaining V1 directory code.Karsten Loesing
2014-03-11Merge remote-tracking branch 'asn/bug11069_take2'Nick Mathewson
2014-03-10Throw control port warning if we failed to connect to all our bridges.George Kadianakis
2014-03-03trivial whitespace fixesRoger Dingledine
2014-02-15Remove a bunch of functions that were never called.Nick Mathewson
2014-02-07Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
2014-02-06NULL out conns on tlschans when freeing in case channel_run_cleanup() is ↵Andrea Shepard
late; fixes bug 9602
2014-02-06Merge remote-tracking branch 'public/bug9716_024' into maint-0.2.4Nick Mathewson
2014-02-03TransProxyType replaces TransTPROXY optionNick Mathewson
I'm making this change now since ipfw will want its own option too, and proliferating options here isn't sensible. (See #10582 and #10267)
2014-02-02Move the friendly warning about TPROXY and root to EPERM timeNick Mathewson
I'm doing this because: * User doesn't mean you're running as root, and running as root doesn't mean you've set User. * It's possible that the user has done some other capability-based hack to retain the necessary privileges.
2014-01-31Add support for TPROXY via new TransTPRoxy optionNick Mathewson
Based on patch from "thomo" at #10582.
2013-10-31Move other #9731 check to start of its functionsNick Mathewson
At arma's suggestion. Looks like I missed this one.
2013-10-31Move #9731 checks to start of their functionsNick Mathewson
At arma's suggestion.
2013-10-31Merge remote-tracking branch 'public/bug9731'Nick Mathewson
2013-10-28Merge branch 'morestats4' into morestats5Karsten Loesing
Conflicts: doc/tor.1.txt src/or/config.c src/or/connection.h src/or/control.c src/or/control.h src/or/or.h src/or/relay.c src/or/relay.h src/test/test.c
2013-10-25Log the origin address of controller connectionsNick Mathewson
Resolves 9698; patch from "sigpipe".
2013-09-19Merge remote-tracking branch 'public/bug9716_024'Nick Mathewson
2013-09-13Don't apply read/write buckets to cpuworker connectionsNick Mathewson
Fixes bug 9731
2013-09-13Don't apply read/write buckets to non-limited connectionsNick Mathewson
Fixes bug 9731
2013-09-12Pass around const struct timeval * instead of struct timeval.Karsten Loesing
Suggested by nickm.
2013-09-11Try using INT_MAX, not SOMAXCONN, to set listen() backlog.Nick Mathewson
Fall back to SOMAXCONN if INT_MAX doesn't work. We'd like to do this because the actual maximum is overrideable by the kernel, and the value in the header file might not be right at all. All implementations I can find out about claim that this is supported. Fix for 9716; bugfix on every Tor.
2013-08-15Merge branch 'bug5040_4773_rebase_3'Nick Mathewson
2013-08-15Tests for connection_write_ext_or_command.Nick Mathewson
2013-08-15Unit tests for ext_or_id_map.Nick Mathewson
2013-08-02Prepare patch for ticket 5129 for merging.Peter Retzlaff
- Preserve old eventdns code. - Add function to close sockets cross-platform, without accounting. - Add changes/ file.
2013-07-18Make the Extended ORPort understand the TRANSPORT command.George Kadianakis
2013-07-18More Extended ORPort code improvements.George Kadianakis
* Change name of init_ext_or_auth_cookie_authentication(). * Add a small comment.
2013-07-18Move Extended ORPort code to its own module.George Kadianakis
Move the code from the connection_or module to ext_orport. This commit only moves code: it shouldn't modify anything.
2013-07-18Various Extended ORPort code improvements.George Kadianakis
* Add documentation. * Free ext_or_auth_correct_client_hash. * Use VPORT(ExtORPort) instead of V(ExtORPOrt). See dfe03d36c8749eb07e9bb2ea47e88ff05e9e3127 for details.
2013-07-18Prepare codebase for the implementation of Extended ORPort auth.George Kadianakis
2013-07-18Create the Extended ORPort authentication cookie file.George Kadianakis
2013-07-18Skeleton ExtORPort implementation. Needs testing, documentation.Nick Mathewson
Does not implement TransportControlPort yet.
2013-07-15Fix two pre-coffee typosPeter Palfrader
2013-07-15Reject relative control socket paths and emit a warning.Peter Palfrader
Previously we would accept relative paths, but only if they contained a slash somewhere (not at the end). Otherwise we would silently not work. Closes: #9258. Bugfix on 0.2.3.16-alpha.
2013-05-31Test functions used for TB_EMPTY and CELL_STATS events.Karsten Loesing