Commit Graph

5587 Commits

Author SHA1 Message Date
Nick Mathewson
2d07cce67f r14536@catbus: nickm | 2007-08-13 15:54:17 -0400
Make voting actually function.


svn:r11088
2007-08-13 19:55:08 +00:00
Nick Mathewson
89c65f2a4e r14534@catbus: nickm | 2007-08-13 15:15:46 -0400
Read v3 keys from the right location


svn:r11087
2007-08-13 19:16:44 +00:00
Nick Mathewson
ce1f01c3e6 r14531@catbus: nickm | 2007-08-13 14:46:25 -0400
Cache v3 networkstatus consensuses on disk.


svn:r11086
2007-08-13 18:47:22 +00:00
Nick Mathewson
33cf3ada94 r14526@catbus: nickm | 2007-08-13 14:08:37 -0400
Make voting interval configurable.


svn:r11083
2007-08-13 18:09:38 +00:00
Roger Dingledine
762b5c479c less scary log entry
svn:r11077
2007-08-11 14:38:11 +00:00
Roger Dingledine
330abbb6c6 logging patch from karsten, slightly modified to compile
svn:r11074
2007-08-11 14:13:25 +00:00
Roger Dingledine
5920484083 dirserv.c:782: warning: `set_v1_dirty' might be used uninitialized in this function
svn:r11068
2007-08-10 03:07:00 +00:00
Nick Mathewson
5070a1e3ef r14103@catbus: nickm | 2007-08-09 18:30:40 -0400
Drop v1 directory support: instead, just generate stub v1 directories.  This should save lots and lots of directory bandwidth, and break any code relying on v1 directories, including Tor 0.1.0.x and earlier.


svn:r11067
2007-08-09 22:32:33 +00:00
Nick Mathewson
da09efe13d r13953@Kushana: nickm | 2007-08-08 07:40:46 -0700
Fix osx compilation.


svn:r11065
2007-08-08 14:43:30 +00:00
Nick Mathewson
3fc04529d4 r14093@catbus: nickm | 2007-08-08 01:49:54 -0400
Include fewer redundant headers; use the compiler search paths better.


svn:r11060
2007-08-08 05:50:31 +00:00
Nick Mathewson
50f5f63678 r14091@catbus: nickm | 2007-08-08 01:13:17 -0400
Fix an annoying warning on OpenBSD: only include malloc.h if we are using it.


svn:r11059
2007-08-08 05:14:03 +00:00
Roger Dingledine
9d2b1004b1 bump to 0.2.0.4-alpha-dev
svn:r11056
2007-08-08 04:12:05 +00:00
Nick Mathewson
68e6426c23 r13927@Kushana: nickm | 2007-08-03 00:56:54 -0700
ratchet down the time spent on threading tests


svn:r11043
2007-08-03 07:57:41 +00:00
Nick Mathewson
652d4e0248 r13926@Kushana: nickm | 2007-08-03 00:55:23 -0700
Fix compilation with HAVE_GETADDRINFO unset


svn:r11042
2007-08-03 07:57:31 +00:00
Nick Mathewson
1c513979fc r13919@Kushana: nickm | 2007-08-02 10:58:31 -0700
Warn about unsafe ControlPort configurations.


svn:r11038
2007-08-02 21:03:40 +00:00
Nick Mathewson
ba28346f2f r13907@Kushana: nickm | 2007-08-02 10:29:13 -0700
Try (once again) to fix mingw build wrt detecting ipv6 types.


svn:r11037
2007-08-02 17:30:42 +00:00
Roger Dingledine
46c4f8ff42 bump to 0.2.0.4-alpha
svn:r11022
2007-08-02 04:49:20 +00:00
Roger Dingledine
659cdae145 a patch on r11016 that makes it work better
svn:r11018
2007-08-02 04:28:29 +00:00
Nick Mathewson
322b6f7e65 r13892@Kushana: nickm | 2007-08-01 18:27:13 -0700
Close immediately after anything but a successful authentication attempt on the control port.  Backport candidate.


svn:r11016
2007-08-02 01:28:40 +00:00
Nick Mathewson
a4e7dffc94 r13886@Kushana: nickm | 2007-08-01 09:43:06 -0700
Unit tests and debugging for detached signature manipulation.


svn:r11015
2007-08-01 16:43:44 +00:00
Nick Mathewson
d5c78593d2 r13873@Kushana: nickm | 2007-07-31 10:54:05 -0700
Split over-optimized digestmap_set code into a generic part and a digestmap-specific part.


svn:r11012
2007-08-01 15:57:48 +00:00
Nick Mathewson
484c8b776d r13872@Kushana: nickm | 2007-07-31 08:27:54 -0700
Rename IN4_ADDR and IN6_ADDR to try to avoid conflicting with Windows definitions.  This may fix the windows build.


svn:r11011
2007-08-01 15:57:34 +00:00
Nick Mathewson
2872a43386 r13871@Kushana: nickm | 2007-07-31 08:10:58 -0700
Fix warning aobut unused parameter on platforms without mallinfo.


svn:r11010
2007-08-01 15:57:07 +00:00
Nick Mathewson
480db0f00a r14034@catbus: nickm | 2007-07-31 05:22:56 -0400
possible fix for bug 473: always set buf->cur on buf_remove_from_front.


svn:r11004
2007-07-31 09:31:15 +00:00
Peter Palfrader
ce8edc964c Stop pretending all systems are fast
svn:r11003
2007-07-31 06:48:47 +00:00
Roger Dingledine
ec376c5fbd bump to 0.2.0.3-alpha-dev
svn:r10999
2007-07-30 23:53:09 +00:00
Roger Dingledine
57c6264ede tweak comment
svn:r10998
2007-07-30 23:52:58 +00:00
Nick Mathewson
45c82b1d85 r14024@catbus: nickm | 2007-07-30 14:13:58 -0400
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
2007-07-30 18:14:14 +00:00
Nick Mathewson
9fb77a6479 Disable SENTINELS in buffers: it may be responsible for making platform mallocs() be inefficient, and we havent needed it in a long long time.
svn:r10994
2007-07-30 17:51:14 +00:00
Nick Mathewson
9260a824ef Yet another buffer RAM patch: tNever ever ever keep a buffer memory chunk around for an empty buffer that could go on the freelist. This wants profiling to make sure that performance doesnt suffer.
svn:r10993
2007-07-30 17:47:43 +00:00
Nick Mathewson
34a3a5e2f4 r14016@catbus: nickm | 2007-07-30 13:45:55 -0400
More documentation


svn:r10992
2007-07-30 17:46:14 +00:00
Nick Mathewson
23a345b3c2 r14015@catbus: nickm | 2007-07-30 13:18:05 -0400
Add missing code documentation in src/common


svn:r10991
2007-07-30 17:46:12 +00:00
Roger Dingledine
5d535a28c9 clean up some bridge log messages
svn:r10985
2007-07-30 08:43:02 +00:00
Roger Dingledine
1b01ad6d38 writing instructions before you release means you can make sure
your instructions don't seg fault


svn:r10984
2007-07-30 08:42:47 +00:00
Roger Dingledine
e118efb545 bump to 0.2.0.3-alpha
svn:r10982
2007-07-30 03:40:51 +00:00
Nick Mathewson
915c4c3ab8 r14001@catbus: nickm | 2007-07-29 21:31:53 -0400
Try to call time(NULL) a little less.


svn:r10980
2007-07-30 01:32:12 +00:00
Nick Mathewson
a3b8b2c4e3 r14000@catbus: nickm | 2007-07-29 21:16:45 -0400
Fix bug 472: do not use spaces in pseudo-address for local link cons.


svn:r10979
2007-07-30 01:32:07 +00:00
Roger Dingledine
468d922280 start hunting bugs, first in a non-crashy manner
svn:r10978
2007-07-30 01:07:06 +00:00
Nick Mathewson
3dbc825f36 r13996@catbus: nickm | 2007-07-29 19:17:53 -0400
Fix whitespace


svn:r10977
2007-07-29 23:18:06 +00:00
Nick Mathewson
77508edd36 r13989@catbus: nickm | 2007-07-29 19:11:07 -0400
More directory voting code.  Now, if everything works, and I haven't forgotten anything, it is possible to set up some v3 authorities and start voting. Of course, I have probably forgotten something, and there are probably bugs in there somewhere too.


svn:r10976
2007-07-29 23:11:44 +00:00
Nick Mathewson
759ed3ce3f r13988@catbus: nickm | 2007-07-29 16:32:36 -0400
Cheesy attempt to break some censorware.  Not a long-term fix, but it will be intersting to watch the epidemiology of the workarounds as the censors apply them.


svn:r10975
2007-07-29 23:11:42 +00:00
Roger Dingledine
ca7c53d3cc Be even more aggressive about separating local traffic from relayed
traffic when RelayBandwidthRate is set. (Refines proposal 111.)


svn:r10974
2007-07-29 22:13:44 +00:00
Nick Mathewson
616152486f r13986@catbus: nickm | 2007-07-29 09:15:03 -0400
Answer comment from Roger.


svn:r10971
2007-07-29 13:18:52 +00:00
Roger Dingledine
a68e6e23c9 patches on r10968: compare advertised capacity, not bandwidthrate;
and make the sorting order deterministic to avoid flapping.

also note that we could take the "is_auth" checks out of the
sorting entirely.


svn:r10970
2007-07-29 05:56:30 +00:00
Nick Mathewson
9031bbd4d8 r13982@catbus: nickm | 2007-07-29 01:31:53 -0400
Actually, we missed a rule about what routers to prefer: first prefer authority to non-authority, *then* running, *then* bandwidth.


svn:r10969
2007-07-29 05:32:03 +00:00
Nick Mathewson
1b665b3c7e r13979@catbus: nickm | 2007-07-29 01:20:20 -0400
Implement proposal 109:  As an authority, never call more than 3 servers per IP Running and Valid.  Prefer Running servers to non-running ones; then prefer high-bandwidth to low-bandwidth.  Needs testing.


svn:r10968
2007-07-29 05:20:31 +00:00
Roger Dingledine
eca2a30060 make progress towards retrying our bridges when they're all
down and we get a new socks request


svn:r10967
2007-07-29 04:38:21 +00:00
Nick Mathewson
964e4a305d r13972@catbus: nickm | 2007-07-29 00:01:38 -0400
Make our control events for multi-line async replies conform to our old grammar.  Change back to the old grammar (which got "corrected" in r10931).


svn:r10964
2007-07-29 04:03:25 +00:00
Nick Mathewson
25bd4204d0 r13964@catbus: nickm | 2007-07-28 22:55:10 -0400
Change "IN_ADDR" macro to "IN4_ADDR" in an attempt to fix mingw compilation


svn:r10963
2007-07-29 02:55:24 +00:00
Nick Mathewson
d2adb68ed6 r13963@catbus: nickm | 2007-07-28 22:53:32 -0400
Add support for signature upload


svn:r10962
2007-07-29 02:55:21 +00:00
Roger Dingledine
9895d840f5 When running with dmalloc, dump more stats on hup and exit.
svn:r10961
2007-07-29 01:18:00 +00:00
Nick Mathewson
764bde22de r13960@catbus: nickm | 2007-07-28 18:14:29 -0400
Start correctly when cached-certs is missing. oops


svn:r10957
2007-07-28 22:14:42 +00:00
Nick Mathewson
76a408941c r13959@catbus: nickm | 2007-07-28 18:09:56 -0400
Use the correct formula to calculate exit weights.


svn:r10956
2007-07-28 22:14:39 +00:00
Nick Mathewson
afe9f33d35 r13956@catbus: nickm | 2007-07-27 20:09:48 -0400
Better certificate manipulations: extract certificates from incoming votes, forget ones that are very old, and remember to store them on disk.


svn:r10954
2007-07-28 00:11:34 +00:00
Nick Mathewson
0d274e1db1 r13952@catbus: nickm | 2007-07-27 19:18:46 -0400
Weasel noticed that many buffers spend their time with empty 4k, 8k, and 16k memory chunks.  Thus, be more aggressive about putting empty chunks on the freelist, regardless of their high water marks.  (Also, run buffer_shrink_freelist on the 8k-chunk freelist.)


svn:r10953
2007-07-27 23:19:02 +00:00
Nick Mathewson
43f64d09ea r13951@catbus: nickm | 2007-07-27 18:39:28 -0400
Make it so we can actually compile with FULL_V1_DIRECTORIES disabled.


svn:r10952
2007-07-27 23:18:58 +00:00
Nick Mathewson
f6229d6432 r13950@catbus: nickm | 2007-07-27 18:15:23 -0400
Wrap bandwidth usage info in another ifdef so we can easily drop it on august 1 when it is time to finalize proposal 104.


svn:r10951
2007-07-27 23:18:55 +00:00
Nick Mathewson
0e5d8925d9 r13946@catbus: nickm | 2007-07-27 16:09:31 -0400
Fix median_int for platforms where sizeof(int)!=sizeof(time_t)


svn:r10949
2007-07-27 20:09:37 +00:00
Nick Mathewson
a5477c7bb9 r13944@catbus: nickm | 2007-07-27 15:52:35 -0400
Fix warnings on platforms where rlim values can be signed.
 Add an 8k buffer freelist.
 


svn:r10948
2007-07-27 19:53:29 +00:00
Nick Mathewson
bc9a7be943 r13939@catbus: nickm | 2007-07-27 14:33:22 -0400
When dumping memory usage, list bytes used in buffer memory free-lists.


svn:r10947
2007-07-27 18:33:37 +00:00
Nick Mathewson
65cdda20b3 r13938@catbus: nickm | 2007-07-27 14:26:07 -0400
More code to handle incoming consensus signatures


svn:r10946
2007-07-27 18:33:34 +00:00
Nick Mathewson
10f166045b r13937@catbus: nickm | 2007-07-27 12:43:36 -0400
Maintain a detached-signatures document along with pending consensus document.  Add a dirvote_free_all() to clean up static vars in dirvote.c


svn:r10945
2007-07-27 18:33:30 +00:00
Nick Mathewson
a65cea38d2 r13936@catbus: nickm | 2007-07-27 12:23:26 -0400
Code to implement detached signature documents.


svn:r10944
2007-07-27 18:33:28 +00:00
Nick Mathewson
35561a542c r13934@catbus: nickm | 2007-07-27 10:41:00 -0400
Fix spelling; add a comment.


svn:r10943
2007-07-27 14:41:08 +00:00
Peter Palfrader
49db52abe6 Maybe fix #471. Compute the size of bitfields more correctly. Nick, please check.
svn:r10941
2007-07-27 04:45:42 +00:00
Peter Palfrader
1f4275451b Resolve a compiler warning about uninitialized use
svn:r10940
2007-07-27 01:10:23 +00:00
Nick Mathewson
eed888a2b7 r13927@catbus: nickm | 2007-07-26 17:26:49 -0400
Fix router_choose_by_bandwidth to no longer be biases by floating-point roundoff issues.  This runs through the list of routers yet another time, and uses an additional bitfield, but this should be okay: the function did not appear in profiles before, and shouldnt start appearing now.


svn:r10939
2007-07-26 21:26:57 +00:00
Nick Mathewson
b1c873182d r13926@catbus: nickm | 2007-07-26 17:21:06 -0400
Add a bit-array type with reasonably fast inline functions.


svn:r10938
2007-07-26 21:26:53 +00:00
Nick Mathewson
6c4864f351 r13924@catbus: nickm | 2007-07-26 16:46:45 -0400
We can have multiple authority certificates for an authority at a time: make the code reflect that.


svn:r10937
2007-07-26 20:49:04 +00:00
Nick Mathewson
fb2f3c035b r13921@catbus: nickm | 2007-07-26 16:26:48 -0400
Code to add signatures to a pending consensus directory.


svn:r10936
2007-07-26 20:26:59 +00:00
Nick Mathewson
189bc7cf9f r13920@catbus: nickm | 2007-07-26 16:25:25 -0400
whitespace fixes


svn:r10935
2007-07-26 20:26:53 +00:00
Nick Mathewson
7f3e2378b6 r13908@catbus: nickm | 2007-07-25 18:55:47 -0400
Patch from Robert Hogan: set conn->dns_server_port correctly so that we can close dns server ports when they change, thus avoiding crashes and dangling references and other sources of unhappiness.


svn:r10933
2007-07-25 22:57:07 +00:00
Nick Mathewson
025a81fc18 r13907@catbus: nickm | 2007-07-25 18:51:25 -0400
Patch from tup: translate LFs to CRLFs in NS replies and
 ensures the data section is properly terminated with "\r\n.\r\n


svn:r10932
2007-07-25 22:57:02 +00:00
Nick Mathewson
a8821e2d82 r13905@catbus: nickm | 2007-07-25 18:48:44 -0400
ADDRMAP events should never have specified local time.  Extend them to have the proper gmt time, and make GETINFO address-mappings always do the right thing (since it is new in this version).


svn:r10930
2007-07-25 22:56:54 +00:00
Nick Mathewson
47f3a40900 r13904@catbus: nickm | 2007-07-25 18:04:46 -0400
Fix whitespaces and compilation in and around dirvote code.


svn:r10929
2007-07-25 22:56:50 +00:00
Nick Mathewson
2305c2c7be r13903@catbus: nickm | 2007-07-25 18:03:56 -0400
Make buffer large enough to hold ip6.arpa addresses.  This code was not actually used yet, so no user-visible bug existed. (Based on patch by croup.)


svn:r10928
2007-07-25 22:56:47 +00:00
Nick Mathewson
a66f259354 r13902@catbus: nickm | 2007-07-25 17:43:52 -0400
Some dirvote code to handle generating votes and slinging them around.  More code is still needed.


svn:r10927
2007-07-25 22:56:44 +00:00
Nick Mathewson
1b7a704c34 r13901@catbus: nickm | 2007-07-25 16:23:51 -0400
Make all code to generate v1 directories into conditional code.


svn:r10926
2007-07-25 22:56:40 +00:00
Nick Mathewson
83fa843663 r13900@catbus: nickm | 2007-07-25 16:16:30 -0400
Better fix for GCC 4.2 warning on routerlist.c


svn:r10925
2007-07-25 22:56:34 +00:00
Nick Mathewson
1b24067395 r13773@kushana: nickm | 2007-07-23 00:16:44 -0400
Use tor malloc replacements in eventdns.c for now: there might be goblins there...goblins that only dmalloc can find!


svn:r10912
2007-07-23 04:18:20 +00:00
Nick Mathewson
4d2f45978f r13875@catbus: nickm | 2007-07-22 18:56:30 -0400
Once more with feeling.


svn:r10907
2007-07-22 22:56:33 +00:00
Nick Mathewson
6640fdeeee r13872@catbus: nickm | 2007-07-22 18:51:02 -0400
esc_router_info static field should not be cleared postfork, to avoid races.


svn:r10906
2007-07-22 22:51:07 +00:00
Nick Mathewson
701fce8e5c r13858@catbus: nickm | 2007-07-22 18:44:02 -0400
Fix/note some relatively trivial mem usage issues


svn:r10905
2007-07-22 22:49:49 +00:00
Roger Dingledine
0104882e9b dump dmalloc stats on sighup
svn:r10903
2007-07-22 07:05:43 +00:00
Roger Dingledine
5190916670 free a small static string on exit.
svn:r10902
2007-07-22 06:32:28 +00:00
Roger Dingledine
e96d807db4 Revert part of r10874, since it was breaking our load balancing
(we always picked one router past the one we wanted!) and could
conceivably read past the end of the smartlist too.

Nick, I don't know what gcc 4.2 was worried about, but we need
to find a better fix than this. :)


svn:r10901
2007-07-22 04:36:33 +00:00
Roger Dingledine
6fc336d217 handle fetching bridge descriptors from the bridge authority too.
svn:r10898
2007-07-22 00:16:48 +00:00
Roger Dingledine
56d3119581 Directory authorities now call routers Fast if their bandwidth is
at least 100KB/s, and consider their bandwidth adequate to be a
Guard if it is at least 250KB/s. This fix complements proposal
107. [Bugfix on 0.1.2.x]


svn:r10897
2007-07-21 23:40:55 +00:00
Roger Dingledine
a916e07ea6 when requesting tor/server/authority, ask for tor/server/authority.z
instead. same functionality, saves a bit of bandwidth. and might even
work.


svn:r10896
2007-07-21 22:04:18 +00:00
Nick Mathewson
8e50aa7341 r13856@catbus: nickm | 2007-07-20 14:30:44 -0400
slightly smarter heuristic about when to use obsolete ::a.b.c.d format.


svn:r10893
2007-07-20 18:30:47 +00:00
Nick Mathewson
8ba42a3bde r13850@catbus: nickm | 2007-07-20 12:25:24 -0400
Fix some bugs in ntop/pton.


svn:r10891
2007-07-20 16:25:27 +00:00
Nick Mathewson
6223160ab7 r13848@catbus: nickm | 2007-07-19 16:47:16 -0400
Use our own version of inet_ntop and inet_pton everywhere, to avoid partitioning attacks.


svn:r10888
2007-07-19 20:47:18 +00:00
Nick Mathewson
3015129a4a r13846@catbus: nickm | 2007-07-19 16:31:41 -0400
Actually, OSX (and some BSDs) accept [f:f:f:f:f:f:f:f::] as a perfectly fine ipv6 address.


svn:r10887
2007-07-19 20:31:43 +00:00
Nick Mathewson
31a73c0767 r13844@catbus: nickm | 2007-07-19 16:04:04 -0400
Same as the last patch, only more so.


svn:r10886
2007-07-19 20:04:05 +00:00
Nick Mathewson
00420bd084 r13842@catbus: nickm | 2007-07-19 16:02:54 -0400
OSX writes ::3 as ::0.0.0.3; choose a less ambiguous example.


svn:r10885
2007-07-19 20:02:56 +00:00
Nick Mathewson
a1f4644a94 r13840@catbus: nickm | 2007-07-19 16:00:43 -0400
Apparently, this problem can occur on the whole BSD family. "Yay."


svn:r10884
2007-07-19 20:00:45 +00:00
Nick Mathewson
b2772f93cb r13838@catbus: nickm | 2007-07-19 15:50:16 -0400
Apparently, OSX does not define s6_addr32 or s6_addr16. How silly.


svn:r10883
2007-07-19 19:50:20 +00:00
Nick Mathewson
679b55eb1f r13836@catbus: nickm | 2007-07-19 15:43:04 -0400
Some older GCCs think that iph4 could be used uninitialized. Fix that.


svn:r10882
2007-07-19 19:43:08 +00:00
Nick Mathewson
4a240552c4 r13834@catbus: nickm | 2007-07-19 15:40:42 -0400
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
2007-07-19 19:40:45 +00:00
Nick Mathewson
bbbf504281 r13827@catbus: nickm | 2007-07-19 14:42:25 -0400
Merge in some generic address manipulation code from croup.  Needs some work.


svn:r10880
2007-07-19 18:46:09 +00:00
Nick Mathewson
70aef18db1 r13826@catbus: nickm | 2007-07-19 12:21:30 -0400
Fix a copy-and-paste error in dirvote.c


svn:r10879
2007-07-19 18:46:06 +00:00
Nick Mathewson
5e6f05bc31 r13822@catbus: nickm | 2007-07-18 16:43:39 -0400
Tweak a couple of loop-related variables to make the gcc 4.2 -Wstrict-overflow warning happy.


svn:r10874
2007-07-18 20:46:14 +00:00
Nick Mathewson
d920683718 r13821@catbus: nickm | 2007-07-18 16:29:17 -0400
Initial code to manipulate vote timing correctly.


svn:r10873
2007-07-18 20:46:12 +00:00
Nick Mathewson
4a9d4c2c5c r13820@catbus: nickm | 2007-07-18 16:07:30 -0400
Whitespace fix on r10849


svn:r10872
2007-07-18 20:46:10 +00:00
Peter Palfrader
3052bf6a84 Change routerlist_remove to not take an index argument we do not need anyway.
Now the only remaining caller of _routerlist_find_elt is an assert()

svn:r10869
2007-07-18 14:02:47 +00:00
Roger Dingledine
50487c249d timeout and retry schedules for fetching bridge descriptors
svn:r10867
2007-07-18 10:06:03 +00:00
Roger Dingledine
5c4d86f512 using fascistfirewall and having your bridge on an unreachable
port silently didn't mix. now they loudly don't mix.


svn:r10862
2007-07-18 07:13:15 +00:00
Nick Mathewson
670db47e1b r13801@catbus: nickm | 2007-07-17 13:49:12 -0400
More tweaks to dir-spec.txt; not complete, but closing in.


svn:r10856
2007-07-17 17:49:16 +00:00
Roger Dingledine
a1ab2c8087 free bridge list on exit; try harder to free buffer freelists on exit.
svn:r10854
2007-07-17 11:33:38 +00:00
Roger Dingledine
b7e4683ff9 bugfix on r10086:
We had accidentally labelled 0.1.2.x directory servers as not
suitable for begin_dir requests, and had labelled no directory
servers as suitable for uploading extra-info documents. [Bugfix
on 0.2.0.1-alpha]


svn:r10853
2007-07-17 09:37:00 +00:00
Roger Dingledine
fcbb817db5 free another string, and the buffer freelists, on exit.
svn:r10851
2007-07-17 09:26:45 +00:00
Roger Dingledine
ccfda2e3a3 a few fixes for bug 463. needs a changelog. might need more fixes.
svn:r10849
2007-07-17 02:53:17 +00:00
Nick Mathewson
ad45ddfb07 r13788@catbus: nickm | 2007-07-16 14:26:25 -0400
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
2007-07-16 18:26:31 +00:00
Nick Mathewson
6e9f1f76f2 r13784@catbus: nickm | 2007-07-16 13:27:32 -0400
Apply patch from tup: remove extra space at the end of some circuit-status events, and stop translating CRLF to CRCRLF in control replies.


svn:r10845
2007-07-16 17:27:35 +00:00
Nick Mathewson
26a25edaec r13777@catbus: nickm | 2007-07-16 12:58:08 -0400
Patch from tup: new address-mappings/ GETINFO that includes expiry times.


svn:r10844
2007-07-16 16:58:11 +00:00
Nick Mathewson
483c1e9017 r13774@catbus: nickm | 2007-07-16 12:23:28 -0400
Tweaks on constrained socket buffers patch from coderman: Add a changelog; rename some variables; fix some long lines and whitespace; make ConstrainedSockSize a memunit; pass setsockopt a void.


svn:r10843
2007-07-16 16:23:36 +00:00
Nick Mathewson
f4a6673758 r13773@catbus: nickm | 2007-07-16 11:58:25 -0400
Initial "constrained socket buffers" patch from coderman. needs tweaking.


svn:r10842
2007-07-16 16:23:34 +00:00
Roger Dingledine
6d2cb32d10 free some more memory on exit
svn:r10837
2007-07-16 04:33:47 +00:00
Roger Dingledine
4b719cbae0 stop reading uninitialized/outofbounds memory. possible backport,
quite related to bug 455.


svn:r10835
2007-07-16 03:39:21 +00:00
Roger Dingledine
98ce45bebf Backport candidate:
Fix a potential crash bug when we load many server descriptors at
once and some of them make others of them obsolete. Fixes bug
458. [Bugfix on 0.1.2.x]


svn:r10832
2007-07-16 00:11:03 +00:00
Roger Dingledine
5ab3f49d93 backport candidate: fix a memory leak from r9039 which had us leaking
50ish bytes every time we rebuild the cached-router files.


svn:r10830
2007-07-15 08:34:32 +00:00
Roger Dingledine
2c2f7ee6a4 fix a memory leak from r10504 (i think)
svn:r10829
2007-07-15 08:11:56 +00:00
Peter Palfrader
2ce1cb22bd Comment one tor_assert
svn:r10820
2007-07-12 17:37:47 +00:00
Roger Dingledine
ef6bc1a451 Keep streamids from different exits on a circuit separate. This
bug may have allowed other routers on a given circuit to inject
cells into streams. Reported by lodger; fixes bug 446. [Bugfix
on 0.1.2.x]


svn:r10818
2007-07-12 17:09:19 +00:00
Nick Mathewson
656b7761a8 r13730@catbus: nickm | 2007-07-12 12:32:40 -0400
Patch from lodger: avoid roundoff-error-induced crash bugs when picking routers by bandwidth.
 Also, remove listed backports for 0.1.2.x; that list is now in TODO.012


svn:r10812
2007-07-12 16:34:45 +00:00
Peter Palfrader
9ed261cd6a In router_add_to_routerlist() only call router_have_minimum_dir_info() under some circumstances, not always
svn:r10799
2007-07-12 15:57:23 +00:00
Roger Dingledine
9bf23e0598 backport candidate:
When sending destroy cells from a circuit's origin, don't include
the reason for tearing down the circuit. The spec says we didn't,
and now we actually don't. Reported by lodger. [Bugfix on 0.1.2.x]


svn:r10790
2007-07-11 03:37:45 +00:00
Roger Dingledine
83e8d8d9b9 clean up a comment
svn:r10789
2007-07-11 03:28:12 +00:00
Nick Mathewson
39dc589d32 r13691@catbus: nickm | 2007-07-10 18:44:30 -0400
Fix an assert error in 455 patch.


svn:r10788
2007-07-10 22:44:32 +00:00
Nick Mathewson
fa1376014b r13689@catbus: nickm | 2007-07-10 17:46:30 -0400
tweaks to last patch.  from croup.


svn:r10787
2007-07-10 21:46:33 +00:00
Nick Mathewson
7e20fdbefb r13687@catbus: nickm | 2007-07-10 16:08:14 -0400
Possible partial fix for bug 455: use eos logic everywhere.


svn:r10786
2007-07-10 20:08:18 +00:00
Nick Mathewson
d6ba1c3d96 r13676@catbus: nickm | 2007-07-10 13:41:24 -0400
Man. I thought I removed that code.


svn:r10785
2007-07-10 17:41:26 +00:00
Nick Mathewson
a8465adaa2 r13667@catbus: nickm | 2007-07-10 13:12:52 -0400
Patch from tup: add GETINFO status/enough-dir-info


svn:r10782
2007-07-10 17:14:55 +00:00
Nick Mathewson
74711479eb r13666@catbus: nickm | 2007-07-10 13:10:00 -0400
Get the RESOLVE controller code working.


svn:r10781
2007-07-10 17:14:51 +00:00
Nick Mathewson
7705314777 r13637@catbus: nickm | 2007-07-06 14:24:27 -0400
fix copy-paste error in config message src/or/config.c .  Apply
 initial (but pared-down) version of launch-resolve-via-controller
 patch from Robert Hogan.
 


svn:r10780
2007-07-10 17:13:24 +00:00
Nick Mathewson
10e5ed1a84 r13602@Kushana: nickm | 2007-07-07 23:44:24 -0400
Backport candidate: fix a possible buffer overrun when using natd support on old BSDs.  Based on a patch from "Mr. Croup".


svn:r10760
2007-07-08 03:45:47 +00:00
Peter Palfrader
db3a4bf897 Call router_have_minimum_dir_info() at the beginning of router_add_to_routerlist() since it has side effects
svn:r10754
2007-07-06 21:21:09 +00:00
Peter Palfrader
39b1a11f8d Remove two arguments from routerlist_replace(). idx, which is
the old router's index in the routerlist, can be gotten from the
old routerinfo itself anyway, and make_old always was true.
(There only is one caller of routerlist_replace())


svn:r10753
2007-07-06 18:40:39 +00:00
Nick Mathewson
e6ba07f8f5 r13634@catbus: nickm | 2007-07-06 14:20:50 -0400
Fix a crash bug (*the* crash bug?) on authorities.  Backport candidate.


svn:r10752
2007-07-06 18:20:54 +00:00
Nick Mathewson
92b6e09082 r13633@catbus: nickm | 2007-07-06 11:08:19 -0400
Call tor_init_threads() from tor_init().


svn:r10751
2007-07-06 18:20:52 +00:00
Nick Mathewson
73b4428a8b r13631@catbus: nickm | 2007-07-06 10:17:22 -0400
Try to fix win32 build again.


svn:r10750
2007-07-06 14:17:30 +00:00
Nick Mathewson
bbc7cf86d5 r13600@Kushana: nickm | 2007-07-05 23:49:47 -0400
try to fix mingw compile


svn:r10743
2007-07-06 03:49:57 +00:00
Nick Mathewson
a9469098ca r13596@kushana: nickm | 2007-07-05 10:53:22 -0400
Argh, re-enable CRITICAL_SECTION code in win32.


svn:r10741
2007-07-05 14:53:27 +00:00
Nick Mathewson
5c9c420111 svn:r10740 2007-07-05 14:51:10 +00:00
Nick Mathewson
ae4ab0f617 r13454@kushana: nickm | 2007-06-20 14:22:44 -0400
Switch windows locking implementation to CRITICAL_SECTION, not Mutex: Mutex is heavier-weight, and meant for multi-process situations.


svn:r10739
2007-07-05 14:51:01 +00:00
Nick Mathewson
04c9ae8164 r13453@kushana: nickm | 2007-06-20 10:01:37 -0400
Fix a type error in the last checkin.


svn:r10738
2007-07-05 14:50:13 +00:00
Nick Mathewson
b5c8a6183a r13452@kushana: nickm | 2007-06-20 09:52:55 -0400
Patch from Robert Hogan: Generate STREAM NEW events for dnsport requests and tunneled directory connections.  Log when we are testing for hijacking.


svn:r10737
2007-07-05 14:50:05 +00:00
Roger Dingledine
99bfb1bebe If there's a never-before-connected-to guard node in our list,
never choose any guards past it. This way we don't expand our 
guard list unless we need to. [Bugfix in 0.1.2.x]

I'm not sure if this will solve all our problems, but it is at least
something.



svn:r10730
2007-07-02 22:15:26 +00:00
Roger Dingledine
5c1daed3ad the non-controversial changes i found in my sandbox
svn:r10729
2007-07-02 22:07:53 +00:00
Nick Mathewson
32b165ab61 r13604@catbus: nickm | 2007-07-02 16:58:40 -0400
Some temporary output to try to figure out where bsd thread unit tests are going wrong


svn:r10728
2007-07-02 21:08:03 +00:00
Peter Palfrader
64f4cff192 I so wonder how this blows up on the real network - make _routerlist_find_elt be strict about the idx it is passed - if it is not -1 then it has to be correct
svn:r10727
2007-07-02 20:17:12 +00:00
Peter Palfrader
d071df748a If we want to be more strict in _routerlist_find_elt I better call it properly
svn:r10726
2007-07-02 20:04:26 +00:00
Peter Palfrader
ccefd7404e Don't get private with smartlists when there's a perfectly fine accessor method for num_used
svn:r10724
2007-07-02 19:45:44 +00:00
Peter Palfrader
f274c1413e Make it build with -O0 as well
svn:r10722
2007-07-02 17:50:57 +00:00
Peter Palfrader
adff891463 Make DEBUG_SMARTLIST work
svn:r10721
2007-07-02 17:48:56 +00:00
Peter Palfrader
ea1348360e Three more assertions which hopefully are sane, Nick? They might help track down #417.
svn:r10720
2007-07-02 15:13:52 +00:00
Nick Mathewson
1bdcfd9203 r13570@catbus: nickm | 2007-06-30 20:41:05 -0400
Implement conditions in compat.c; switch windows to use "critical sections" instead of mutexes.  Apparently, mutexes are for IPC and critical sections are for multithreaded.


svn:r10716
2007-07-01 16:22:45 +00:00
Nick Mathewson
8bebff3deb r13568@catbus: nickm | 2007-06-30 15:18:18 -0400
allow test_threads() to time out 


svn:r10711
2007-06-30 19:18:28 +00:00
Nick Mathewson
25a11bf8aa r13555@catbus: nickm | 2007-06-30 14:05:36 -0400
Split "Util" tests into subgroups so I can see why freebsd trunk is failing.


svn:r10710
2007-06-30 18:06:00 +00:00
Nick Mathewson
a8a880e418 r13480@catbus: nickm | 2007-06-17 14:39:42 -0400
Oops; forgot to save a file in the last batch.


svn:r10646
2007-06-17 18:41:03 +00:00
Nick Mathewson
5adfa09fce r13477@catbus: nickm | 2007-06-17 14:22:03 -0400
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
2007-06-17 18:22:39 +00:00
Nick Mathewson
93f32db438 r13476@catbus: nickm | 2007-06-17 14:04:41 -0400
Build with fewer compiler warnings on Sun.  (This and previous Sun patches are thanks to the tremendously handy services of unix-center.net.)


svn:r10644
2007-06-17 18:22:35 +00:00
Nick Mathewson
99792df645 r13473@catbus: nickm | 2007-06-17 13:42:36 -0400
Fix solaris eventdns.c behavior.  This time, I think I got it.  We were redefining _FILE_OFFSET_BITS, and thereby calling fstat64() on a struct stat, or something like that.


svn:r10643
2007-06-17 17:43:25 +00:00
Nick Mathewson
721899a447 r13471@catbus: nickm | 2007-06-17 11:59:25 -0400
Report address and por correctly on requests to dnsport. (Patch from Robert Hogan.)


svn:r10641
2007-06-17 15:59:27 +00:00
Nick Mathewson
d828915136 r13463@catbus: nickm | 2007-06-17 11:10:17 -0400
Add a SOURCE_ADDR field to STREAM NEW events so that controllers can match requests to applications. (Patch from Robert Hogan.)


svn:r10639
2007-06-17 15:10:51 +00:00
Nick Mathewson
3df7fc5e5a r13438@catbus: nickm | 2007-06-15 15:01:42 -0400
document some functions


svn:r10637
2007-06-17 15:10:43 +00:00
Nick Mathewson
9e944d07f8 r13418@catbus: nickm | 2007-06-14 13:29:21 -0400
Adjust networkstatus_compute_consensus to take an argument saying how many voters there _should_ be.


svn:r10634
2007-06-17 15:10:23 +00:00
Roger Dingledine
237cdfdf48 if we already have a bridge in our state file, it won't be
in the networkstatuses, so we'll mark it unusable when we
load it, and then when we get a new routerinfo for it, we'll
still think it's unusable. fix that.


svn:r10612
2007-06-15 18:32:27 +00:00
Roger Dingledine
07ff5c6785 bugfix on r10609: don't fail asserts when closing circuits
that were connected to an unkeyed connection.


svn:r10611
2007-06-15 16:21:40 +00:00
Roger Dingledine
2cd293dc8f now we can specify a bridge without specifying its key,
and we will still connect to it and use it. getting closer!


svn:r10609
2007-06-15 06:01:04 +00:00
Roger Dingledine
6a2f045163 extra points for making the function name reflect what it does
svn:r10608
2007-06-15 04:23:36 +00:00
Roger Dingledine
73f7310d9b Directories no longer return a "304 not modified" when they don't
have the networkstatus the client asked for. Also fix a memory
leak when returning 304 not modified. [Bugfixes on 0.2.0.2-alpha]


svn:r10607
2007-06-15 04:20:51 +00:00
Roger Dingledine
9f9ee13dc0 point out a bug in our If-Modified-Since handling in 0.2.0.2-alpha.
svn:r10605
2007-06-15 03:14:02 +00:00
Roger Dingledine
3d641bde0e Refine r10571: more work on bridge stuff.
- Only listen to responses for "authority" fetches if we're configured
    to use Bridges. Otherwise it's safe (and maybe smarter) to silently
    discard them like we used to.
  - React faster to download networkstatuses after the first bridge
    descriptor arrives.
  - Don't do dir fetches before we have any bridges, even when our 
    dirport is open.


svn:r10604
2007-06-15 02:12:15 +00:00
Nick Mathewson
9a74e881ef r13413@catbus: nickm | 2007-06-13 18:44:28 -0400
Non-static inline functions cant talk about static variables.


svn:r10599
2007-06-13 22:44:30 +00:00
Nick Mathewson
a8e88adba4 r13410@catbus: nickm | 2007-06-13 18:39:05 -0400
Fix compilation on compilers that do not allow you to typedef the same type twice.


svn:r10598
2007-06-13 22:39:10 +00:00
Nick Mathewson
649a802322 r13409@catbus: nickm | 2007-06-13 18:01:56 -0400
Test the remainder of the contents of the consensus; fix a bug in geneating addresses on routerstatuses.


svn:r10597
2007-06-13 22:39:08 +00:00
Nick Mathewson
c2ea3e9aea r13406@catbus: nickm | 2007-06-13 17:05:30 -0400
Oops; linked connections get read/write events too.


svn:r10596
2007-06-13 21:05:32 +00:00
Nick Mathewson
6462683669 r13403@catbus: nickm | 2007-06-13 16:15:44 -0400
Test all of consensus contents, except for routerstatus_list contents. And signatures.


svn:r10593
2007-06-13 20:17:27 +00:00
Nick Mathewson
4b162fd1f4 r13401@catbus: nickm | 2007-06-13 15:50:16 -0400
Add dnsport connection to the global connection list. (Bug found by mwenge.)


svn:r10592
2007-06-13 19:50:18 +00:00
Nick Mathewson
eab7c6890d r13399@catbus: nickm | 2007-06-13 15:17:44 -0400
Hm. Tor should never need private authority identity keys; thus, I should not actually load the authority identity keys for testing.


svn:r10591
2007-06-13 19:17:46 +00:00
Nick Mathewson
3fa9a90243 r13396@catbus: nickm | 2007-06-13 15:06:18 -0400
Set vote_digest field prproperly in networkstatus_vote_t, so that it gets conveyed to the consensus correctly.


svn:r10590
2007-06-13 19:06:26 +00:00
Nick Mathewson
c3626cdba7 r13395@catbus: nickm | 2007-06-13 15:01:23 -0400
Unit tests and debugging for generating and parsing consensus networkstatus documents.  Still need to test actual contents.


svn:r10589
2007-06-13 19:06:23 +00:00
Nick Mathewson
05cf945a1c r13393@catbus: nickm | 2007-06-13 14:29:14 -0400
More vote unit tests: check that we are parsing routerstatuses correctly.


svn:r10588
2007-06-13 18:29:16 +00:00
Nick Mathewson
0cf38ddef6 r13387@catbus: nickm | 2007-06-13 14:15:49 -0400
Unit tests and debugging for vote generation and parsing code.


svn:r10587
2007-06-13 18:16:05 +00:00
Nick Mathewson
09a370e45f r13386@catbus: nickm | 2007-06-13 14:15:20 -0400
New helper file for test.c: contains 3 generated certs, signing keys, and id_keys


svn:r10586
2007-06-13 18:16:01 +00:00
Nick Mathewson
300678221a r13385@catbus: nickm | 2007-06-13 14:14:47 -0400
In tor-gencert, write BEGIN SIGNATURE, not BEGIN_SIGNATURE.


svn:r10585
2007-06-13 18:15:59 +00:00
Nick Mathewson
546209a4de r13384@catbus: nickm | 2007-06-13 13:53:26 -0400
make test_* functions stop conflicting with variables named v1 and v2.


svn:r10584
2007-06-13 18:15:56 +00:00
Nick Mathewson
3637ee0e59 r13383@catbus: nickm | 2007-06-13 13:53:04 -0400
Expose a function to parse a private key from a string as CRYPTO_PRIVATE.  For testing.


svn:r10583
2007-06-13 18:15:53 +00:00
Roger Dingledine
af658b7828 More work towards making bridge users able to connect via bridges:
- demand options->Bridges and options->TunnelDirConns if 
    options->UseBridges is set.
  - after directory fetches, accept descriptors that aren't referenced by
    our networkstatuses, *if* they're for a configured bridge.
  - delay directory fetching until we have at least one bridge descriptor.
  - learn how to build a one-hop circuit when we have neither routerinfo
    nor routerstatus for our destination.
  - teach directory connections how to pick a bridge as the destination
    directory when doing non-anonymous fetches.
  - tolerate directory commands for which the dir_port is 0.
  - remember descriptors when the requested_resource was "authority", 
    rather than just ignoring them.
  - put bridges on our entry_guards list once we have a descriptor for them.
    When UseBridges is set, only pick entry guards that are bridges. Else
    vice versa.


svn:r10571
2007-06-12 09:17:23 +00:00
Roger Dingledine
622dd4927e change the BandwidthRate/BandwidthBurst in the torrc
to RelayBandwidthRate/RelayBandwidthBurst, since that's
what most users will actually want. also flesh out the
torrc.complete entries and fix a few typos. based on
patch from "Armedblowfish".


svn:r10570
2007-06-12 08:19:02 +00:00
Peter Palfrader
c0b28adc65 Resetting the correct stats
svn:r10569
2007-06-12 01:09:53 +00:00
Nick Mathewson
a21381affa r13364@catbus: nickm | 2007-06-11 20:15:53 -0400
Stop assuming that desc_by_eid_map works: in fact, it kinda doesn't.  Add a big comment explaining why.


svn:r10567
2007-06-12 00:15:55 +00:00
Nick Mathewson
399890307d r13362@catbus: nickm | 2007-06-11 19:00:23 -0400
Fix a warning on platforms where sizeof(size_t)==8, but sizeof(unsigned long)<8.


svn:r10566
2007-06-11 23:00:26 +00:00
Nick Mathewson
dddf065e62 r13358@catbus: nickm | 2007-06-11 18:46:24 -0400
Fix some dumb copypasta in r10562.


svn:r10565
2007-06-11 22:46:35 +00:00
Peter Palfrader
f621513cad Remove an #undef, so you can -Ddefine stuff on the command line
svn:r10564
2007-06-11 22:32:30 +00:00
Nick Mathewson
367a77459a r13355@catbus: nickm | 2007-06-11 18:19:34 -0400
Make all the digestmaps inside routerlist_t use the new typechecking wrappers, so we can catch any more bugs like the one fixed by 10561.  This turned up a bug in routerlist_remove: we were extracting a routerinfo_t from desc_digest_map.  Fix that too, though it was probably harmless, since we were only doing a pointer comparison with it.


svn:r10563
2007-06-11 22:19:40 +00:00
Nick Mathewson
f45732513e r13354@catbus: nickm | 2007-06-11 18:17:40 -0400
Add typechecking wrappers to digestmap, so we can work with "map from digest to [FOO]" for arbitrary FOOs and still have some typesafety.


svn:r10562
2007-06-11 22:19:37 +00:00
Nick Mathewson
bde82e737b r13352@catbus: nickm | 2007-06-11 17:42:45 -0400
Since desc_by_eid_map hold server descriptors, do not add routerinfo_ts.  Bug found by weasel


svn:r10561
2007-06-11 21:42:48 +00:00
Peter Palfrader
e91cab20dd Reorder routerlist_assert_ok() and routerlist_check_bug_417(), so if the assert_ok triggers we know that our bug_417 is wrong
svn:r10560
2007-06-11 19:46:23 +00:00