aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection.c
Commit message (Collapse)AuthorAge
* Merge remote-tracking branch 'public/ticket6799_024_v2_squashed'Nick Mathewson2014-06-11
|\ | | | | | | | | | | | | | | | | | | 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.
| * Replace last_added_nonpadding with last_had_circuitsNick Mathewson2014-06-11
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Give each or_connection_t a slightly randomized idle_timeoutNick Mathewson2014-06-11
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Use tor_getpw{nam,uid} wrappers to fix bug 11946Nick Mathewson2014-05-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.)
* | Merge branch 'scanbuild_fixes'Nick Mathewson2014-04-25
|\ \
| * | scan-build: get_proxy_addrport should always set its outputsNick Mathewson2014-04-18
| | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge remote-tracking branch 'public/bug11553_024' into bug11553_025Nick Mathewson2014-04-18
|\ \ \ | |/ / |/| | | | | | | | Conflicts: src/or/channel.h
| * | Switch to random allocation on circuitIDs.Nick Mathewson2014-04-18
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge remote-tracking branch 'andrea/bug11304'Nick Mathewson2014-04-16
|\ \
| * | Call connection_or_close_for_error() properly if write_to_buf() ever fails ↵Andrea Shepard2014-04-15
| | | | | | | | | | | | on an orconn
* | | Close orconns correctly through channels when setting DisableNetwork to 1Andrea Shepard2014-04-15
|/ /
* | Fix make_socket_reusable() on windows. Bug not in any released TorNick Mathewson2014-04-02
| |
* | Don't warn when setsockopt(SO_REUSEABLE) on accept()ed socket says EINVALNick Mathewson2014-03-27
| | | | | | | | | | This should fix bug10081. I believe this bug pertains to OSX behavior, not any Tor behavior change.
* | Take out remaining V1 directory code.Karsten Loesing2014-03-18
| |
* | Merge remote-tracking branch 'asn/bug11069_take2'Nick Mathewson2014-03-11
|\ \
| * | Throw control port warning if we failed to connect to all our bridges.George Kadianakis2014-03-10
| | |
* | | trivial whitespace fixesRoger Dingledine2014-03-03
|/ /
* | Remove a bunch of functions that were never called.Nick Mathewson2014-02-15
| |
* | Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson2014-02-07
|\|
| * NULL out conns on tlschans when freeing in case channel_run_cleanup() is ↵Andrea Shepard2014-02-06
| | | | | | | | late; fixes bug 9602
| * Merge remote-tracking branch 'public/bug9716_024' into maint-0.2.4Nick Mathewson2014-02-06
| |\
| * | Don't apply read/write buckets to cpuworker connectionsNick Mathewson2013-09-13
| | | | | | | | | | | | Fixes bug 9731
* | | TransProxyType replaces TransTPROXY optionNick Mathewson2014-02-03
| | | | | | | | | | | | | | | | | | | | | 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)
* | | Move the friendly warning about TPROXY and root to EPERM timeNick Mathewson2014-02-02
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Add support for TPROXY via new TransTPRoxy optionNick Mathewson2014-01-31
| | | | | | | | | | | | Based on patch from "thomo" at #10582.
* | | Move other #9731 check to start of its functionsNick Mathewson2013-10-31
| | | | | | | | | | | | At arma's suggestion. Looks like I missed this one.
* | | Move #9731 checks to start of their functionsNick Mathewson2013-10-31
| | | | | | | | | | | | At arma's suggestion.
* | | Merge remote-tracking branch 'public/bug9731'Nick Mathewson2013-10-31
|\ \ \
| * | | Don't apply read/write buckets to non-limited connectionsNick Mathewson2013-09-13
| |/ / | | | | | | | | | Fixes bug 9731
* | | Merge branch 'morestats4' into morestats5Karsten Loesing2013-10-28
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | Pass around const struct timeval * instead of struct timeval.Karsten Loesing2013-09-12
| | | | | | | | | | | | | | | | Suggested by nickm.
| * | | Test functions used for TB_EMPTY and CELL_STATS events.Karsten Loesing2013-05-31
| | | |
| * | | Tweak CIRC_BW event based on comments by nickm.Karsten Loesing2013-05-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Rename n_read and n_written in origin_circuit_t to make it clear that these are only used for CIRC_BW events. - Extract new code in control_update_global_event_mask to new clear_circ_bw_fields function.
| * | | Tweak TB_EMPTY event based on comments by nickm.Karsten Loesing2013-05-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Avoid control_event_refill_global function with 13 arguments and increase code reuse factor by moving more code from control.c to connection.c. - Avoid an unsafe uint32_t -> int cast. - Add TestingEnableTbEmptyEvent option. - Prepare functions for testing. - Rename a few functions and improve documentation.
| * | | Tweak CONN_BW event based on comments by nickm.Karsten Loesing2013-05-25
| | | | | | | | | | | | | | | | | | | | | | | | - Rename read/write counters in connection_t to make it clear that these are only used for CONN_BW events. - Add TestingEnableConnBwEvent option.
| * | | Add new CIRC_BW event.Karsten Loesing2013-05-16
| | | |
| * | | Add new TB_EMPTY event.Karsten Loesing2013-05-16
| | | | | | | | | | | | | | | | Jointly authored with Rob Jansen <jansen@cs.umn.edu>.
| * | | Add new CONN_BW event.Karsten Loesing2013-05-16
| | | | | | | | | | | | | | | | Jointly authored with Rob Jansen <jansen@cs.umn.edu>.
* | | | Log the origin address of controller connectionsNick Mathewson2013-10-25
| | | | | | | | | | | | | | | | Resolves 9698; patch from "sigpipe".
* | | | Merge remote-tracking branch 'public/bug9716_024'Nick Mathewson2013-09-19
|\ \ \ \ | | |_|/ | |/| |
| * | | Try using INT_MAX, not SOMAXCONN, to set listen() backlog.Nick Mathewson2013-09-11
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge branch 'bug5040_4773_rebase_3'Nick Mathewson2013-08-15
|\ \ \
| * | | Tests for connection_write_ext_or_command.Nick Mathewson2013-08-15
| | | |
| * | | Unit tests for ext_or_id_map.Nick Mathewson2013-08-15
| | | |
| * | | Make the Extended ORPort understand the TRANSPORT command.George Kadianakis2013-07-18
| | | |
| * | | More Extended ORPort code improvements.George Kadianakis2013-07-18
| | | | | | | | | | | | | | | | | | | | * Change name of init_ext_or_auth_cookie_authentication(). * Add a small comment.
| * | | Move Extended ORPort code to its own module.George Kadianakis2013-07-18
| | | | | | | | | | | | | | | | | | | | | | | | Move the code from the connection_or module to ext_orport. This commit only moves code: it shouldn't modify anything.
| * | | Various Extended ORPort code improvements.George Kadianakis2013-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add documentation. * Free ext_or_auth_correct_client_hash. * Use VPORT(ExtORPort) instead of V(ExtORPOrt). See dfe03d36c8749eb07e9bb2ea47e88ff05e9e3127 for details.
| * | | Prepare codebase for the implementation of Extended ORPort auth.George Kadianakis2013-07-18
| | | |
| * | | Create the Extended ORPort authentication cookie file.George Kadianakis2013-07-18
| | | |