summaryrefslogtreecommitdiff
path: root/src/or/connection.c
AgeCommit message (Collapse)Author
2015-06-04Set session_group after the port's data structure has been populated.Yawning Angel
Fixes #16247, patch by "jojelino".
2015-02-23Fix running with the seccomp2 sandboxNick Mathewson
We had a regression in 0.2.6.3-alpha when we stopped saying IPPROTO_TCP to socket(). Fixes bug 14989, bugfix on 0.2.6.3-alpha.
2015-02-06Fix check-spaces complaintsSebastian Hahn
2015-01-30Correctly handle OutboundBindAddress again.Nick Mathewson
ca5ba2956bcd4b5ee1e526ccf5914f52fe6e6d51 broke this; bug not in any released Tor. Also fix a typo. Fixes 14541 and 14527. Reported by qbi.
2015-01-29Restrict unix: addresses to control and socks for nowNick Mathewson
2015-01-29Remove SocksSocket; it's now spelled differently thanks to 14451Nick Mathewson
Also, revise bug12585 changes file to mention new syntax
2015-01-28Support connection_exit_connect() to AF_UNIX socketsAndrea Shepard
2015-01-21Merge branch 'better_workqueue_v3_squashed'Nick Mathewson
2015-01-16Merge branch 'bug8546_squashed'Nick Mathewson
Conflicts: src/or/connection.c src/or/or.h src/or/relay.c
2015-01-16Replace field-by-field copy with memcpy for entry_port_cfgNick Mathewson
2015-01-16Move entry_port_cfg_t fields in entry_connection_tNick Mathewson
Also rename some options for uniformity, and apply this script: @@ entry_connection_t *conn; @@ conn-> +entry_cfg. \( isolation_flags \| session_group \| socks_prefer_no_auth \| ipv4_traffic \| ipv6_traffic \| prefer_ipv6 \| cache_ipv4_answers \| cache_ipv6_answers \| use_cached_ipv4_answers \| use_cached_ipv6_answers \| prefer_ipv6_virtaddr \)
2015-01-16Combine entry_port_cfg_t fields in listener_connection_tNick Mathewson
Also, revise the code using these options with this cocci script: @@ listener_connection_t *conn; @@ conn-> +entry_cfg. \( isolation_flags \| session_group \| socks_prefer_no_auth \| ipv4_traffic \| ipv6_traffic \| prefer_ipv6 \| cache_ipv4_answers \| cache_ipv6_answers \| use_cached_ipv4_answers \| use_cached_ipv6_answers \| prefer_ipv6_virtaddr \)
2015-01-16Split client-specific and server-specific parts of port_cfg_tNick Mathewson
Also, apply this cocci script to transform accesses. (Plus manual migration for accesses inside smartlist_foreach loops.) @@ port_cfg_t *cfgx; @@ cfgx-> +server_cfg. \( no_advertise \| no_listen \| all_addrs \| bind_ipv4_only \| bind_ipv6_only \) @@ port_cfg_t *cfgx; @@ cfgx-> +entry_cfg. \( isolation_flags \| session_group \| socks_prefer_no_auth \| ipv4_traffic \| ipv6_traffic \| prefer_ipv6 \| cache_ipv4_answers \| cache_ipv6_answers \| use_cached_ipv4_answers \| use_cached_ipv6_answers \| prefer_ipv6_virtaddr \)
2015-01-14Refactor cpuworker to use workqueue/threadpool code.Nick Mathewson
2015-01-14Do not log a notice on every socks connectionNick Mathewson
2015-01-13Fix new unused variable warning in connection_listener_newNick Mathewson
2015-01-13Explicitly chmod AF_UNIX sockets to 0600 when *GroupWritable isn't specifiedAndrea Shepard
2015-01-13Remove no-longer-accurate comment from connection.cAndrea Shepard
2015-01-12Kill duplicated code in connection_listener_new()Andrea Shepard
2015-01-07Downgrade open/close log message for SocksSocketAndrea Shepard
2015-01-07Bring sanity to connection_listener_new()Andrea Shepard
2015-01-07Rename is_tcp in connection_listener_new(), since AF_UNIX means SOCK_STREAM ↵Andrea Shepard
no longer implies TCP
2015-01-07Refactor ↵Andrea Shepard
check_location_for_unix_socket()/check_location_for_socks_unix_socket() to eliminate duplicated code
2015-01-07Commit second draft of Jake's SOCKS5-over-AF_UNIX patch. See ticket #12585.Jacob Appelbaum
Signed-off-by: Andrea Shepard <andrea@torproject.org>
2015-01-07Merge remote-tracking branch 'public/bug12985_025'Nick Mathewson
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-12-21Merge branch 'ticket7356_squashed'Nick Mathewson
2014-12-21Using CHANNEL_FINISHED macro in connection.crl1987
2014-11-27Merge remote-tracking branch 'andrea/cmux_refactor_configurable_threshold'Nick Mathewson
Conflicts: src/or/or.h src/test/Makefile.nmake
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-10-28Updating message that warns about running out of sockets we can use.rl1987
2014-09-30Track total queue size per channel, with overhead estimates, and global ↵Andrea Shepard
queue total
2014-09-29Clear the cached address from resolve_my_address() when our IP changesNick Mathewson
Closes 11582; patch from "ra".
2014-09-10Merge remote-tracking branch 'yawning/bug_8402'Nick Mathewson
2014-09-02Merge remote-tracking branch 'origin/maint-0.2.5'Nick Mathewson
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-08-29Revert "restore the sensible part of ac268a83408e1450544db2f23f364dfa3"Nick Mathewson
This reverts commit b82e166bec5fcc468424af1ff71e2e753ac534a2. We don't need that part in 0.2.5, since 0.2.5 no longer supports non-multithreaded builds.
2014-08-29Merge remote-tracking branch 'public/bug12985_024' into bug12984_025Nick Mathewson
2014-08-29restore the sensible part of ac268a83408e1450544db2f23f364dfa3Nick Mathewson
We don't want to call event_del() postfork, if cpuworkers are multiprocess.
2014-08-29Always event_del() connection events before freeing themNick Mathewson
Previously, we had done this only in the connection_free() case, but when we called connection_free_() directly from connections_free_all(), we didn't free the connections.
2014-07-16Merge remote-tracking branch 'andrea/bug11302'Nick Mathewson
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-21Log the correct proxy type on failure.Yawning Angel
get_proxy_addrport fills in proxy_type with the correct value, so there is no point in logging something that's a "best guess" based off the config.
2014-05-21Remove get_bridge_pt_addrport().Yawning Angel
The code was not disambiguating ClientTransportPlugin configured and not used, and ClientTransportPlugin configured, but in a failed state. The right thing to do is to undo moving the get_transport_by_addrport() call back into get_proxy_addrport(), and remove and explicit check for using a Bridge since by the time the check is made, if a Bridge is being used, it is PT/proxy-less.
2014-05-21Allow ClientTransportPlugins to use proxiesYawning Angel
This change allows using Socks4Proxy, Socks5Proxy and HTTPSProxy with ClientTransportPlugins via the TOR_PT_PROXY extension to the pluggable transport specification. This fixes bug #8402.
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