aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.h
Commit message (Collapse)AuthorAge
* Add a "di_ops.h" include to util.hNick Mathewson2011-05-11
|
* Bump copyright statements to 2011Nick Mathewson2011-01-03
|
* Update Tor Project copyright yearsNick Mathewson2010-02-27
|
* Spell-check Tor.Nick Mathewson2009-05-27
|
* Update copyright to 2009.Karsten Loesing2009-05-04
|
* Add a simple locale-independent no-surprises sscanf replacement.Nick Mathewson2009-03-03
| | | | | | | | | | tor_sscanf() only handles %u and %s for now, which will make it adequate to replace sscanf() for date/time/IP parsing. We want this to prevent attackers from constructing weirdly formed descriptors, cells, addresses, HTTP responses, etc, that validate under some locales but not others. svn:r18760
* Remove svn $Id$s from our source, and remove tor --version --version.Nick Mathewson2009-01-04
| | | | | | | | The subversion $Id$ fields made every commit force a rebuild of whatever file got committed. They were not actually useful for telling the version of Tor files in the wild. svn:r17867
* Use a consistent naming standard for header file guard macros, taking care ↵Nick Mathewson2008-12-29
| | | | | | not to collide with any system headers. This tripped us up on Android. svn:r17805
* Expose hex_decode_digit from util.cNick Mathewson2008-12-19
| | | | svn:r17706
* Replace calls to time(NULL) that occur on the order of once per read, one ↵Nick Mathewson2008-12-18
| | | | | | per write, or once per cell with calls to a function that looks at a cached value of time. This is tricksy to benchmark, since it will only help on systems where time() is a syscall and syscalls are relatively slow. svn:r17690
* Remove some cargo-cult gcc hacks around tor_assert and predict_unlikely; ↵Nick Mathewson2008-12-11
| | | | | | instead, use the standard convert-to-boolean hack of "svn st" svn:r17597
* make read_all and write_all return ssize_t.Nick Mathewson2008-11-05
| | | | svn:r17194
* Add a new memcmpstart to use instead of strcmpstart when the thing we are ↵Nick Mathewson2008-11-03
| | | | | | comparing is not nul-terminated. svn:r17187
* Document some dmalloc stuff and some stupid C tricks.Nick Mathewson2008-10-27
| | | | svn:r17161
* r17358@pc-10-8-1-079: nickm | 2008-07-25 16:41:03 +0200Nick Mathewson2008-07-25
| | | | | | | Split out the address manipulation functions from compat and util: they were about 21% of the total of those, and spread out too much. svn:r16208
* r17346@aud-055: nickm | 2008-07-24 15:37:19 +0200Nick Mathewson2008-07-24
| | | | | | | Make generic address manipulation functions work better. Switch address policy code to use tor_addr_t, so it can handle IPv6. That is a good place to start. svn:r16178
* r14373@tombo: nickm | 2008-02-21 16:29:18 -0500Nick Mathewson2008-02-21
| | | | | | | Apply warnings about implicit 64-to-32 conversions; some from Sebastian Hahn; some not. svn:r13664
* r18336@catbus: nickm | 2008-02-21 09:33:15 -0500Nick Mathewson2008-02-21
| | | | | | | Patch from Sebastian Hahn: remove obsolete timeval manipulation functions. svn:r13653
* r14185@tombo: nickm | 2008-02-15 18:05:54 -0500Nick Mathewson2008-02-15
| | | | | | | Replace the hefty tor_strpartition with a simple function to replace its only (trivial) use. svn:r13532
* Update some copyright notices: it is now 2008.Nick Mathewson2008-02-07
| | | | svn:r13412
* r17472@catbus: nickm | 2008-01-05 22:10:19 -0500Nick Mathewson2008-01-06
| | | | | | | Another test for the increasingly bad check-spaces style checker to check: #else\n#if is almost a sure sign of a failure to use #elif. Fortunately, we only did that 3 times. svn:r13039
* r15786@tombo: nickm | 2008-01-02 01:11:51 -0500Nick Mathewson2008-01-02
| | | | | | | Push the strdups used for parsing configuration lines into parse_line_from_string(). This will make it easier to parse more complex value formats, which in turn will help fix bug 557 svn:r13020
* r15691@tombo: nickm | 2007-12-25 18:13:54 -0500Nick Mathewson2007-12-26
| | | | | | | New, slightly esoteric function, tor_malloc_roundup(). While tor_malloc(x) allocates x bytes, tor_malloc_roundup(&x) allocates the same size of chunk it would use to store x bytes, and sets x to the usable size of that chunk. svn:r12981
* clean up copyrights, and assign 2007 copyrights to The Tor Project, IncRoger Dingledine2007-12-12
| | | | svn:r12786
* r16279@catbus: nickm | 2007-10-30 11:14:29 -0400Nick Mathewson2007-10-30
| | | | | | | Improved skew reporting: "You are 365 days in the duture" is more useful than "You are 525600 minutes in the future". Also, when we get something that proves we are at least an hour in the past, tell the controller "CLOCK_SKEW MIN_SKEW=-3600" rather than just "CLOCK_SKEW" svn:r12283
* r14359@Kushana: nickm | 2007-09-08 15:07:17 -0400Nick Mathewson2007-09-08
| | | | | | | Add some generic skew-and-tolerance functions so we can handle time more sanely. svn:r11406
* r14832@catbus: nickm | 2007-08-29 15:00:27 -0400Nick Mathewson2007-08-29
| | | | | | | Use (and debug) new file-writing functions in order to simplify code that formerly built big strings in RAM. svn:r11301
* r14831@catbus: nickm | 2007-08-29 14:17:42 -0400Nick Mathewson2007-08-29
| | | | | | | Refactor write_chunks_to_file_impl: break out the "pick a temporary name if it makes sense, and open the right filename" logic and the "close the file and unlink or rename if necessary" logic. This will let us write big files in a smarter way than "Build a big string" or "make a list of chunks", once we get around to using it. svn:r11300
* r14093@catbus: nickm | 2007-08-08 01:49:54 -0400Nick Mathewson2007-08-08
| | | | | | | Include fewer redundant headers; use the compiler search paths better. svn:r11060
* r14091@catbus: nickm | 2007-08-08 01:13:17 -0400Nick Mathewson2007-08-08
| | | | | | | Fix an annoying warning on OpenBSD: only include malloc.h if we are using it. svn:r11059
* r14024@catbus: nickm | 2007-07-30 14:13:58 -0400Nick Mathewson2007-07-30
| | | | | | | Glibc (and maybe others) define a mallinfo() that can be used to see how the platform malloc is acting inside. When we have it, dump its output on dumpmemusage(). svn:r10996
* r13834@catbus: nickm | 2007-07-19 15:40:42 -0400Nick Mathewson2007-07-19
| | | | | | | Another patch from croup: drop support for address masks that do not correspond to bit prefixes. Nobody has used this for a while, and we have given warnings for a long time. svn:r10881
* r13827@catbus: nickm | 2007-07-19 14:42:25 -0400Nick Mathewson2007-07-19
| | | | | | | Merge in some generic address manipulation code from croup. Needs some work. svn:r10880
* r13788@catbus: nickm | 2007-07-16 14:26:25 -0400Nick Mathewson2007-07-16
| | | | | | | Patch from croup: rewrite the logic of get_next_token() to do the right thing with input that ends at weird places, or aligns with block boundaries after mmap. should fix bug 455. Needs fuzzing. svn:r10847
* r13687@catbus: nickm | 2007-07-10 16:08:14 -0400Nick Mathewson2007-07-10
| | | | | | | Possible partial fix for bug 455: use eos logic everywhere. svn:r10786
* r13477@catbus: nickm | 2007-06-17 14:22:03 -0400Nick Mathewson2007-06-17
| | | | | | | Sun CC likes to give warnings for the do { } while(0) construction for making statement-like macros. Define STMT_BEGIN/STMT_END macros that do the right thing, and use them everywhere. svn:r10645
* r13154@catbus: nickm | 2007-06-02 11:26:44 -0400Nick Mathewson2007-06-02
| | | | | | | Server-side support for If-Modified-Since in HTTP requsts for v1 stuff, and for network-status documents. svn:r10451
* r12955@catbus: nickm | 2007-05-25 13:17:30 -0400Nick Mathewson2007-05-25
| | | | | | | First bare stubs of ipv6 work: commit some (untested, hence doublessly broken) implementations of inet_ntop/pton for systems that lack them. svn:r10326
* r12916@catbus: nickm | 2007-05-24 12:43:45 -0400Nick Mathewson2007-05-24
| | | | | | | Add math functions to round values to the nearest power of 2. Make mempools more careful about making sure that the size of their chunks is a little less than a power of 2, not a little more. svn:r10304
* r12850@catbus: nickm | 2007-05-21 22:20:42 -0400Nick Mathewson2007-05-22
| | | | | | | Partial backport candidate: do not rely on finding a \0 after an mmaped() router/extrainfo file. Also, set journal length correctly when starting up. svn:r10248
* Turn bool_neq and bool_eq into macros.Nick Mathewson2007-03-29
| | | | svn:r9914
* r12473@Kushana: nickm | 2007-03-06 15:49:45 -0500Nick Mathewson2007-03-09
| | | | | | | Excise PREDICT and PREDICT_FALSE in favor of PREDICT_LIKELY and PREDICT_UNLIKELY. svn:r9781
* r12468@Kushana: nickm | 2007-03-06 15:24:00 -0500Nick Mathewson2007-03-06
| | | | | | | More unit tests: gcov is fun. svn:r9748
* cosmetic, comment, and todo fixesRoger Dingledine2007-02-24
| | | | svn:r9627
* r11824@catbus: nickm | 2007-02-16 13:16:47 -0500Nick Mathewson2007-02-16
| | | | | | | Move all struct-offset-manipulation macros into util.h, and use them consistently. Because there are days when "SUBTYPE_P(handle, subtype, _base)" is just easier to read and write than "(basetp*)(((handle) - STRUCT_OFFSET(subtype, _base))". svn:r9592
* r11775@catbus: nickm | 2007-02-12 16:39:09 -0500Nick Mathewson2007-02-12
| | | | | | | Update copyright dates. svn:r9570
* r11774@catbus: nickm | 2007-02-12 16:31:47 -0500Nick Mathewson2007-02-12
| | | | | | | 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
* r11639@catbus: nickm | 2007-02-05 13:33:38 -0500Nick Mathewson2007-02-05
| | | | | | | Add documentation to src/common/*.h; improve documentation for SMARTLIST_FOREACH; remove never-used options and corresponding tests from tor_strpartition. svn:r9483
* r11629@catbus: nickm | 2007-02-02 15:06:17 -0500Nick Mathewson2007-02-02
| | | | | | | 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
* r11620@catbus: nickm | 2007-02-01 13:06:27 -0500Nick Mathewson2007-02-01
| | | | | | | Call stat() slightly less often; use fstat() when possible. svn:r9472