aboutsummaryrefslogtreecommitdiff
path: root/src/or/cpuworker.c
Commit message (Collapse)AuthorAge
* Merge remote-tracking branch 'public/bug4345a_024'Nick Mathewson2014-05-01
|\
| * Check spawn_func() return valueNick Mathewson2014-01-17
| | | | | | | | | | | | | | | | If we don't, we can wind up with a wedged cpuworker, and write to it for ages and ages. Found by skruffy. This was a bug in 2dda97e8fd898757, a.k.a. svn revision 402. It's been there since we have been using cpuworkers.
* | scan-build: in cpuworker, initialize tv_startNick Mathewson2014-04-18
| | | | | | | | | | | | | | scan-build doesn't realize that a request can't be timed at the end unless it's timed at the start, and so it's not possible for us to be subtracting start from end without start being set. Nevertheless, let's not confuse it.
* | Renamed "onionskins_completed" to "onionskins_assigned"Nick Mathewson2014-03-27
|/ | | | This improves the accuracy of the function/variable names.
* collect and log statistics about onionskins received/processedRoger Dingledine2013-09-05
| | | | | | | we skip onionskins that came from non-relays, so we're less likely to run into privacy troubles. starts to implement ticket 9658.
* Check return values from fcntl and setsockoptNick Mathewson2013-03-18
| | | | (Based on a patch from flupzor; bug #8206)
* Fix 8447: use %u to format circid_t.Nick Mathewson2013-03-10
| | | | | | | | | Now that circid_t is 4 bytes long, the default integer promotions will leave it alone when sizeof(int) == 4, which will leave us formatting an unsigned as an int. That's technically undefined behavior. Fixes bug 8447 on bfffc1f0fc7616a25c32da2eb759dade4651659e. Bug not in any released Tor.
* Merge remote-tracking branch 'public/wide_circ_ids'Nick Mathewson2013-02-15
|\ | | | | | | | | | | | | Conflicts: src/or/channel.h src/or/connection_or.c src/or/cpuworker.c
| * Allow a v4 link protocol for 4-byte circuit IDs.Nick Mathewson2012-11-06
| | | | | | | | | | | | Implements proposal 214. Needs testing.
* | Fix a nigh-impossible overflow in cpuworker.cNick Mathewson2013-02-11
| | | | | | | | | | | | | | | | | | | | When we compute the estimated microseconds we need to handle our pending onionskins, we could (in principle) overflow a uint32_t if we ever had 4 million pending onionskins before we had any data about how onionskins take. Nevertheless, let's compute it properly. Fixes bug 8210; bugfix on 0.2.4.10. Found by coverity; this is CID 980651.
* | Fix numerous problems with Tor's weak RNG.Nick Mathewson2013-02-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need a weak RNG in a couple of places where the strong RNG is both needless and too slow. We had been using the weak RNG from our platform's libc implementation, but that was problematic (because many platforms have exceptionally horrible weak RNGs -- like, ones that only return values between 0 and SHORT_MAX) and because we were using it in a way that was wrong for LCG-based weak RNGs. (We were counting on the low bits of the LCG output to be as random as the high ones, which isn't true.) This patch adds a separate type for a weak RNG, adds an LCG implementation for it, and uses that exclusively where we had been using the platform weak RNG.
* | Merge branch 'time_based_onionqueue_v2' of ssh://git-rw.torproject.org/nickm/torAndrea Shepard2013-01-24
|\ \
| * | Better handling (I think) for onionskin timing w jumpy clocksNick Mathewson2013-01-03
| | | | | | | | | | | | | | | The fix: Instead of clipping huge/negative times, ignore them as probably invalid.
| * | Record and report the overhead of how we handle onionskins.Nick Mathewson2013-01-03
| | |
| * | Eliminate MaxOnionsPending; replace it with MaxOnionQueueDelayNick Mathewson2013-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The right way to set "MaxOnionsPending" was to adjust it until the processing delay was appropriate. So instead, let's measure how long it takes to process onionskins (sampling them once we have a big number), and then limit the queue based on its expected time to finish. This change is extra-necessary for ntor, since there is no longer a reasonable way to set MaxOnionsPending without knowing what mix of onionskins you'll get. This patch also reserves 1/3 of the onionskin spots for ntor handshakes, on the theory that TAP handshakes shouldn't be allowed to starve their speedier cousins. We can change this later if need be. Resolves 7291.
* | | Update the copyright date to 201.Nick Mathewson2013-01-16
|/ /
* | Complete all DOCDOC entries from the ntor branchNick Mathewson2013-01-03
| |
* | Use created_cell_format where appropriateNick Mathewson2013-01-03
| |
* | Teach cpuworker and others about create_cell_t and friendsNick Mathewson2013-01-03
| | | | | | | | | | | | | | | | | | | | | | The unit of work sent to a cpuworker is now a create_cell_t; its response is now a created_cell_t. Several of the things that call or get called by this chain of logic now take create_cell_t or created_cell_t too. Since all cpuworkers are forked or spawned by Tor, they don't need a stable wire protocol, so we can just send structs. This saves us some insanity, and helps p
* | Massive refactoring of the various handshake typesNick Mathewson2013-01-03
| | | | | | | | | | The three handshake types are now accessed from a unified interface; their state is abstracted from the rest of the cpath state, and so on.
* | Split onion.[ch] into onion{,_fast,_tap}.[ch]Nick Mathewson2013-01-02
|/ | | | | | | | | | I'm going to want a generic "onionskin" type and set of wrappers, and for that, it will be helpful to isolate the different circuit creation handshakes. Now the original handshake is in onion_tap.[ch], the CREATE_FAST handshake is in onion_fast.[ch], and onion.[ch] now handles the onion queue. This commit does nothing but move code and adjust header files.
* Use U64_FORMAT/U64_PRINTF_ARG rather than %lu for channel_tAndrea Shepard2012-10-08
|
* Use channel_t in cpuworker.cAndrea Shepard2012-10-08
| | | | | | | Note: this is a squashed commit; see branch bug6465_rebased_v2 of user/andrea/tor.git for full history of the following 2 commits: Use channel_t in cpuworker.c Fix bug in channel_t usage in cpuworker.c that was killing relaying on channel_t-ized Tor. The tags passed to the worker now have a channel ID, not a connection ID.
* Change all SMARTLIST_FOREACH loops of >=10 lines to use BEGIN/ENDNick Mathewson2012-07-17
| | | | | | | | | | | The SMARTLIST_FOREACH macro is more convenient than BEGIN/END when you have a nice short loop body, but using it for long bodies makes your preprocessor tell the compiler that all the code is on the same line. That causes grief, since compiler warnings and debugger lines will all refer to that one line. So, here's a new style rule: SMARTLIST_FOREACH blocks need to be short.
* Update copyright dates to 2012; add a few missing copyright statementsNick Mathewson2012-06-04
|
* Rename nonconformant identifiers.Nick Mathewson2012-01-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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;
* Use SOCKET_OK macros in even more placesNick Mathewson2012-01-17
| | | | | | Add a TOR_INVALID_SOCKET macro to wrap -1/INVALID_SOCKET. Partial work for bug4533.
* Init conn->addr to "unspec" on cpuworker connectionsNick Mathewson2011-12-02
| | | | Fixes bug 4532 reported by "troll_un"
* Merge branch 'maint-0.2.2'Roger Dingledine2011-11-21
|\ | | | | | | | | Conflicts: src/or/dirserv.c
| * Only call cull_wedged_cpuworkers once every 60 seconds.Nick Mathewson2011-11-19
| | | | | | | | | | | | | | | | | | The function is over 10 or 20% on some of Moritz's profiles, depending on how you could. Since it's checking for a multi-hour timeout, this is safe to do. Fixes bug 4518.
* | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-05-30
|\| | | | | | | | | | | Conflicts: src/common/compat.c src/or/main.c
| * Use a 64-bit type to hold sockets on win64.Nick Mathewson2011-05-23
| | | | | | | | | | | | | | | | | | | | | | | | | | On win64, sockets are of type UINT_PTR; on win32 they're u_int; elsewhere they're int. The correct windows way to check a socket for being set is to compare it with INVALID_SOCKET; elsewhere you see if it is negative. On Libevent 2, all callbacks take sockets as evutil_socket_t; we've been passing them int. This patch should fix compilation and correctness when built for 64-bit windows. Fixes bug 3270.
* | Merge remote branch 'origin/maint-0.2.2'Nick Mathewson2011-01-03
|\|
| * Merge remote branch 'sebastian/bug2314' into maint-0.2.2Nick Mathewson2011-01-03
| |\
| | * Fix compile wanrings revealed by gcc 4.5 on mingwSebastian Hahn2010-12-27
| | |
* | | Merge remote branch 'origin/maint-0.2.2'Nick Mathewson2011-01-03
|\| |
| * | Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson2011-01-03
| |\ \ | | |/ | |/| | | | | | | | | | Conflicts: src/common/test.h src/or/test.c
| | * Bump copyright statements to 2011Nick Mathewson2011-01-03
| | |
| * | Synx manpage and source wrt option capitalizationSebastian Hahn2010-11-10
| | | | | | | | | | | | | | | | | | We had a spelling discrepancy between the manpage and the source code for some option. Resolve these in favor of the manpage, because it makes more sense (for example, HTTP should be capitalized).
* | | Autodetect the number of CPUs when possible if NumCPUs==0Nick Mathewson2010-09-28
| | | | | | | | | | | | | | | | | | | | | This is needed for IOCP, since telling the IOCP backend about all your CPUs is a good idea. It'll also come in handy with asn's multithreaded crypto stuff, and for people who run servers without reading the manual.
* | | Fix more remaining users of inbuf/outbuf to handle bufferevents instead.Nick Mathewson2010-09-27
| | |
* | | Move the "stop writing when the buffer is empty" logic to ↵Nick Mathewson2010-09-27
| | | | | | | | | | | | cnnection_finished_flushing
* | | Refactor users of buf_datalen to bufferevent-friendly version.Nick Mathewson2010-09-27
|/ /
* | Fix misplaced labelsSebastian Hahn2010-08-16
| |
* | Create onion.hSebastian Hahn2010-07-27
| |
* | Create main.hSebastian Hahn2010-07-27
| |
* | Create control.hSebastian Hahn2010-07-27
| |
* | Create connection.hSebastian Hahn2010-07-27
| |
* | Create config.hSebastian Hahn2010-07-27
| |
* | Create circuitlist.hSebastian Hahn2010-07-27
| |