summaryrefslogtreecommitdiff
path: root/src/or/relay.c
AgeCommit message (Collapse)Author
2012-10-08Convert relay.c/relay.h to channel_tAndrea Shepard
Note: this is a squashed commit; see branch bug6465_rebased_v2 of user/andrea/tor.git for full history of the following 10 commits: Convert relay.c/relay.h to channel_t Updating the timestamp if n_flushed > 0 at the end of channel_flush_from_first_active_circuit() was redundant since channel_write_cell() et al. do it themselves. Get rid of now-unnecessary time parameter in channel_flush_from_first_active_circuit() Get rid of now-unnecessary time parameter in channel_flush_from_first_active_circuit() in connection_or.c Add non-inlined external call for channeltls.c to free a packed_cell_t Appease make check-spaces in relay.c Replace channel_get_write_queue_len() with sufficient and easier to implement channel_has_queued_writes() in relay.c Rename channel_touched_by_client() and client_used field for consistency with other timestamps in relay.c Don't double-free packed cells in relay.c (channel_t Tor now bootstraps and works as a client) Rearrange channel_t struct to use a union distinguishing listener from cell-bearing channels in relay.c
2012-10-03pass the reason from the truncated cell to the controllerRoger Dingledine
(rather than just always declaring that the reason is END_CIRC_REASON_OR_CONN_CLOSED) resolves bug 7039.
2012-10-02more consistently use [gs]et_uint8Roger Dingledine
2012-09-12Merge remote-tracking branch 'origin/maint-0.2.3'Nick Mathewson
2012-09-12Merge remote-tracking branch 'public/bug6341_a_v2' into maint-0.2.3Nick Mathewson
2012-09-06Rename packed_cell_alloc() --> _new().Linus Nordberg
2012-08-27Fix whitespaceNick Mathewson
2012-08-15Check for stream_id, not conn, on extend cells.Nick Mathewson
Extend cells aren't allowed to have a stream_id, but we were only blocking them when they had a stream_id that corresponded to a connection. As far as I can tell, this change is harmless: it will make some kinds of broken clients not work any more, but afaik nobody actually make a client that was broken in that way. Found while hunting for other places where we made the same mistake as in 6271. Bugfix on d7f50337c14c back from May 2003, which introduced telescoping circuit construction into 0.0.2pre8.
2012-08-09Temporarily make spurious sendmes warn louder at arma's suggestion.Nick Mathewson
2012-07-18Check ewma_enabled before doing circ-has-become-inactive checkNick Mathewson
This avoids a possible crash bug in flush_from_first_active_circuit. Fixes bug 6341; bugfix on 0.2.2.7-alpha. Bug reported and fixed by a pseudonymous user on IRC.
2012-07-18Detect bug 6252 (unexpected sendme cell)Roger Dingledine
I only check on circuits, not streams, since bloating your stream window past the initial circuit window can't help you much. Also, I compare to CIRCWINDOW_START_MAX so we don't have surprising races if we lower CIRCWINDOW_START for an experiment.
2012-07-06Merge remote-tracking branch 'nickm/bug6271_part_a' into maint-0.2.3Roger Dingledine
2012-07-06Fix a bug handling SENDME cells on nonexistent streams.Nick Mathewson
This could result in bizarre window values. Report and patch contributed pseudymously. Fixes part of bug 6271. This bug was introduced before the first Tor release, in svn commit r152. (bug 6271, part a.)
2012-07-01Revert "Detect bug 6252 (unexpected sendme cell)"Roger Dingledine
This reverts commit c32ec9c425e9539bcc8ede95612e2d331c2cc2dd. It turns out the two sides of the circuit don't actually stay in sync, so it is perfectly normal for the circuit window on the exit relay to grow to 2000+. We should fix that bug and then reconsider this patch.
2012-07-01Detect bug 6252 (unexpected sendme cell)Roger Dingledine
I only check on circuits, not streams, since bloating your stream window past the initial circuit window can't help you much. Also, I compare to CIRCWINDOW_START_MAX so we don't have surprising races if we lower CIRCWINDOW_START for an experiment.
2012-06-15Move tor_gettimeofday_cached() into compat_libeventNick Mathewson
2012-06-15Triage the XXX023 and XXX022 comments: postpone many.Nick Mathewson
2012-06-13Merge remote-tracking branch 'public/bug3940_redux'Nick Mathewson
2012-06-05Resolve about 24 DOCDOCsNick Mathewson
2012-06-04Update copyright dates to 2012; add a few missing copyright statementsNick Mathewson
2012-06-04Add about 60 more DOCDOC comments to 0.2.3Nick Mathewson
Also, try to resolve some doxygen issues. First, define a magic "This is doxygen!" macro so that we take the correct branch in various #if/#else/#endifs in order to get the right documentation. Second, add in a few grouping @{ and @} entries in order to get some variables and fields to get grouped together.
2012-05-31Merge remote-tracking branch 'public/bug5541_v2'Nick Mathewson
2012-05-15Prevent an (impossible) null-pointer dereference in ↵Nick Mathewson
connection_edge_process_relay_cell This would happen if the deliver window could become negative because of an nonexistent connection. (Fortunately, _that_ can't occur, thanks to circuit_consider_sending_sendme. Still, if we change our windowing logic at all, we won't want this to become triggerable.) Fix for bug 5541. Bugfix on 4a66865d, back from 0.0.2pre14. asn found this. Nice catch, asn!
2012-05-11An attempt at bug3940 and making AllowDotExit 0 work with MapAddressNick Mathewson
This time, I follow grarpamp's suggestion and move the check for .exit+AllowDotExit 0 to the top of connection_ap_rewrite_and_attach, before any rewriting occurs. This way, .exit addresses are forbidden as they arrive from a socks connection or a DNSPort request, and not otherwise. It _is_ a little more complicated than that, though. We need to treat any .exit addresses whose source is TrackHostExits as meaning that we can retry without that exit. We also need to treat any .exit address that comes from an AutomapHostsOnResolve operation as user-provided (and thus forbidden if AllowDotExits==0), so that transitioning from AllowDotExits==1 to AllowDotExits==0 will actually turn off automapped .exit addresses.
2012-01-18Rename nonconformant identifiers.Nick Mathewson
Fixes bug 4893. These changes are pure mechanical, and were generated with this perl script: /usr/bin/perl -w -i.bak -p s/crypto_pk_env_t/crypto_pk_t/g; s/crypto_dh_env_t/crypto_dh_t/g; s/crypto_cipher_env_t/crypto_cipher_t/g; s/crypto_digest_env_t/crypto_digest_t/g; s/aes_free_cipher/aes_cipher_free/g; s/crypto_free_cipher_env/crypto_cipher_free/g; s/crypto_free_digest_env/crypto_digest_free/g; s/crypto_free_pk_env/crypto_pk_free/g; s/_crypto_dh_env_get_dh/_crypto_dh_get_dh/g; s/_crypto_new_pk_env_rsa/_crypto_new_pk_from_rsa/g; s/_crypto_pk_env_get_evp_pkey/_crypto_pk_get_evp_pkey/g; s/_crypto_pk_env_get_rsa/_crypto_pk_get_rsa/g; s/crypto_new_cipher_env/crypto_cipher_new/g; s/crypto_new_digest_env/crypto_digest_new/g; s/crypto_new_digest256_env/crypto_digest256_new/g; s/crypto_new_pk_env/crypto_pk_new/g; s/crypto_create_crypto_env/crypto_cipher_new/g; s/connection_create_listener/connection_listener_new/g; s/smartlist_create/smartlist_new/g; s/transport_create/transport_new/g;
2011-12-28Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
2011-12-28Merge remote-tracking branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson
2011-12-28Bug 4786 fix: don't convert EARLY to RELAY on v1 connectionsNick Mathewson
We used to do this as a workaround for older Tors, but now it's never the correct thing to do (especially since anything that didn't understand RELAY_EARLY is now deprecated hard).
2011-12-26Downgrade relay_early-related warningNick Mathewson
2011-12-22Allow prop110 violations if AllowNonearlyExtend is set in consensusNick Mathewson
2011-12-22Log what fraction of EXTEND cells have died for being non-earlyNick Mathewson
2011-12-22Implement the last of proposal 110Nick Mathewson
Reject all EXTEND requests not received in a relay_early cell
2011-11-29Add an assert before dereferencing entry_conn->socks_requestRobert Ransom
This may turn a segfault which katmagic saw into an assertion failure.
2011-11-11All-in-one benchmark test for cell cryptoNick Mathewson
2011-09-09Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
Conflicts: configure.in src/or/circuitbuild.c
2011-09-07Fix whitespace issues in patches merged today so farNick Mathewson
2011-08-30Use %f with printf-style formatting, not %lfNick Mathewson
For printf, %f and %lf are synonymous, since floats are promoted to doubles when passed as varargs. It's only for scanf that we need to say "%lf" for doubles and "%f" for floats. Apparenly, some older compilers think it's naughty to say %lf and like to spew warnings about it. Found by grarpamp.
2011-07-21Move entry-only fields from edge_connection_t to entry_connection_tNick Mathewson
Also, refactor the code accordingly.
2011-07-18Remember optimistically sent data until we have gotten a CONNECTEDNick Mathewson
Since we can retry failed streams under some circumstances, we need to be ready to send data queued on them.
2011-07-01Don't shadow parameters with local variablesNick Mathewson
This is a little error-prone when the local has a different type from the parameter, and is very error-prone with both have the same type. Let's not do this. Fixes CID #437,438,439,440,441.
2011-06-14Make the get_options() return constNick Mathewson
This lets us make a lot of other stuff const, allows the compiler to generate (slightly) better code, and will make me get slightly fewer patches from folks who stick mutable stuff into or_options_t. const: because not every input is an output!
2011-05-30Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
The conflicts were mainly caused by the routerinfo->node transition. Conflicts: src/or/circuitbuild.c src/or/command.c src/or/connection_edge.c src/or/directory.c src/or/dirserv.c src/or/relay.c src/or/rendservice.c src/or/routerlist.c
2011-05-15Log descriptions of nodes, not just nicknames.Nick Mathewson
This patch introduces a few new functions in router.c to produce a more helpful description of a node than its nickame, and then tweaks nearly all log messages taking a nickname as an argument to call these functions instead. There are a few cases where I left the old log messages alone: in these cases, the nickname was that of an authority (whose nicknames are useful and unique), or the message already included an identity and/or an address. I might have missed a couple more too. This is a fix for bug 3045.
2011-05-11Merge remote-tracking branch 'public/bug3122_memcmp_022' into bug3122_memcmp_023Nick Mathewson
Conflicts in various places, mainly node-related. Resolved them in favor of HEAD, with copying of tor_mem* operations from bug3122_memcmp_022. src/common/Makefile.am src/or/circuitlist.c src/or/connection_edge.c src/or/directory.c src/or/microdesc.c src/or/networkstatus.c src/or/router.c src/or/routerlist.c src/test/test_util.c
2011-05-11Merge remote-tracking branch 'public/3122_memcmp_squashed' into ↵Nick Mathewson
bug3122_memcmp_022 Conflicts throughout. All resolved in favor of taking HEAD and adding tor_mem* or fast_mem* ops as appropriate. src/common/Makefile.am src/or/circuitbuild.c src/or/directory.c src/or/dirserv.c src/or/dirvote.c src/or/networkstatus.c src/or/rendclient.c src/or/rendservice.c src/or/router.c src/or/routerlist.c src/or/routerparse.c src/or/test.c
2011-05-11Hand-conversion and audit phase of memcmp transitionNick Mathewson
Here I looked at the results of the automated conversion and cleaned them up as follows: If there was a tor_memcmp or tor_memeq that was in fact "safe"[*] I changed it to a fast_memcmp or fast_memeq. Otherwise if there was a tor_memcmp that could turn into a tor_memneq or tor_memeq, I converted it. This wants close attention. [*] I'm erring on the side of caution here, and leaving some things as tor_memcmp that could in my opinion use the data-dependent fast_memcmp variant.
2011-05-11Automated conversion of memcmp to tor_memcmp/tor_mem[n]eqNick Mathewson
This commit is _exactly_ the result of perl -i -pe 's/\bmemcmp\(/tor_memcmp\(/g' src/*/*.[ch] perl -i -pe 's/\!\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch] perl -i -pe 's/0\s*==\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch] perl -i -pe 's/0\s*!=\s*tor_memcmp\(/tor_memneq\(/g' src/*/*.[ch] git checkout src/common/di_ops.[ch] git checkout src/or/test.c git checkout src/common/test.h
2011-04-07Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
Conflicts: src/common/address.c src/common/compat_libevent.c src/common/memarea.c src/common/util.h src/or/buffers.c src/or/circuitbuild.c src/or/circuituse.c src/or/connection.c src/or/directory.c src/or/networkstatus.c src/or/or.h src/or/routerlist.c
2011-03-25Add XXX023s for our timestamp_dirty abuse.Nick Mathewson
2011-03-16Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson