summaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)Author
2013-06-18Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4Nick Mathewson
Conflicts: src/or/config.c src/or/relay.c
2013-06-18Implement a real OOM-killer for too-long circuit queues.Nick Mathewson
This implements "algorithm 1" from my discussion of bug #9072: on OOM, find the circuits with the longest queues, and kill them. It's also a fix for #9063 -- without the side-effects of bug #9072. The memory bounds aren't perfect here, and you need to be sure to allow some slack for the rest of Tor's usage. This isn't a perfect fix; the rest of the solutions I describe on codeable.
2013-06-13Define SEEK_SET for platforms that lack it.Nick Mathewson
2013-06-13If we write the annotation but not the microdescriptor, rewind.Nick Mathewson
This fixes bug 9047 (and some parts of 9031, 8922, 8883 that weren't fixed in 8822). Bugfix on 0.2.2.6-alpha.
2013-06-12Revert "Use the FILE_SHARE_DELETE flag for CreateFile on a mapping"Nick Mathewson
This reverts commit 884a0e269c382f9e927d8c8b1ef4ef9d2d48379d. I'm reverting this because it doesn't actually make the problem go away. It appears that instead we need to do unmap-then-replace.
2013-06-12Merge remote-tracking branch 'public/bug2077_share_delete' into maint-0.2.4Nick Mathewson
2013-06-12Use the FILE_SHARE_DELETE flag for CreateFile on a mappingNick Mathewson
A comment by rransom on #8795 taken together with a comment by doorss recorded on #2077 suggest that *every* attempt to replace the md cache will fail on Vista/Win7 if we don't have the FILE_SHARE_DELETE flag passed to CreateFile, and if we try to replace the file ourselves before unmapping it. I'm adding the FILE_SHARE_DELETE, since that's this simplest fix. Broken indexers (the favored #2077 hypothesis) could still cause trouble here, but at least this patch should make us stop stepping on our own feet. Likely fix for #2077 and its numerous duplicates. Bugfix on 0.2.2.6-alpha, which first had a microdescriptor cache that would get replaced before remapping it.
2013-04-18Remove a double-newlineNick Mathewson
2013-04-18Merge branch 'less_charbuf_rebased' into maint-0.2.4Nick Mathewson
Conflicts: src/or/dirserv.c src/or/dirserv.h src/test/test_dir.c
2013-04-18Fix a couple of documentation issues.Nick Mathewson
2013-04-18Refactor dirobj signature generationNick Mathewson
Now we can compute the hash and signature of a dirobj before concatenating the smartlist, and we don't need to play silly games with sigbuf and realloc any more.
2013-04-17Merge branch 'bug8037_squashed' into maint-0.2.4Nick Mathewson
2013-04-02Merge remote-tracking branch 'public/bug7707_diagnostic' into maint-0.2.4Nick Mathewson
2013-03-23Avoid clang warnings from implicit off_t->size_t castNick Mathewson
2013-03-19Merge branch 'bug8240_v2_squashed' into maint-0.2.4Nick Mathewson
Conflicts: doc/tor.1.txt src/or/circuitbuild.c src/or/config.c src/or/or.h
2013-03-19Make the guard lifetime configurable and adjustable via the consensusNick Mathewson
Fixes 8240. (Don't actually increase the default guard lifetime. It seems likely to break too many things if done precipitiously.)
2013-03-19Merge remote-tracking branch 'public/bug7950' into maint-0.2.4Nick Mathewson
2013-03-19Merge remote-tracking branch 'public/bug8002' into maint-0.2.4Nick Mathewson
2013-03-18Fix another case of bug 8206; patch from flupzorNick Mathewson
2013-03-18Merge remote-tracking branch 'public/bug6673' into maint-0.2.4Nick Mathewson
2013-03-18Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4Nick Mathewson
Conflicts: src/test/test_addr.c
2013-03-18Check return values from fcntl and setsockoptNick Mathewson
(Based on a patch from flupzor; bug #8206)
2013-03-15Merge remote-tracking branch 'public/unused_stuff' into maint-0.2.4Nick Mathewson
2013-03-11Track TLS overhead: diagnostic for bug 7707Nick Mathewson
2013-03-11Give an #error when we want threads and OpenSSL has disabled threadsNick Mathewson
Fixes ticket 6673.
2013-03-10start part-way through the ssl cert lifetimeRoger Dingledine
also, snap the start time and end time to a day boundary, since most certs in the wild seem to do this.
2013-03-01Make sure that [::1] is recognized as a private addressNick Mathewson
Fixes bug 8377; bugfix on 0.2.1.3-alpha.
2013-02-23Remove some functions which were unused except for their testsNick Mathewson
2013-02-23Remove some totally unused functionsNick Mathewson
2013-02-23Remove a bunch of unused macro definitionsNick Mathewson
2013-02-19Make a parse_config_line_from_str variant that gives error messagesNick Mathewson
Without this patch, there's no way to know what went wrong when we fail to parse a torrc line entirely (that is, we can't turn it into a K,V pair.) This patch introduces a new function that yields an error message on failure, so we can at least tell the user what to look for in their nonfunctional torrc. (Actually, it's the same function as before with a new name: parse_config_line_from_str is now a wrapper macro that the unit tests use.) Fixes bug 7950; fix on 0.2.0.16-alpha (58de695f9062576f) which first introduced the possibility of a torrc value not parsing correctly.
2013-02-19Check for CPUs more accurartely when ONLN != CONF.Nick Mathewson
There are two ways to use sysconf to ask about the number of CPUs. When we're on a VM, we would sometimes get it wrong by asking for the number of total CPUs (say, 64) when we should have been asking for the number of CPUs online (say, 1 or 2). Fix for bug 8002.
2013-02-11Make _SC_OPEN_MAX actually get used when closing fds before exec.Nick Mathewson
Fixes bug 8209; bugfix on 0.2.3.1-alpha.
2013-02-11Merge remote-tracking branch 'public/bug7801_v2'Nick Mathewson
2013-02-08Improve comment at Andrea's requestNick Mathewson
2013-02-08Merge remote-tracking branch 'public/signof_enum'Nick Mathewson
2013-02-08Fix numerous problems with Tor's weak RNG.Nick Mathewson
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.
2013-02-07Merge remote-tracking branch 'public/easy_ratelim'Nick Mathewson
Conflicts: src/or/connection.c
2013-02-07Have autoconf check whether enums are signed.Nick Mathewson
Fixes bug 7727; fix on 0.2.4.10-alpha.
2013-02-07Merge remote-tracking branch 'public/bug7816_023'Nick Mathewson
Conflicts: src/common/util.c
2013-02-07Tolerate curve25519 backends where the high bit of the pk isn't ignoredNick Mathewson
Right now, all our curve25519 backends ignore the high bit of the public key. But possibly, others could treat the high bit of the public key as encoding out-of-bounds values, or as something to be preserved. This could be used to distinguish clients with different backends, at the cost of killing a circuit. As a workaround, let's just clear the high bit of each public key indiscriminately before we use it. Fix for bug 8121, reported by rransom. Bugfix on 0.2.4.8-alpha.
2013-02-04Fix compilation with --disable-curve25519 optionNick Mathewson
The fix is to move the two functions to format/parse base64 curve25519 public keys into a new "crypto_format.c" file. I could have put them in crypto.c, but that's a big file worth splitting anyway. Fixes bug 8153; bugfix on 0.2.4.8-alpha where I did the fix for 7869.
2013-02-01fix wide lines from tor_log renameNick Mathewson
2013-02-01Fix a silly mistake in the tor_mathlog() documentation. Give it a unit test.Nick Mathewson
2013-02-01Remove old wrapper code and defines for keeping log() and log(3) apartNick Mathewson
This is the non-automated portion of bug 7599.
2013-02-01Rename log() to tor_log() for loggingNick Mathewson
This is meant to avoid conflict with the built-in log() function in math.h. It resolves ticket 7599. First reported by dhill. This was generated with the following perl script: #!/usr/bin/perl -w -i -p s/\blog\(LOG_(ERR|WARN|NOTICE|INFO|DEBUG)\s*,\s*/log_\L$1\(/g; s/\blog\(/tor_log\(/g;
2013-01-31typo in crypto_curve25519.c comment, spotted by rransomNick Mathewson
2013-01-31whitespace fixNick Mathewson
2013-01-29Detect platforms where memset(0) doesn't set doubles to 0.0.Nick Mathewson
This is allowed by the C statndard, which permits you to represent doubles any way you like, but in practice we have some code that assumes that memset() clears doubles in structs. Noticed as part of 7802 review; see 8081 for more info.
2013-01-26Correctly copy microdescs/extrinfos with internal NUL bytesNick Mathewson
Fixes bug 8037; bugfix on 0.2.0.1-alpha; reported by cypherpunks.