aboutsummaryrefslogtreecommitdiff
path: root/src/common
Commit message (Expand)AuthorAge
...
* | Refactor unit tests to use the tinytest framework.•••"Tinytest" is a minimalist C unit testing framework I wrote for Libevent. It supports some generally useful features, like being able to run separate unit tests in their own processes. I tried to do the refactoring to change test.c as little as possible. Thus, we mostly don't call the tinytest macros directly. Instead, the test.h header is now a wrapper on tinytest.h to make our existing test_foo() macros work. The next step(s) here will be: - To break test.c into separate files, each with its own test group. - To look into which things we can test - To refactor the more fiddly tests to use the tinytest macros directly and/or run forked. - To see about writing unit tests for things we couldn't previously test without forking. Nick Mathewson2009-09-23
* | Fix compile on Snow LeopardSebastian Hahn2009-09-20
* | Add a couple of time helper functions.•••Also add rounding support to tv_mdiff(). Mike Perry2009-09-20
* | Merge commit 'origin/maint-0.2.1'Nick Mathewson2009-09-17
|\|
| * Work around a memory leak in openssl 0.9.8g (and maybe others)Nick Mathewson2009-09-17
* | some cleanups:•••documentation fix for get_uint64 remove extra "." from a log line fix a long line Sebastian Hahn2009-09-15
* | Implement proposal 167: Authorities vote on network parameters.•••This code adds a new field to vote on: "params". It consists of a list of sorted key=int pairs. The output is computed as the median of all the integers for any key on which anybody voted. Improved with input from Roger. Nick Mathewson2009-09-14
* | Add a median_int32 and find_nth_int32Nick Mathewson2009-09-14
* | Fix compile warnings on Snow Leopard•••Big thanks to nickm and arma for helping me with this! Sebastian Hahn2009-09-01
* | Merge commit 'origin/maint-0.2.1'Nick Mathewson2009-09-01
|\|
| * Use an _actual_ fix for the byte-reverse warning.•••(Given that we're pretty much assuming that int is 32 bits, and given that hex values are always unsigned, taking out the "ul" from 0xff000000 should be fine.) Nick Mathewson2009-09-01
| * Use a simpler fix for the byte-reversing warningNick Mathewson2009-09-01
| * Fix compile warnings on Snow Leopard•••Big thanks to nickm and arma for helping me with this! Sebastian Hahn2009-09-01
* | typoSebastian Hahn2009-09-01
* | Revise parsing of time and memory units to handle spaces.•••When we added support for fractional units (like 1.5 MB) I broke support for giving units with no space (like 2MB). This patch should fix that. It also adds a propoer tor_parse_double(). Fix for bug 1076. Bugfix on 0.2.2.1-alpha. Nick Mathewson2009-08-31
* | Merge branch 'maint-0.2.1'Roger Dingledine2009-08-27
|\|
| * Fix a rare infinite-recursion bug when shutting down.•••Once we had called log_free_all(), anything that tried to log a message (like a failed tor_assert()) would fail like this: 1. The logging call eventually invokes the _log() function. 2. _log() calls tor_mutex_lock(log_mutex). 3. tor_mutex_lock(m) calls tor_assert(m). 4. Since we freed the log_mutex, tor_assert() fails, and tries to log its failure. 5. GOTO 1. Now we allocate the mutex statically, and never destroy it on shutdown. Bugfix on 0.2.0.16-alpha, which introduced the log mutex. This bug was found by Matt Edman. Nick Mathewson2009-08-20
* | Make crypto_digest_get_digest nondestructive again.•••Fixes bug in f57883a39. Nick Mathewson2009-08-20
* | Add a SHA256 implementation for platforms that lack it.•••(This would be everywhere running OpenSSL 0.9.7x and earlier, including all current Macintosh users.) The code is based on Tom St Denis's LibTomCrypt implementation, modified to be way less general and use Tor's existing facilities. I picked this one because it was pretty fast and pretty free, and because Python uses it too. Nick Mathewson2009-08-20
* | Add basic support for SHA256.•••This adds an openssl 0.9.8 dependency. Let's see if anybody cares. Nick Mathewson2009-08-19
* | Switch over to tor_strtok_r instead of strtok_r.Mike Perry2009-08-09
* | Add a new tor_strtok_r for platforms that don't have one, plus tests.•••I don't think we actually use (or plan to use) strtok_r in a reentrant way anywhere in our code, but would be nice not to have to think about whether we're doing it. Nick Mathewson2009-08-09
* | Fix dirreq and cell stats on 32-bit architectures.•••When determining how long directory requests take or how long cells spend in queues, we were comparing timestamps on microsecond detail only to convert results to second or millisecond detail later on. But on 32-bit architectures this means that 2^31 microseconds only cover time differences of up to 36 minutes. Instead, compare timestamps on millisecond detail. Karsten Loesing2009-07-27
* | Two tweaks to exit-port statistics.•••Add two functions for round_to_next_multiple_of() for uint32_t and uint64_t. Avoid division in every step of the loop over all ports. Karsten Loesing2009-07-13
* | Set EV_PERSIST flag on signal events with Libevent < 2.0.•••Fix for bug 1007. Nick Mathewson2009-06-18
* | Fix bug 1001•••For compatibility with Libevent2, tor_event_new should accept a NULL base without crashing. Sebastian Hahn2009-06-16
* | Whitespace and osx fixes on libevent2 patch.Nick Mathewson2009-06-12
* | Make Tor compile with Libevent 1.0 again.Nick Mathewson2009-06-12
* | Move the Libvent setup logic into compat_libevent from config.•••This has been some pretty ugly and voodoo-laden code. I've tried to clean it up a bit, but more work probably remains. Nick Mathewson2009-06-12
* | Update Tor to use Libevent 2.0 APIs when available.•••This patch adds a new compat_libevent.[ch] set of files, and moves our Libevent compatibility and utilitity functions there. We build them into a separate .a so that nothing else in src/commmon depends on Libevent (partially fixing bug 507). Also, do not use our own built-in evdns copy when we have Libevent 2.0, whose evdns is finally good enough (thus fixing Bug 920). Nick Mathewson2009-06-12
* | Merge commit 'origin/maint-0.2.1'Nick Mathewson2009-05-31
|\|
| * Don't attempt to log messages to a controller from a worker thread.•••This patch adds a function to determine whether we're in the main thread, and changes control_event_logmsg() to return immediately if we're in a subthread. This is necessary because otherwise we will call connection_write_to_buf, which modifies non-locked data structures. Bugfix on 0.2.0.x; fix for at least one of the things currently called "bug 977". Nick Mathewson2009-05-30
* | Merge branch 'hardware_accel_improvements'Nick Mathewson2009-05-31
|\ \
| * | Add support for dynamic OpenSSL hardware crypto acceleration engines.Martin Peck2009-05-23
* | | Merge commit 'origin/maint-0.2.1'Nick Mathewson2009-05-28
|\ \ \ | | |/ | |/|
| * | Fixes to spelling fixes. Thanks, Roger!Nick Mathewson2009-05-28
* | | Merge commit 'origin/maint-0.2.1'Nick Mathewson2009-05-27
|\| | | |/ |/|
| * Spell-check Tor.Nick Mathewson2009-05-27
| * Spelling fixes in comments and stringsNick Mathewson2009-05-27
* | Add a quick macro to calculate hashtable memory usageNick Mathewson2009-05-22
* | Merge branch 'maint-0.2.1' into merge_tmpNick Mathewson2009-05-17
|\|
| * Stop using malloc_usable_size(): valgrind hates it.Nick Mathewson2009-05-17
* | Merge commit 'origin/maint-0.2.1'Nick Mathewson2009-05-17
|\|
| * Fix an assertion-failure in memarea_alloc() on 64-bit platforms.•••The trick is that we should assert that our next_mem pointer has not run off the end of the array _before_ we realign the pointer, since doing that could take us over the end... but only if we're on a system where malloc() gives us ram in increments smaller than sizeof(void*). Nick Mathewson2009-05-17
* | Merge commit 'origin/maint-0.2.1'Nick Mathewson2009-05-13
|\|
| * Use a mutex to protect the count of open sockets.•••This matters because a cpuworker can close its socket when it finishes. Cpuworker typically runs in another thread, so without a lock here, we can have a race condition and get confused about how many sockets are open. Possible fix for bug 939. Nick Mathewson2009-05-13
| * Update copyright to 2009.Karsten Loesing2009-05-04
* | Add sentinel values to the end of memarea chunks.•••This might detect some possible causes of bug 930, and will at least make sure we aren't doing some dumb memory-corruption stuff with the heap and router-parsing. Nick Mathewson2009-05-12
* | Include the *_sha1.i files in their own *_codedigest.c files.•••This way we do not need to rebuild util.c and/or config.c whenever any unrelated source file in src/common or src/or has changed. Nick Mathewson2009-05-08
* | Add a missing newlineSebastian Hahn2009-05-05