aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection.c
AgeCommit message (Collapse)Author
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-06-04Resolve all currently pending DOCDOC items in masterNick Mathewson
2012-05-31Merge remote-tracking branch 'public/bug5374'Nick Mathewson
2012-05-30Merge branch 'bug5604'Nick Mathewson
2012-05-30Add a little documentation for the bug5604 fixNick Mathewson
2012-05-24Delay getsockname() call until after connect() is doneNick Mathewson
On Windows, getsockname() on a nonblocking apparently won't work until the connection is done connecting. On XP, it seems to fail by reporting success and declaring that your address is INADDR_ANY. On the Win8 preview, though, it fails more loudly and says WSAEINVAL. Fix for bug 5374; bugfix on 0.1.1.14-alpha.
2012-05-14MSVC build issue: it can't tell that tor_assert(0) aborts.Nick Mathewson
2012-04-24Merge remote-tracking branch 'public/bug5537'Nick Mathewson
2012-04-18If DisableNetwork, don't even try to open non-controller listenersNick Mathewson
Fix for 5604; bugfix on 0.2.3.9-alpha, which introduced DisableNetwork.
2012-04-11Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
2012-04-10Include a Host: header with any HTTP/1.1 proxy requestNick Mathewson
Bugfix on 0.2.2.1-alpha, which added the orginal HTTP proxy authentication code. Fix for bug 5593.
2012-03-30We allow IPv6 connections, don't use sockaddr_in with getsocknameNick Mathewson
This fixes client_check_address_changed to work better with IPv6 Tor clients, and prevents them from spewing errors. Fix for ticket 5537.
2012-03-28Fix a bunch of check-spaces complaintsSebastian Hahn
2012-03-26Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
Conflicts: src/or/control.c
2012-03-07Remove misleading function comment (bug 5324)Roger Dingledine
In the distant past, connection_handle_read() could be called when there are pending bytes in the TLS object during the main loop. The design since then has been to always read all pending bytes immediately, so read events only trigger when the socket actually has bytes to read. Resolves bug 5324.
2012-02-22Implement 'safe cookie authentication'Robert Ransom
2012-01-31Set IPV6_V6ONLY on listener sockets bound to IPv6 addresses.Nick Mathewson
If we don't do this, [::] can be interpreted to mean all v4 and all v6 addresses. Found by dcf. Fixes bug 4760. See RFC 3493 section 5.3 for more info.
2012-01-31Use the standard _WIN32, not the Torism MS_WINDOWS or deprecated WIN32Nick Mathewson
This commit is completely mechanical; I used this perl script to make it: #!/usr/bin/perl -w -i.bak -p if (/^\s*\#/) { s/MS_WINDOWS/_WIN32/g; s/\bWIN32\b/_WIN32/g; }
2012-01-23set SO_REUSEADDR before we bind, not afterRoger Dingledine
resolves bug 4950 (fixes a bug on commit aba7bb705a6 from #2850)
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;
2012-01-17Use SOCKET_OK macros in even more placesNick Mathewson
Add a TOR_INVALID_SOCKET macro to wrap -1/INVALID_SOCKET. Partial work for bug4533.
2012-01-03Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
2011-12-30Fix a check-spaces violation in compat.cSebastian Hahn
Also fix a comment typo
2011-12-30Fix spelling in a controlsocket log msgSebastian Hahn
Fixes bug 4803.
2011-12-22Merge remote-tracking branch 'public/bug4697'Nick Mathewson
2011-12-21Convert a couple of char[256]s into sockaddr_storageNick Mathewson
2011-12-21Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
2011-12-21Do not even try to keep going on a socket with socklen==0Nick Mathewson
Back in #1240, r1eo linked to information about how this could happen with older Linux kernels in response to nmap. Bugs #4545 and #4547 are about how our approach to trying to deal with this condition was broken and stupid. Thanks to wanoskarnet for reminding us about #1240. This is a fix for the abovementioned bugs, and is a bugfix on 0.1.0.3-rc.
2011-12-17Ignore all bufferevent events on a marked connectionNick Mathewson
Bug 4697; fix on 0.2.3.1-alpha
2011-12-02Resolve bug 3448: remove mention of tor-ops (which is not in use)Nick Mathewson
2011-11-30Use correct address family where necessary for bridges on IPv6.Linus Nordberg
2011-11-30Add some logging and comments.Linus Nordberg
2011-11-30Initial hacking for proposal 186.Nick Mathewson
This code handles the new ORPort options, and incidentally makes all remaining port types use the new port configuration systems. There are some rough edges! It doesn't do well in the case where your Address says one thing but you say to Advertise another ORPort. It doesn't handle AllAddrs. It doesn't actually advertise anything besides the first listed advertised IPv4 ORPort and DirPort. It doesn't do port forwarding to them either. It's not tested either, it needs more documentation, and it probably forgets to put the milk back in the refrigerator.
2011-11-29Fix some DOCDOCsNick Mathewson
2011-11-28New 'DisableNetwork' option to prevent Tor from using the networkNick Mathewson
Some controllers want this so they can mess with Tor's configuration for a while via the control port before actually letting Tor out of the house. We do this with a new DisableNetwork option, that prevents Tor from making any outbound connections or binding any non-control listeners. Additionally, it shuts down the same functionality as shuts down when we are hibernating, plus the code that launches directory downloads. To make sure I didn't miss anything, I added a clause straight to connection_connect, so that we won't even try to open an outbound socket when the network is disabled. In my testing, I made this an assert, but since I probably missed something, I've turned it into a BUG warning for testing.
2011-11-15Fix compile warnings on windowsSebastian Hahn
2011-10-26Fix memory leak in retry_all_listeners: Coverity CID 485Nick Mathewson
2011-10-11Fix names of functions that convert strings to addrsNick Mathewson
Now let's have "lookup" indicate that there can be a hostname resolution, and "parse" indicate that there wasn't. Previously, we had one "lookup" function that did resolution; four "parse" functions, half of which did resolution; and a "from_str()" function that didn't do resolution. That's confusing and error-prone! The code changes in this commit are exactly the result of this perl script, run under "perl -p -i.bak" : s/tor_addr_port_parse/tor_addr_port_lookup/g; s/parse_addr_port(?=[^_])/addr_port_lookup/g; s/tor_addr_from_str/tor_addr_parse/g; This patch leaves aton and pton alone: their naming convention and behavior is is determined by the sockets API. More renaming may be needed.
2011-10-10Cell types and states for new OR handshakeNick Mathewson
Also, define all commands > 128 as variable-length when using v3 or later link protocol. Running into a var cell with an unrecognized type is no longer a bug.
2011-10-07Merge remote-tracking branch 'asn2/bug3656'Nick Mathewson
Conflicts: src/common/util.c src/common/util.h src/or/config.h src/or/main.c src/test/test_util.c
2011-09-22Fix issues in 3630 patch noted by KarstenNick Mathewson
2011-09-22Make bufferevents work with TokenBucketRefillIntervalNick Mathewson
2011-09-22Refactor connection_bucket_refill(_helper) to avoid roundoffNick Mathewson
We were doing "divide bandwidth by 1000, then multiply by msec", but that would lose accuracy: instead of getting your full bandwidth, you'd lose up to 999 bytes per sec. (Not a big deal, but every byte helps.) Instead, do the multiply first, then the division. This can easily overflow a 32-bit value, so make sure to do it as a 64-bit operation.
2011-09-22New torrc option to allow bucket refill intervals of less than 1 secFlorian Tschorsch
Implements bug3630.
2011-09-15Log errno on listener socket creation failure.Nick Mathewson
This may help diagnose bug 4027.
2011-09-11Remove connection_uses_transport() since it was unused.George Kadianakis
2011-09-07Fix whitespace issues in patches merged today so farNick Mathewson
2011-09-07chown() sockets when User option is setJérémy Bobbio
Fixes bug 3421
2011-09-07Merge remote-tracking branch 'public/split_entry_conn'Nick Mathewson
Conflicts: src/or/connection.c src/or/connection_edge.c src/or/connection_edge.h src/or/dnsserv.c Some of these were a little tricky, since they touched code that changed because of the prop171 fixes.