Commit Graph

417 Commits

Author SHA1 Message Date
Nick Mathewson
e1ddee8bbe Code to generate, store, and parse microdescriptors and consensuses.
The consensus documents are not signed properly, not served, and not
exchanged yet.
2009-10-15 15:17:13 -04:00
Sebastian Hahn
772ce9d085 Fix compile on Snow Leopard 2009-09-20 23:17:00 -04:00
Mike Perry
e2cc4e353a Add a couple of time helper functions.
Also add rounding support to tv_mdiff().
2009-09-20 18:03:39 -07:00
Sebastian Hahn
0a71d1c6a7 Fix compile warnings on Snow Leopard
Big thanks to nickm and arma for helping me with this!
2009-09-01 22:16:46 +02:00
Nick Mathewson
1cda6f3e75 Merge commit 'origin/maint-0.2.1' 2009-09-01 15:59:40 -04:00
Sebastian Hahn
742788b737 typo 2009-09-01 21:58:06 +02:00
Sebastian Hahn
aea9cf1011 Fix compile warnings on Snow Leopard
Big thanks to nickm and arma for helping me with this!
2009-09-01 18:36:27 +02:00
Nick Mathewson
00b37f071d 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.
2009-08-31 00:18:55 -04:00
Karsten Loesing
7b716878cb 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.
2009-07-27 16:23:53 +02:00
Karsten Loesing
8f1a973669 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.
2009-07-13 22:43:06 +02:00
Nick Mathewson
fd992deeea 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".
2009-05-30 18:16:24 -04:00
Nick Mathewson
f0453c45c8 Spelling fixes in comments and strings 2009-05-27 16:36:13 -04:00
Nick Mathewson
11b9c839f0 Stop using malloc_usable_size(): valgrind hates it. 2009-05-17 01:55:02 -04:00
Karsten Loesing
9b32e8c141 Update copyright to 2009. 2009-05-04 11:28:27 -04:00
Nick Mathewson
cbbc0c9c86 Actually use tor_sscanf() to parse untrusted input.
svn:r18761
2009-03-03 18:02:36 +00:00
Nick Mathewson
26d83fc04c Add a simple locale-independent no-surprises sscanf replacement.
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
2009-03-03 18:02:31 +00:00
Nick Mathewson
25c6ff6f55 Support 64-bit time_t. Patch from Matthias Drochner. Partial backport candidate.
svn:r18234
2009-01-22 16:28:12 +00:00
Nick Mathewson
a87980c2eb Add a better (non-locale-having) ctypes implementation to avoid protocol and parsing mismatches on different platforms.
svn:r18189
2009-01-20 21:33:56 +00:00
Nick Mathewson
743c6c8277 OpenBSD malloc.h believes that you should be able to detect headers with autoconf, or build without warnings, but not both. So never include malloc.h on OpenBSD. Backport candidate.
svn:r17891
2009-01-04 22:47:42 +00:00
Nick Mathewson
c4b8fef362 Remove svn $Id$s from our source, and remove tor --version --version.
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
2009-01-04 00:35:51 +00:00
Nick Mathewson
558e9899e4 Document most undocumented variables.
svn:r17754
2008-12-23 17:56:31 +00:00
Nick Mathewson
b4d387c28b Make freelist_len in memarea.c static; document a few variables.
svn:r17741
2008-12-22 19:14:08 +00:00
Nick Mathewson
b68379b13b Add DOCDOC entries for undocumented static and global variables.
svn:r17739
2008-12-22 19:00:05 +00:00
Nick Mathewson
1e5f457461 Fix most DOCDOCs remaining and/or added by redox.
svn:r17734
2008-12-22 17:53:04 +00:00
Nick Mathewson
1725c0c8a5 Add DOCDOC comments for all undocumented functions. Add missing *s to other comments so that they will get recognized as doxygen.
svn:r17729
2008-12-22 14:56:28 +00:00
Nick Mathewson
55348884b5 Fix all of the doxygen warnings not pertaining to missing documentation.
svn:r17727
2008-12-22 14:56:16 +00:00
Nick Mathewson
efb863189c Expose hex_decode_digit from util.c
svn:r17706
2008-12-19 18:51:52 +00:00
Nick Mathewson
bf80e2df3f Replace calls to time(NULL) that occur on the order of once per read, one 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
2008-12-18 17:19:04 +00:00
Nick Mathewson
122170c1d3 Downlgrade tweak, and answer lots of XXX021s. No actual code fixes in this patch.
svn:r17686
2008-12-18 16:11:24 +00:00
Nick Mathewson
8d5a9d762c Log an error on win32 if directory listing fails.
svn:r17684
2008-12-18 16:11:12 +00:00
Nick Mathewson
37bd9181f0 Do not use O_APPEND on fd-based operations that do not really want it; have them just lseek instead.
svn:r17460
2008-12-02 23:49:40 +00:00
Nick Mathewson
35bef7fefd make read_all and write_all return ssize_t.
svn:r17194
2008-11-05 19:29:17 +00:00
Nick Mathewson
b56d1545db Fix freebsd 7 compile by adding malloc_np.h header. Fix bug 850.
svn:r17190
2008-11-05 15:56:53 +00:00
Nick Mathewson
3f84ed3d46 Add a new memcmpstart to use instead of strcmpstart when the thing we are comparing is not nul-terminated.
svn:r17187
2008-11-03 16:35:48 +00:00
Nick Mathewson
0ab45fee73 Document some dmalloc stuff and some stupid C tricks.
svn:r17161
2008-10-27 16:30:52 +00:00
Jacob Appelbaum
7873d324df This patch changes some of the code in util.c to refactor calls to
dmalloc_malloc, dmalloc_realloc and dmalloc_strdup. It only calls those
functions if we're using the magic USE_DMALLOC macro. If we're not doing
that, we call the normal malloc, realloc and strdup. This is my first
night at malloc disambiguation club, so I had to disambiguate. Also, first commit, I have my commit bit now. Huzzzah!!!


svn:r17157
2008-10-26 22:56:53 +00:00
Roger Dingledine
4eab76f074 remove a code path that should never happen (and if it did, we'd be
complaining about an errno set from some arbitrary previous problem).


svn:r16684
2008-08-29 09:06:18 +00:00
Nick Mathewson
9da0482007 r17358@pc-10-8-1-079: nickm | 2008-07-25 16:41:03 +0200
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
2008-07-25 14:43:24 +00:00
Nick Mathewson
3ce6e2fba2 r17346@aud-055: nickm | 2008-07-24 15:37:19 +0200
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
2008-07-24 13:44:04 +00:00
Nick Mathewson
9d7a2d4eae r16689@tombo: nickm | 2008-07-03 11:03:14 -0400
Fix for bug 742: do not use O_CREAT on 2-option version of open().  Especially do not use it on /dev/null.  Fix from Michael Scherer. Bugfix on 0.0.2pre19 (wow).


svn:r15626
2008-07-03 15:04:16 +00:00
Nick Mathewson
d0a4ad3a1c r16127@tombo: nickm | 2008-06-10 14:03:01 -0400
Improved code for counting clients by country: support recording by number of directory status requests in addition to number of IPs seen.


svn:r15097
2008-06-10 18:08:56 +00:00
Nick Mathewson
ac330d9ba7 New code to implement proposal for local geoip stats. Only enabled with --enable-geoip-stats passed to configure.
svn:r14802
2008-05-29 02:29:35 +00:00
Nick Mathewson
09cd8fa371 r19795@catbus: nickm | 2008-05-16 14:54:24 -0400
Rename tor_addr_t manipulation functions for a consistent style.


svn:r14639
2008-05-16 19:19:49 +00:00
Nick Mathewson
cc7a8a63b1 r15120@tombo: nickm | 2008-04-08 18:01:58 -0400
Add very short 0.2.1.x list based on discussion from arma. needs fleshing out and merging with other lists.


svn:r14324
2008-04-08 22:02:08 +00:00
Nick Mathewson
7dd78f1576 r18929@catbus: nickm | 2008-03-18 12:08:16 -0400
Detect errors from directory listing correctly on win32.  Bug found by lodger.


svn:r14102
2008-03-18 16:08:49 +00:00
Nick Mathewson
ea6f636e94 r18890@catbus: nickm | 2008-03-17 13:19:29 -0400
Clarify documentation for file_status a little


svn:r14079
2008-03-17 17:21:09 +00:00
Nick Mathewson
2ed4b818cb r18878@catbus: nickm | 2008-03-17 00:11:02 -0400
Clean up an overwide line.


svn:r14072
2008-03-17 04:11:05 +00:00
Peter Palfrader
3a92e3f15f I wonder what the DISGARD service is
svn:r13999
2008-03-13 14:09:01 +00:00
Roger Dingledine
04efc74e18 be a little bit more helpful than "Error reading directory."
make a note to try to be more helpful still.


svn:r13776
2008-02-28 21:37:39 +00:00
Nick Mathewson
69300eb606 r14374@tombo: nickm | 2008-02-21 16:57:39 -0500
Fix all remaining shorten-64-to-32 errors in src/common.  Some were genuine problems.  Many were compatibility errors with libraries (openssl, zlib) that like predate size_t.  Partial backport candidate.


svn:r13665
2008-02-21 21:57:47 +00:00