summaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
AgeCommit message (Collapse)Author
2016-03-26Do not treat "DOCDOC" as doxygen.Nick Mathewson
2016-02-27Update the copyright year.Nick Mathewson
2016-01-27Correct further grammatical errors in tor commentsNick Mathewson
Avoid using a pronoun where it makes comments unclear. Avoid using gender for things that don't have it. Avoid assigning gender to people unnecessarily.
2015-12-17Another try at fixing 17752Nick Mathewson
I believe that the final SMARTLIST_DEL_CURRENT was sometimes double-removing items that had already been removed by connection_mark_unattached_ap or connection_ap_handshake_attach_circuit(). The fix here is to prevent iteration over the list that other functions might be modifying.
2015-12-16More emergency-check code for un-removed pending entry connsNick Mathewson
This might also be what #17752 needs.
2015-12-16Add an edge_about_to_close() call to ap_about_to_close().Nick Mathewson
Fixes #17876
2015-12-16Move pending-connection code into connection_ap_about_to_closeNick Mathewson
It is AP-specific, so that's where it belongs. This shouldn't have caused a bug, but due to #17876, we were never actually calling connection_edge_about_to_close from connection_ap_about_to_close, causing bug #17874 (aka bug #17752).
2015-12-16More debugging code to try to track down #17659Nick Mathewson
2015-12-16Add some assertions to try to catch #17752Nick Mathewson
2015-11-27More fixes/debugging attempts for 17659Nick Mathewson
2015-11-27Add a stack trace for help debugging one part of 17659Nick Mathewson
2015-11-27Check magic number in connection_ap_attach_pendingNick Mathewson
2015-11-26improve log messages to try to track down #17659Nick Mathewson
2015-11-20fix "make check-spaces"Nick Mathewson
2015-11-17Free pending_entry_connections on shutdown.Nick Mathewson
2015-11-17Be more conservative in scanning the list of pending streamsNick Mathewson
Now we only re-scan the list in the cases we did before: when we have a new circuit that we should try attaching to, or when we have added a new stream that we haven't tried to attach yet. This is part of 17590.
2015-11-17Decouple ..attach_circuit() from most of its callers.Nick Mathewson
Long ago we used to call connection_ap_handshake_attach_circuit() only in a few places, since connection_ap_attach_pending() attaches all the pending connections, and does so regularly. But this turned out to have a performance problem: it would introduce a delay to launching or connecting a stream. We couldn't just call connection_ap_attach_pending() every time we make a new connection, since it walks the whole connection list. So we started calling connection_ap_attach_pending all over, instead! But that's kind of ugly and messes up our callgraph. So instead, we now have connection_ap_attach_pending() use a list only of the pending connections, so we can call it much more frequently. We have a separate function to scan the whole connection array to see if we missed adding anything, and log a warning if so. Closes ticket #17590
2015-08-17Logs and debug info that I used for finding bug 16844Roger Dingledine
2015-05-20Add "HiddenServiceMaxStreams" as a per-HS tunable.Yawning Angel
When set, this limits the maximum number of simultaneous streams per rendezvous circuit on the server side of a HS, with further RELAY_BEGIN cells being silently ignored. This can be modified via "HiddenServiceMaxStreamsCloseCircuit", which if set will cause offending rendezvous circuits to be torn down instead. Addresses part of #16052.
2015-04-30Use descriptor ID when purging last hid fetch cacheDavid Goulet
Stop using an onion address since it's not indexed with that anymore in the last hid serv request cache. Instead use a base32 encoded descriptor ID contained in the rend_data_t object. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-30Use rend_data_client/service_create() in codeDavid Goulet
Every callsite that use to allocate a rend_data_t object now use the rend_data_client/service_create() function. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-15Merge remote-tracking branch 'dgoulet/bug14391_026_v2'Nick Mathewson
2015-03-04Merge remote-tracking branch 'public/bug15064_025' into maint-0.2.6Nick Mathewson
2015-03-04Make TransProxyType ipfw work correctlyNick Mathewson
Fixes bug 15064; bugfix on 0.2.5.4-alpha.
2015-03-04only declare rv when it is used in destination_from_socket. Fixes 15151Nick Mathewson
2015-02-19Check ENABLE_TOR2WEB_MODE before any tor2webmode codeNick Mathewson
2015-02-04Use getsockname, not getsockopt, on TPROXY socketsNick Mathewson
2015-01-28Support connection_exit_connect() to AF_UNIX socketsAndrea Shepard
2015-01-27Refactor rend_cache_lookup_entry() and how it's usedDavid Goulet
Here is why: 1) v0 descriptors are deprecated since 0.2.2.1 and not suppose to be alive in the network anymore. This function should only serve v2 version for now as the default. 2) It should return different error code depending on what's the actual error is. Right now, there is no distinction between a cache entry not found and an invalid query. 3) This function should NOT test if the intro points are usable or not. This adds some load on a function that should be "O(1)" and do one job. Furthermore, multiple callsites actually already test that doing twice the job... 4) While adding control event, it would be useful to be able to lookup a cache entry without having it checking the intro points. There are also places in the code that do want to lookup the cache entry without doing that. Fixes #14391 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-01-20Merge branch 'bug14084'Nick Mathewson
2015-01-19Some days I just can't C.Nick Mathewson
2015-01-19Make check-spaces happier.Nick Mathewson
2015-01-19Replace a 4 with a 6; fix a bug that nobody noticed :/Nick Mathewson
Fixes 14280 bugfix on 1053af0b9c4127873034a935ce33 in 0.2.4.7-alpha.
2015-01-19Merge branch 'bug7555_v2_squashed'Nick Mathewson
Conflicts: src/or/connection_edge.c
2015-01-19Add a bunch of new comments to explain connection_ap_rewrite{,_and_attach}Nick Mathewson
Also, do a little light refactoring to move some variable declarations around and make a few things const Also fix an obnoxious bug on checking for the DONE stream end reason. It's not a flag; it's a possible value or a variable that needs to be masked.
2015-01-18Fix memory leak in connection_ap_handshake_rewrite_and_attach()Nick Mathewson
Spotted by asn. #14259. Bugfix on 368eb6a97 in 0.2.0.1-alpha.
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-13Allow MapAddress and Automap to work togetherNick Mathewson
The trick here is to apply mapaddress first, and only then apply automapping. Otherwise, the automap checks don't get done. Fix for bug 7555; bugfix on all versions of Tor supporting both MapAddress and AutoMap.
2015-01-12Begin writing unit tests for rewrite codeNick Mathewson
2015-01-10document rewrite_result_t and export for testingNick Mathewson
2015-01-10Move stream-closing out of rewrite codeNick Mathewson
2015-01-10Split the rewrite part of rewrite-and-attachNick Mathewson
I'd also like to split out the part that sends early socks responses.
2015-01-03New option "HiddenServiceAllowUnknownPorts"Nick Mathewson
This allows hidden services to disable the anti-scanning feature introduced in 0.2.6.2-alpha. With this option not set, a connection to an unlisted port closes the circuit. With this option set, only a RELAY_DONE cell is sent. Closes ticket #14084.
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-12-30Merge remote-tracking branch 'dgoulet/bug13667_025_v4'Nick Mathewson
2014-12-29Fix: mitigate as much as we can HS port scanningDavid Goulet
Make hidden service port scanning harder by sending back REASON_DONE which does not disclose that it was in fact an exit policy issue. After that, kill the circuit immediately to avoid more bad requests on it. This means that everytime an hidden service exit policy does match, the user (malicious or not) needs to build a new circuit. Fixes #13667. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2014-12-23Fix compilation on platforms without IP6T_SO_ORIGINAL_DSTNick Mathewson
2014-12-23tweak whitespace; log bad socket family if bug occursNick Mathewson
2014-12-23Use the appropriate call to getsockopt for IPv6 socketsFrancisco Blas Izquierdo Riera (klondike)
The original call to getsockopt to know the original address on transparently proxyed sockets using REDIRECT in iptables failed with IPv6 addresses because it assumed all sockets used IPv4. This patch fixes this by using the appropriate options and adding the headers containing the needed definitions for these. This patch is released under the same license as the original file as long as the author iscredited. Signed-off-by: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org>
2014-12-21Fix clang warning, IPv6 address comment, buffer size typoteor
The address of an array in the middle of a structure will always be non-NULL. clang recognises this and complains. Disable the tautologous and redundant check to silence this warning. Fixes bug 14001.