summaryrefslogtreecommitdiff
path: root/src/common/util.c
AgeCommit message (Collapse)Author
2007-09-24 r15320@catbus: nickm | 2007-09-24 11:49:09 -0400Nick Mathewson
Backport r11332: fix a user-triggerable segfault in expand_filename("~"). svn:r11608
2007-05-24 r12912@catbus: nickm | 2007-05-24 11:48:49 -0400Nick Mathewson
Backport minimal parts of r10192 (fix bugs found by Benedikt) and r10248 (handle lack of nul at end of mmap). svn:r10301
2007-02-28 r12001@catbus: nickm | 2007-02-28 15:24:12 -0500Nick Mathewson
Try to build without warnings on mingw with verbose warnings on. First attempt. svn:r9688
2007-02-28 r11992@catbus: nickm | 2007-02-28 12:46:32 -0500Nick Mathewson
compile fix on mingw: mingw does not define _MSC_VER. svn:r9682
2007-02-24doc pedantRoger Dingledine
svn:r9634
2007-02-16 r11832@catbus: nickm | 2007-02-16 15:31:59 -0500Nick Mathewson
Fix 35 remaining DOCDOC comments. Yowza. svn:r9596
2007-02-12 r11775@catbus: nickm | 2007-02-12 16:39:09 -0500Nick Mathewson
Update copyright dates. svn:r9570
2007-02-12 r11774@catbus: nickm | 2007-02-12 16:31:47 -0500Nick Mathewson
Handle errors on opening cached-routers* more uniformly and sanely: log not-found errors at level INFO, and all other errors at level WARN. Needs testing on win32. svn:r9569
2007-02-05 r11639@catbus: nickm | 2007-02-05 13:33:38 -0500Nick Mathewson
Add documentation to src/common/*.h; improve documentation for SMARTLIST_FOREACH; remove never-used options and corresponding tests from tor_strpartition. svn:r9483
2007-02-02 r11629@catbus: nickm | 2007-02-02 15:06:17 -0500Nick Mathewson
Removing the last DOCDOC comment hurt so much that I had to use Doxygen to identify undocumented macros and comments, and add 150 more DOCDOCs to point out where they were. Oops. Hey, kids! Fixing some of these could be your first Tor patch! svn:r9477
2007-02-01 r11620@catbus: nickm | 2007-02-01 13:06:27 -0500Nick Mathewson
Call stat() slightly less often; use fstat() when possible. svn:r9472
2007-01-19 r11987@Kushana: nickm | 2007-01-19 14:57:28 -0500Nick Mathewson
Implement SOCKS_BAD_HOSTNAME status event. Defer remaining status events. Clean up control-spec.txt a little, and fill in recommendations for events. svn:r9374
2007-01-18 r9776@totoro: nickm | 2007-01-18 14:37:01 -0500Nick Mathewson
Yes, apparently saying strcpy in front of openbsd is like saying "intellectual property" in front of RMS. They both have a point, I guess, even though they extend it to contexts where it is completely irrelevant. svn:r9370
2007-01-15 r11978@Kushana: nickm | 2007-01-15 18:54:25 -0500Nick Mathewson
Apparently, the OpenBSD linker thinks it knows C better than I do, and gets to call me names for having strcat and strcpy and sprintf in my code--whether I use them safely or not. All right, OpenBSD. You win... this round. svn:r9360
2006-12-29 r11749@Kushana: nickm | 2006-12-29 00:51:42 -0500Nick Mathewson
Remove dead code; make targets of addressmap commands/configs use AllowNonRFC953Hostnames svn:r9211
2006-12-21 r11670@Kushana: nickm | 2006-12-21 12:23:55 -0500Nick Mathewson
Clean up logic in parse_port_range(); accept 0 on low end and 65536 on high end for people who are bad at math. svn:r9169
2006-12-21 r11668@Kushana: nickm | 2006-12-20 22:22:53 -0500Nick Mathewson
Fix bug found by Keith Skinner: Treat malformed max-ports in address ranges as an error, and dont ignore errors with min-ports even if a max-port is present. svn:r9168
2006-12-15 r11597@Kushana: nickm | 2006-12-15 15:49:27 -0500Nick Mathewson
Add a rudimentary line-wrapping function for use in dumping comments in config files. svn:r9132
2006-12-15 r11581@Kushana: nickm | 2006-12-15 00:12:24 -0500Nick Mathewson
Make PIDFile work on windows. Reported by Arrakis. svn:r9116
2006-11-14 r9315@totoro: nickm | 2006-11-13 22:40:59 -0500Nick Mathewson
Fix a build warning on angela-sid svn:r8949
2006-11-14 r9313@totoro: nickm | 2006-11-13 20:07:41 -0500Nick Mathewson
Try to compile with fewer warnings on irix64's MIPSpro compiler / environment, which apparently believes that: - off_t can be bigger than size_t. - only mean kids assign things they do not subsequently inspect. I don't try to fix the "error" that makes it say: cc-3970 cc: WARNING File = main.c, Line = 1277 conversion from pointer to same-sized integral type (potential portability problem) uintptr_t sig = (uintptr_t)arg; Because really, what can you do about a compiler that claims to be c99 but doesn't understand that void* x = NULL; uintptr_t y = (uintptr_t) x; is safe? svn:r8948
2006-10-19 r9274@Kushana: nickm | 2006-10-19 16:16:58 -0400Nick Mathewson
Add unit tests for tor_mmap_file(); make tor_mmap_t.size always be the size of the file (not the size of the mapping); add an extra argument to read_file_to_str() so it can return the size of the result string. svn:r8762
2006-10-08Add missing return so this builds on mingw.Andrew Lewman
svn:r8649
2006-10-07 r8923@totoro: nickm | 2006-10-07 11:44:33 -0400tor-0.1.2.2-alphaNick Mathewson
More doxygen comments svn:r8637
2006-10-07more minor cleanupsRoger Dingledine
svn:r8630
2006-10-02 r8851@totoro: nickm | 2006-10-02 18:13:27 -0400Nick Mathewson
Remove/clarify some XXXs for no longer being accurate; for begin things we do not indend to fix; for already being parts of big todo issues (like "/* XXX ipv6 */"); etc. Also fix some spaces. svn:r8580
2006-10-02 r8846@totoro: nickm | 2006-10-02 16:59:57 -0400Nick Mathewson
Move is_local_IP to config.c; have it check for same-/24; make it used only for reachability (not for banwidth, because that is probably not what we want). Fixes an XXX. svn:r8578
2006-10-02 r8845@totoro: nickm | 2006-10-02 16:34:58 -0400Nick Mathewson
Fix an XXXX: make path_is_relative work on windows even though we never use it there. svn:r8577
2006-09-29 r9025@Kushana: nickm | 2006-09-29 18:33:13 -0400Nick Mathewson
Differentiate more duplicated log entries svn:r8542
2006-09-29 r9023@Kushana: nickm | 2006-09-29 17:27:24 -0400Nick Mathewson
Make distinct all non-bug messages at notice or higher that appear 3 or more times. svn:r8541
2006-09-29 r9008@Kushana: nickm | 2006-09-29 13:50:10 -0400Nick Mathewson
Doxygen comments for code in common. Also simplify a few code paths to be more clear/speedy/correct. svn:r8536
2006-09-28 r8974@Kushana: nickm | 2006-09-28 17:05:59 -0400Nick Mathewson
Improvement to last entry guards patch: track when we last attempted to connect to a node in our state file along with how long it has been unreachable. Also clarify behavior of parse_iso_time() when it gets extra characters. svn:r8520
2006-09-21 r8878@Kushana: nickm | 2006-09-21 17:15:47 -0400Nick Mathewson
Trivial whitespace cleanups. svn:r8443
2006-09-19Speed up eat_whitespace by a lot.Nick Mathewson
svn:r8434
2006-09-19NEEDS REVIEW. Act on previous comment, and handle named servers differently: ↵Nick Mathewson
now, we allow multiple servers with the same name in the routerlist even if that name is reserved, but we check whether names are reserved when we try to look up routers by nickname. This is a minor security fix. This makes router_add_to_routerlist O(1). This is a backport candidate. svn:r8433
2006-09-19Malloc and friends are critical-path: Thus, add an it-wont-happen branch ↵Nick Mathewson
prediction for NULL returns, and skip the malloc(0) check on platforms where malloc(0) returns a pointer. svn:r8431
2006-09-19Switch routerlist.c to using memcmp on digests rather than ↵Nick Mathewson
crypto_pk_cmp_keys(); speed up find_whitespace a lot (8x for me) by using a switch statement. This should speed parsing a lot of routers at once by a lot. svn:r8430
2006-09-19Merge in some bsockets calls, all wrapped inside #if defined(USE_BSOCKETS)Nick Mathewson
svn:r8427
2006-09-09parameterize the loudness of get_interface_address()Roger Dingledine
svn:r8358
2006-09-09fix typo, add log messageRoger Dingledine
svn:r8357
2006-08-31 r8692@Kushana: nickm | 2006-08-31 13:38:07 -0400Nick Mathewson
Fix bug 327 (part 2): Cast char to unsigned char before passing to toupper/tolower. (Follow the same idiom as with isupper and friends, in case we run into the same problem on SGI or whereever it was.) svn:r8310
2006-07-31 r6993@Kushana: nickm | 2006-07-31 16:19:21 -0400Nick Mathewson
Interesting how much a ! can change the behavior of an assert. svn:r6962
2006-07-31 r6980@Kushana: nickm | 2006-07-31 13:18:22 -0400Nick Mathewson
Add a utility function to verify that a string has been through strlower. svn:r6959
2006-07-23Whitespace fixNick Mathewson
svn:r6816
2006-07-23Add a mem_is_zero function (I think we will need this) and a STRUCT_OFFSET ↵Nick Mathewson
macro (we already need this). svn:r6810
2006-07-06when an exit node gets a malformed begin cell, don't complain toRoger Dingledine
the node operator, since he can't do anything about it. svn:r6733
2006-06-18remove non-germane commentNick Mathewson
svn:r6640
2006-06-18Add a memdup function to utilNick Mathewson
svn:r6635
2006-06-09Another escape() fix, for picky sprintfs.Nick Mathewson
svn:r6579
2006-06-09Override our notion of printability for esc_for_log. 127 and up are never ↵Nick Mathewson
printable. Take that, locales. svn:r6578