Commit Graph

2473 Commits

Author SHA1 Message Date
Nick Mathewson
aac97a3c6a Tell openssl how to use locks and how to find thread ids -- this may prevent race conditions surrounding the error queue.
svn:r3622
2005-02-13 22:32:25 +00:00
Nick Mathewson
427e246a10 Add a missing prototype to or.h
svn:r3621
2005-02-13 22:31:26 +00:00
Nick Mathewson
d90ab823ea remove redundant unpack in critical path
svn:r3620
2005-02-13 16:17:32 +00:00
Nick Mathewson
f6221b695f Apply windows patch from Dmitri Bely
svn:r3617
2005-02-12 21:03:37 +00:00
Nick Mathewson
58540dde50 Do not try to double-aquire lock when rotating keys. May fix deadlock bug found by weasel.
svn:r3616
2005-02-11 07:56:10 +00:00
Nick Mathewson
5d836c8140 Free tls resources on exit too
svn:r3615
2005-02-11 01:41:19 +00:00
Nick Mathewson
f672577bc6 Free even more things on shutdown. Temporarily move tor_free_all out from #ifdef so it gets tested more.
svn:r3614
2005-02-11 01:26:47 +00:00
Nick Mathewson
60f234f42b Add more functions to free things to help dmalloc allong.
svn:r3613
2005-02-10 23:18:39 +00:00
Roger Dingledine
33569e40d7 if we're hibernating and we get a sigint, exit immediately.
closes bug 91.


svn:r3611
2005-02-10 07:34:19 +00:00
Roger Dingledine
236aa86ae7 stop picking unverified dir mirrors, ever.
it only leads to misery.


svn:r3610
2005-02-10 07:00:23 +00:00
Roger Dingledine
37ca621301 when a client asks us for a dir mirror and we don't have one,
launch an attempt to get a fresh one.


svn:r3609
2005-02-10 06:31:34 +00:00
Roger Dingledine
07a3307460 remove redundant lines
svn:r3607
2005-02-09 23:54:30 +00:00
Nick Mathewson
89d422914a Patch from adam langley: always remove sockets from libevent before closing them. Should fix epoll-related bugs.
svn:r3606
2005-02-09 23:16:31 +00:00
Roger Dingledine
c5c46d6fb6 don't list version in the win32 service display name or service name,
since they'll keep changing and people will get messed up about which
one is installed.


svn:r3592
2005-02-09 02:26:24 +00:00
Nick Mathewson
a64b03a4fd Avoid double-free on tor-resolve failure
svn:r3567
2005-02-05 23:55:21 +00:00
Nick Mathewson
bb32fa86d7 Re-normalize whitespace; make "make check-spaces" happy
svn:r3566
2005-02-05 21:42:46 +00:00
Nick Mathewson
24ad6542c9 forward-port NT service patch
svn:r3565
2005-02-05 21:40:25 +00:00
Nick Mathewson
322c728e97 Fix tor-resolve implementation to prevent crashes and send resolves when we should.
svn:r3561
2005-02-05 21:03:24 +00:00
Roger Dingledine
56d4b99491 forward-port the logic skew and double-free thing
svn:r3549
2005-02-04 01:49:58 +00:00
Nick Mathewson
915202048e Handle return value from getaddrinfo properly
svn:r3526
2005-02-03 23:13:36 +00:00
Roger Dingledine
efa9bb5535 fix the latest bug: don't explode when some router declares a
bandwidthburst of 500 gigabytes.

this bug seems to have taken down most of the network. oops.


svn:r3523
2005-02-03 22:58:22 +00:00
Nick Mathewson
a035032f09 Use getaddrinfo and gethostbyname_r where available. Note that these are not necessarily threadsafe: this needs more thinking. Perhaps we should back down on this multithreading idea.
svn:r3522
2005-02-03 21:31:04 +00:00
Nick Mathewson
e4b21c97f7 Forward-port SGI Compatibility patches from Jan Schaumann
svn:r3517
2005-02-03 19:59:10 +00:00
Roger Dingledine
051cda803e point out a potential thread/process leak problem when we're out of memory
svn:r3512
2005-02-03 07:35:24 +00:00
Roger Dingledine
bcece3d8a7 another minor fix
svn:r3511
2005-02-03 07:30:00 +00:00
Peter Palfrader
ddd724ef94 Add --with-dmalloc configure option
svn:r3508
2005-02-03 07:25:10 +00:00
Peter Palfrader
dfa3a0220f Write a function header for Roger so he can fill it with life
svn:r3507
2005-02-03 07:23:48 +00:00
Roger Dingledine
f3b74a2adb http://www.erlenstar.demon.co.uk/unix/faq_2.html says we
should call _exit, not exit, from child processes.


svn:r3506
2005-02-03 06:40:06 +00:00
Roger Dingledine
f575d29a59 note a bug that wmf just found
svn:r3503
2005-02-02 06:28:45 +00:00
Roger Dingledine
c1656f41b4 bugfix: tor-resolve requests were ignoring .exit if there was
a working circuit they could use instead.


svn:r3502
2005-02-02 06:26:52 +00:00
Roger Dingledine
0551e3a814 reject more default filesharing ports by default.
svn:r3500
2005-02-02 04:15:40 +00:00
Roger Dingledine
976bee4a3f only check if exit_policy_implicitly_allows if you're a server.
also, put a comment next to an interesting undocumented 'feature'.


svn:r3499
2005-02-02 01:59:16 +00:00
Roger Dingledine
0f5a198028 sometimes, a conn on the closeable_lst gets absolutely
clobbered. maybe this will help me find out why.


svn:r3498
2005-02-02 00:19:09 +00:00
Roger Dingledine
850c300e46 bump the default rate limit to 1 MB
svn:r3494
2005-02-01 13:44:10 +00:00
Roger Dingledine
b90983e44f reject odd-looking addresses at the client, rather than having
the server drop them because they're malformed.


svn:r3493
2005-02-01 12:19:44 +00:00
Roger Dingledine
1447145470 give a bit more load to servers that claim to be able to
handle a whole lot.


svn:r3489
2005-02-01 02:56:31 +00:00
Roger Dingledine
1e847aebb1 Go into soft hibernation after 95% of the bandwidth is used,
not 99%. This is especially important for daily hibernators who
have a small accounting max. Hopefully it will result in fewer
cut connections when the hard hibernation starts.


svn:r3488
2005-02-01 02:45:28 +00:00
Roger Dingledine
2e97593d25 define TOR_FRAGILE if you want tor to give you a core when
something goes wrong. this should only be used by people actively
tracking bugs.


svn:r3487
2005-02-01 00:37:16 +00:00
Roger Dingledine
e7e77d6d8e fix an edge case in parsing config options (thanks weasel)
svn:r3486
2005-02-01 00:05:57 +00:00
Peter Palfrader
d19aaa9a46 Fix arma's fix for my leak
svn:r3485
2005-01-31 23:47:25 +00:00
Roger Dingledine
ab8691c343 fix a minor memory leak found by weasel
svn:r3484
2005-01-31 20:38:57 +00:00
Roger Dingledine
d232831135 stop a sigpipe.
apparently when we get an eof, at least sometimes it *does* mean
you'd better not try writing.


svn:r3481
2005-01-31 08:12:30 +00:00
Roger Dingledine
9856e328c4 stop logging loudly when a client tries an old onion key. it's
time to give up on that issue, at least for now.


svn:r3479
2005-01-31 04:03:57 +00:00
Roger Dingledine
a7138f2535 fix another rogue connection_free that was causing us troubles
there are no doubt more lurking.


svn:r3478
2005-01-31 03:47:38 +00:00
Roger Dingledine
a0312f3590 don't double-detach a closing exit conn that's waiting for dns resolve
svn:r3477
2005-01-31 01:27:49 +00:00
Roger Dingledine
692a57c8e8 but don't spring the trip on worker children, because it turns
out they don't actually remove anything before freeing the conns.


svn:r3476
2005-01-31 01:02:20 +00:00
Roger Dingledine
d6489d8e41 lay a trap for situations where we connection_free something
that's still on one of the lists.

in particular, this will detect situations where we mark-for-close
and then free it ourselves.


svn:r3475
2005-01-31 00:33:32 +00:00
Roger Dingledine
75b45bcd4d stop the infinite loop of freeing the same connection_t over and
over when it's not linked into the connection_array


svn:r3474
2005-01-31 00:26:09 +00:00
Roger Dingledine
c53c7a0b4c clarify what smartlist_remove promises, since we rely on it.
svn:r3473
2005-01-31 00:24:59 +00:00
Roger Dingledine
5d8659429e be less noisy about complaining when a jap client tries to connect
and we refuse him.


svn:r3472
2005-01-30 23:52:47 +00:00
Roger Dingledine
3969b6066e Stop crashing when we're asking to close_if_marked a conn that
hasn't been connection_added yet. This happens when an exit conn
is in dns_wait and we get a relay end cell for it before it finishes.

We were silently leaking each of these marked conns in 0.0.9.x. Now
we actually free them.


svn:r3470
2005-01-30 21:47:47 +00:00
Roger Dingledine
20ecfc757b be safe: if you got a resolvefailed end cell but you're not an AP, bail.
svn:r3469
2005-01-30 21:46:42 +00:00
Roger Dingledine
7ddeb7fae7 try to find the corrupt closeable_connection_lst entry early
svn:r3468
2005-01-30 20:31:08 +00:00
Roger Dingledine
e432d2ceea we should handle the case where the client has no cert, for
backwards compatibility with jap clients.


svn:r3466
2005-01-30 08:02:33 +00:00
Roger Dingledine
cab0138e4c give a better log message when we don't have a good mirror of
the directory yet and somebody asks for it.


svn:r3464
2005-01-30 06:08:42 +00:00
Roger Dingledine
8e7fc8d259 comment about a bug wrt clock skew
svn:r3461
2005-01-30 00:07:31 +00:00
Roger Dingledine
d273891107 if we fetch the dir from a mirror that has a wildly skewed
clock, then don't bother checking recommended-versions: it will
just make us sad.

as a side effect, people running obsolete versions and whose
clocks are wildly skewed will not be auto-shut-down. but they
will still get warns about their clock skew.


svn:r3459
2005-01-29 11:48:37 +00:00
Roger Dingledine
191e52179c distinguish between "well-formed and rejected" and "not well
formed", when parsing server descriptors.


svn:r3458
2005-01-29 11:23:34 +00:00
Roger Dingledine
7fd8dfe6ea accept LDAP (389/tcp) and LDAPS (636/tcp) in default exit policy
svn:r3457
2005-01-29 11:16:23 +00:00
Roger Dingledine
82d3894f3e don't let a corrupt directory cache keep us from starting
svn:r3456
2005-01-29 11:07:35 +00:00
Roger Dingledine
0b9b97aaf4 forward-port the shutting up
svn:r3450
2005-01-28 10:00:29 +00:00
Roger Dingledine
b2fbd834f0 forward-port the dns and maxconn fixes
svn:r3448
2005-01-28 08:53:47 +00:00
Roger Dingledine
d7cee9dbf4 make the example log-to-file line use log-level notice rather than
log-level warn.


svn:r3441
2005-01-28 05:40:41 +00:00
Nick Mathewson
083b67cda5 Add rudimentary pthread support that needs more testing.
svn:r3439
2005-01-27 22:34:48 +00:00
Nick Mathewson
e03f571ee3 Forward-port win32 service patch; try to clean it a touch.
svn:r3438
2005-01-27 21:45:32 +00:00
Roger Dingledine
8ebe85333c comment SocksPort better as it pertains to servers
svn:r3413
2005-01-22 06:51:31 +00:00
Nick Mathewson
fbb7f869c5 fwd-port win32 isprint fix
svn:r3410
2005-01-22 00:42:58 +00:00
Nick Mathewson
1dc4d9a0ce Fix dumb bug in unittests.
svn:r3409
2005-01-22 00:42:40 +00:00
Roger Dingledine
2a908e5180 forward-port: fix win32 compile
svn:r3406
2005-01-22 00:35:09 +00:00
Nick Mathewson
de9b46ad64 clean a couple of messages
svn:r3401
2005-01-21 23:16:07 +00:00
Roger Dingledine
4826718eac special case so we don't yell when an empty http body doesn't specify a
content-encoding


svn:r3397
2005-01-21 03:18:49 +00:00
Roger Dingledine
b137f6d19f if we get an incredibly skewed timestamp from a dirserver mirror that
isn't a verified OR, don't complain very loudly -- it's probably him
that's wrong.


svn:r3395
2005-01-21 00:45:18 +00:00
Nick Mathewson
8115ca5f99 Log the offending policy, not the first policy
svn:r3394
2005-01-20 20:42:45 +00:00
Nick Mathewson
6704093c0d Appease another 64-bit warning
svn:r3392
2005-01-20 20:21:34 +00:00
Nick Mathewson
fd41cbcadf Have reason string for serverdesc post requests contain actual serverdesc status. Also fix return values of dirserv_add_descriptor to work as advertised.
svn:r3391
2005-01-20 20:18:32 +00:00
Nick Mathewson
5b45527851 Appease weasel's paranoid 64-bit compiler.
svn:r3389
2005-01-20 20:16:48 +00:00
Roger Dingledine
a2e441da06 give a header file for ntohs
svn:r3388
2005-01-20 20:15:14 +00:00
Roger Dingledine
67f0babfd4 start to fix http status stuff, more work needed
svn:r3387
2005-01-20 20:07:36 +00:00
Nick Mathewson
80e8359ccf Give better reason phrases in HTTP status lines. Start resolving task #67. (Messages still need to be better.)
svn:r3386
2005-01-20 19:46:02 +00:00
Nick Mathewson
29b6637a62 Compilation fixes for win32 version detection.
svn:r3385
2005-01-20 19:03:09 +00:00
Nick Mathewson
432e313c81 Make zlib detection happy on little-endian platforms; fix unit tests.
svn:r3384
2005-01-20 19:02:35 +00:00
Nick Mathewson
129e754ae4 Warn when exit policy implicitly allows local addresses.
svn:r3383
2005-01-20 18:39:48 +00:00
Roger Dingledine
a6e91f8157 The crowning hidden-service patch: prefer non-internal circuits
for normal connections, so we don't spend our internal circs on
other stuff and not have them when we need them.


svn:r3380
2005-01-20 07:02:24 +00:00
Roger Dingledine
38be533c69 Handle unavailable hidden services better. We try each intro point
until none are left, then we try to refetch the descriptor. If it's
the same one we had before, then close streams right then. Whenever
a new stream arrives, even if it's right after, optimistically try
refetching the descriptor, just in case.


svn:r3379
2005-01-19 23:15:59 +00:00
Roger Dingledine
ff48179372 make cannibalizing for rend circs prey on the pleb circs first
if possible, rather than the elite ones.


svn:r3378
2005-01-19 23:13:20 +00:00
Nick Mathewson
f8c14bbf1f Detect windows platform correctly
svn:r3377
2005-01-19 23:10:16 +00:00
Nick Mathewson
2c803bff9a Make detect_compression_method work on platforms with more evil chars.
svn:r3376
2005-01-19 23:07:43 +00:00
Nick Mathewson
1eddb28f82 Add unittests for compression detection. Make all rendezvous descriptors "plausible".
svn:r3375
2005-01-19 22:47:48 +00:00
Nick Mathewson
69fa5be7b6 Workaround for webservers that lie about Content-Encoding: Tor now tries to autodetect compressed directories and compression itself. (resolves bug 65)
svn:r3374
2005-01-19 22:40:33 +00:00
Nick Mathewson
e0bf597665 Give more useful log messages when the tor process closes dns/cpuworker connections. "Error: Success!" makes us seem like crazy people."
svn:r3373
2005-01-19 21:34:42 +00:00
Roger Dingledine
75d83827e0 fix another bug where general exit circs were looking at rendezvous
streams. consolidate the looking into one function so it doesn't
happen again.


svn:r3372
2005-01-19 17:59:37 +00:00
Roger Dingledine
f2a7ff6801 better comments for exit policies in torrc.sample
svn:r3371
2005-01-19 17:26:40 +00:00
Roger Dingledine
cfcc93296c bugfix for cvs: we were needing a rendezvous circ, so we cannibalized
a general circ, and called rend_client_rendcirc_has_opened(), which
called connection_ap_attach_pending(), which was needing a rendezvous
circ, so it cannibalized a general circuit, and called ...


svn:r3370
2005-01-19 17:13:11 +00:00
Roger Dingledine
bd2d740b49 make it clearer why FooPort and FooBindAddress are separate
svn:r3369
2005-01-19 06:06:04 +00:00
Nick Mathewson
7d4a167c81 Basic windows libevent fixes
svn:r3366
2005-01-18 23:44:55 +00:00
Roger Dingledine
4e369bc9e8 allow bandwidthburst to be smaller, but whine if it's small.
svn:r3364
2005-01-18 19:34:22 +00:00
Roger Dingledine
ea24dc31bc remove some extra-verbose logs
svn:r3361
2005-01-17 18:49:13 +00:00
Roger Dingledine
d2400a5afd Introduce a notion of 'internal' circs, which are chosen without regard
to the exit policy of the last hop. Intro and rendezvous circs must
be internal circs, to avoid leaking information. Resolve and connect
streams can use internal circs if they want.

New circuit pooling algorithm: make sure to have enough circs around
to satisfy any predicted ports, and also make sure to have 2 internal
circs around if we've required internal circs lately (with high uptime
if we've seen that lately).

Split NewCircuitPeriod config option into NewCircuitPeriod (30 secs),
which describes how often we retry making new circuits if current ones
are dirty, and MaxCircuitDirtiness (10 mins), which describes how long
we're willing to make use of an already-dirty circuit.

Once rendezvous circuits are established, keep using the same circuit as
long as you attach a new stream to it at least every 10 minutes. (So web
browsing doesn't require you to build new rend circs every 30 seconds.)

Cannibalize GENERAL circs to be C_REND, C_INTRO, S_INTRO, and S_REND
circ as necessary, if there are any completed ones lying around when
we try to launch one.

Re-instate the ifdef's to use version-0 style introduce cells, since
there was yet another bug in handling version-1 style. We'll try switching
over again after 0.0.9 is obsolete.

Bugfix: when choosing an exit node for a new non-internal circ, don't take
into account whether it'll be useful for any pending x.onion addresses --
it won't.

Bugfix: we weren't actually publishing the hidden service descriptor when
it became dirty. So we only published it every 20 minutes or so, which
means when you first start your Tor, the hidden service will seem broken.


svn:r3360
2005-01-17 18:13:09 +00:00
Roger Dingledine
372832d8fe make tor-resolve print the Tor version on --version too
svn:r3358
2005-01-16 02:21:14 +00:00
Roger Dingledine
c6771e5ce4 reset published uptime when you wake up from hibernation,
since if you hibernate daily a published uptime of >1day
will be misleading.


svn:r3356
2005-01-14 17:49:25 +00:00
Roger Dingledine
dcf8b18215 when the hidden service launches a rendezvous circ, make sure it
provides good uptime if any virtual_port of the service wants that.


svn:r3355
2005-01-14 04:35:53 +00:00
Nick Mathewson
a38bccdca7 Move call to event_init() immediately after start_daemon(); move start_daemon earlier. This should fix using libevent with RunAsDaemon.
svn:r3354
2005-01-13 21:32:08 +00:00
Roger Dingledine
0aff4ff4cb get rid of 0.0.8 backwards compatibility
svn:r3353
2005-01-13 20:22:38 +00:00
Roger Dingledine
22f7934718 start generating version 1 style introduce cells
svn:r3352
2005-01-13 20:21:11 +00:00
Roger Dingledine
49fe4cba74 when deciding if a port is handled and the port demands uptime, don't
consider it handled if there's a circ that fits but isn't high-uptime.


svn:r3349
2005-01-13 07:23:19 +00:00
Roger Dingledine
abea142665 more cleanup
svn:r3347
2005-01-12 12:22:25 +00:00
Roger Dingledine
bafb3e4a5b fix another integer underflow caused by buckets going negative
svn:r3346
2005-01-12 12:19:00 +00:00
Roger Dingledine
24a97d2c55 fix up some comments
svn:r3345
2005-01-12 12:18:46 +00:00
Roger Dingledine
3809c0ab91 tolerate bandwidtch buckets going negative (i hope)
svn:r3344
2005-01-12 10:00:38 +00:00
Nick Mathewson
324b192f68 Make Tor use Niels Provos's libevent instead of it's current
poll-but-sometimes-select mess.  This will let us use faster async cores
(like epoll, kpoll, and /dev/poll), and hopefully work better on Windows
too.

There are some fairly nasty changes to main.c here; this will almost
certainly break something.  But hey, that's what alphas are for.


svn:r3341
2005-01-12 06:42:32 +00:00
Roger Dingledine
9b578f2fe2 add more chat and interactive protocols to LongLivedPorts
svn:r3340
2005-01-12 05:18:14 +00:00
Roger Dingledine
84c81e0783 Annotate circuits w/ whether they aim to contain high uptime nodes and/or
high capacity nodes. When building circuits, choose appropriate nodes.

New config option LongLivedPorts to indicate application streams
that will want high uptime circuits.

When attaching a stream to a circuit, pay attention to its requirements.

This means that every single node in an intro rend circuit, not just
the last one, will have a minimum uptime.

Boost the min uptime from an hour to 24 hours.


svn:r3339
2005-01-12 04:58:23 +00:00
Roger Dingledine
51f47d746e clean up smartlist_string_isin so callers don't have to manage bufs
themselves


svn:r3338
2005-01-12 04:53:53 +00:00
Roger Dingledine
70b3208f0a if somebody starts his tor server in jan 2004 and then fixes his
clock, don't make his published uptime be a year.


svn:r3337
2005-01-11 11:54:11 +00:00
Roger Dingledine
45eb8d9660 if you're a server and the auth dirservers are down, go to any other
server. only give up hope on network reachability when no other servers
are reachable either.


svn:r3335
2005-01-10 17:39:41 +00:00
Roger Dingledine
74bc4e5af0 help avoid overflow from len_in + (len_in/n)*len_ins
nick, do you think this does it? if so, we should maybe backport too.


svn:r3334
2005-01-10 16:30:51 +00:00
Roger Dingledine
4b6d55afdf separate time_of_process_start from stats_n_seconds_uptime:
now we reset uptime when a dir fetch entirely fails. this
hopefully has something to do with stability of being on the
network.


svn:r3333
2005-01-10 05:10:22 +00:00
Roger Dingledine
3370f53010 it helps to use the correct name for the struct
svn:r3331
2005-01-10 04:32:59 +00:00
Roger Dingledine
10a81ccf18 when pruning circuit-wait streams when a dir fetch failed,
refer in logs to the destination address, not the address of the
application connection.


svn:r3330
2005-01-10 02:47:50 +00:00
Roger Dingledine
f468ff04ea when we haven't fetched a directory yet, or the last time we
tried they were all unreachable, assume we are not connected to
the network.

when an application request comes in during this state, be
optimistic and assume we just reconnected. fetch a new directory
and if it works, begin making circuits.


svn:r3327
2005-01-07 15:57:57 +00:00
Roger Dingledine
608caffc64 fix unit tests: address has to be a non-private IP, and socksport
needs to be 0.


svn:r3324
2005-01-07 01:12:30 +00:00
Roger Dingledine
cd1f50d2f0 new config option DirAllowPrivateAddresses for authdirservers.
now by default they refuse router descriptors that have non-IP
or private-IP addresses.


svn:r3321
2005-01-06 21:03:27 +00:00
Nick Mathewson
91bafc476e Fix a fun bug: do not rewrite a cached directory back to the cache; otherwise we will think it is recent and not fetch a newer one.
svn:r3319
2005-01-06 20:11:52 +00:00
Roger Dingledine
f8b517fa97 finish marking my comment in main.c
svn:r3318
2005-01-06 19:20:54 +00:00
Roger Dingledine
1f51809e65 clean up string printing in relay logs
svn:r3317
2005-01-06 19:19:13 +00:00
Roger Dingledine
6d2859c2e5 fix trivial typo in log entry
svn:r3316
2005-01-06 19:17:01 +00:00
Nick Mathewson
a6e587305f typo spotted by chris
svn:r3308
2005-01-05 06:48:39 +00:00
Nick Mathewson
dcd228585d Implement SIGNAL control command.
svn:r3307
2005-01-05 06:40:47 +00:00
Nick Mathewson
b4fedc7f14 Stop reversing and re-reversing config lines: keep them in order all the time. Removes needless confusion and fixes bug #50.
svn:r3305
2005-01-05 06:05:37 +00:00
Nick Mathewson
e99f79fa4d Remove broken and undocumented wart where multiple CSV config lines are appended rather than replaced. Resolves bug #49
svn:r3301
2005-01-05 02:51:04 +00:00
Roger Dingledine
814dd946f0 fix duplicate dns_cancel_pending_resolve reported by Giorgos Pallas
svn:r3293
2005-01-04 11:26:08 +00:00
Roger Dingledine
ba7c74e742 bandaid: make Giorgos Pallas's dns assert bug not actually crash on him.
one day we should try to figure out what's actually going on here.


svn:r3280
2005-01-04 06:21:06 +00:00
Nick Mathewson
6dd91de3bd Nothing actually _uses_ socks_port, so why publish it? For backward compatibility, publish a socks_port of 0, and never read socks_port.
svn:r3279
2005-01-04 05:46:54 +00:00
Roger Dingledine
e6c1ab2daf post 0.0.9.x, demand that servers declare at least 20000 bytes/s
for bandwidthrate


svn:r3277
2005-01-04 03:46:50 +00:00
Nick Mathewson
4d30e2f4b8 Make sequence of log messages when starting on win32 with no config file more reasonable.
svn:r3275
2005-01-04 02:25:36 +00:00
Roger Dingledine
1f3e77bf92 make the initial temp log only notice-err, not info-err
svn:r3274
2005-01-04 02:25:18 +00:00
Roger Dingledine
82c5381ecb forward-port the fix for the compiler warning
svn:r3273
2005-01-04 01:16:20 +00:00
Roger Dingledine
d7a0f1a629 update print_usage to use new url
svn:r3267
2005-01-03 23:21:32 +00:00
Roger Dingledine
a005509c9d update url for when users try to use socksport as an http proxy
svn:r3265
2005-01-03 23:19:15 +00:00
Roger Dingledine
9e6d6c6096 Bugfix: we've been using openssl's BIO_get_mem_data incorrectly.
We assumed the pem-encoded data written by PEM_write_bio_RSAPrivateKey
is nul-terminated, and at least sometimes, it's not.


svn:r3263
2005-01-03 22:35:40 +00:00
Roger Dingledine
53c522ee1c make it clearer you can have multiple SocksBindAddress directives
svn:r3262
2005-01-03 21:47:59 +00:00
Nick Mathewson
d1fc7ad94b Log when we retry a directory connection
svn:r3258
2005-01-03 21:14:09 +00:00
Nick Mathewson
0c4186d6ee Use correct logic to decide whether there are more directory servers to retry.
svn:r3257
2005-01-03 20:51:24 +00:00
Nick Mathewson
65c4fa2614 Split mark-dir-failed-and-retry logic into separate function; make it retry runningrouters as well as directory fetches; note that the do-we-need-to-give-up test is wrong.
svn:r3256
2005-01-03 20:07:07 +00:00
Nick Mathewson
858eda4736 Fix an unused function warning
svn:r3255
2005-01-03 20:03:49 +00:00
Nick Mathewson
5f40d6bf72 Make directory fail-and-retry logic happen in connection_about_to_close(); fixes win32 bug.
svn:r3253
2005-01-03 19:51:10 +00:00
Nick Mathewson
b50263f740 More work on task #43: fix race conditions on multithreaded (win32) servers.
svn:r3251
2005-01-03 19:07:25 +00:00
Nick Mathewson
ead52e0bdc Possible fix for task #43: when running on a multithreaded environment (currently only windows), threads should not close opposite sides of their socketpairs, and workers should not call connection_free_all(). This may fix win32 servers.
svn:r3247
2005-01-03 18:06:51 +00:00
Nick Mathewson
fca7ba9777 Resolve task 42: find where 19-char nicknames were getting truncated when read from certs, and fix it. Also audit use of MAX_NICKNAME_LEN; no other badness found, but some docs/code cleaned up a touch.
svn:r3244
2005-01-03 17:53:20 +00:00
Roger Dingledine
59504f4831 bugfix: if a server uploads a descriptor that's unapproved, actually
tell him so.


svn:r3243
2005-01-03 17:47:32 +00:00
Roger Dingledine
70075933c6 stop checking for clock skew, even for servers.
this means we are vulnerable to an attack where somebody recovers
and uses a really old certificate. however, if they do that, they
probably can get our identity key just as easily.


svn:r3241
2005-01-03 17:10:32 +00:00
Roger Dingledine
fdf8c55f30 clarify the comments about logs in the torrc
svn:r3239
2005-01-02 06:34:58 +00:00
Roger Dingledine
b4dad0e6a4 fix the assert bug reported by bassclef@163.com
svn:r3237
2005-01-02 06:16:46 +00:00
Roger Dingledine
0d7e8660c7 add a comment to explain what ContactInfo is for
svn:r3236
2005-01-01 23:58:16 +00:00
Roger Dingledine
a4ad47df86 Fix a double-mark-for-close bug, where we were finding a conn
for a cell even if that conn is already marked for close.

Don't back-port to 0.0.9.x, since this fix could have weird implications.


svn:r3235
2005-01-01 07:54:01 +00:00
Roger Dingledine
35d5a5b712 when a dirserver causes you to give a warn, mention which dirserver it was
svn:r3234
2005-01-01 07:40:59 +00:00
Roger Dingledine
e29d7329b3 ...but only if you're a server
svn:r3233
2004-12-31 21:49:20 +00:00
Roger Dingledine
95f3e6161b require BandwidthRate to be at least 10kB/s
svn:r3232
2004-12-31 21:47:54 +00:00
Roger Dingledine
717fe4993e actually make it stop keeping track of times. whoops.
svn:r3230
2004-12-25 07:19:48 +00:00
Roger Dingledine
e1ac30c2bb stop calling assert_connection_ok(conn, time(NULL)) on every single
conn on every single loop.


svn:r3229
2004-12-25 06:43:40 +00:00
Roger Dingledine
288f2ed59e stop telling win32 folks they have a bug just because we haven't finished
making tor work on win32 yet.


svn:r3227
2004-12-25 06:42:15 +00:00
Roger Dingledine
be72937ab0 initial profiling by phobos says we spend a whole lot of time
measuring how long each cell takes to process. make that optional.


svn:r3226
2004-12-25 06:10:34 +00:00
Roger Dingledine
53105cdae5 when you're loading the rendezvous service keys in options_act(),
don't call it 'reloading'.


svn:r3225
2004-12-24 20:45:45 +00:00
Roger Dingledine
3a572fcffa don't connection_edge_end() on eof if we're already marked for close,
because if we are then it's because we already got an end.


svn:r3223
2004-12-24 09:43:57 +00:00
Nick Mathewson
ded8e79979 remove sentence-fragment comment refering to a design that never happened.
svn:r3220
2004-12-24 02:50:27 +00:00
Nick Mathewson
e8585dfe97 Remove length restriction when generating directories.
svn:r3218
2004-12-24 02:17:32 +00:00
Nick Mathewson
7117366810 Fix for running-routers length bug
svn:r3216
2004-12-24 01:41:52 +00:00
Roger Dingledine
f50b785c3b and forward port the cleanup
svn:r3211
2004-12-22 10:04:50 +00:00
Roger Dingledine
18320557a1 fix a crash: if you do socks4 with an IP of 0.0.0.x then we get tricked
into thinking you're doing socks4a, and we look for the next byte.

thanks to aphex for finding this.


svn:r3207
2004-12-22 09:52:29 +00:00
Roger Dingledine
c3189c2573 fix an assert on startup when the disk is full and you're logging to a file
svn:r3204
2004-12-22 08:16:42 +00:00
Roger Dingledine
cf17d0d29c move network_init from or/main to common/compat
call network_init in tor-resolve.c too
move tor_lookup_hostname from common/util to common/compat


svn:r3203
2004-12-22 05:29:06 +00:00
Roger Dingledine
036384fd8e respond to an 009 XXX
svn:r3201
2004-12-22 02:55:26 +00:00
Nick Mathewson
c79c4200f4 Fix a bug in last patch; and keep my name out of the assert() call too.
svn:r3200
2004-12-22 02:46:28 +00:00
Nick Mathewson
32978afa54 Workaround for brain-damaged __FILE__ handling on MSVC: keep Nick's name out
of the warning messages.


svn:r3199
2004-12-22 02:32:26 +00:00
Roger Dingledine
f9fd101869 forward port:
fix a fencepost: we were blowing away the \n when reporting confvalue items


svn:r3194
2004-12-21 02:57:25 +00:00
Roger Dingledine
308ffa8a05 When listing circuits that are pending on an opening OR connection,
if we're an OR we were listing circuits that *end* at us as
being pending on every listener, dns/cpu worker, etc. Stop that.


svn:r3171
2004-12-17 23:17:00 +00:00
Nick Mathewson
323b3a8dbc Bump repository version to tor-0.1.0.0-alpha-cvs. (First prerelease will be 0.1.0.1-alpha
svn:r3168
2004-12-17 21:17:44 +00:00
Roger Dingledine
ee282fc167 mark nickname and ORPort as the two required fields for servers
svn:r3156
2004-12-16 21:36:08 +00:00
Nick Mathewson
bbc10c2ea1 Make split(..., NULL) split on horizontal space; fix bug with tabs in config file.
svn:r3155
2004-12-16 21:10:51 +00:00
Nick Mathewson
e327b2f3a6 Clarify confusing message
svn:r3151
2004-12-16 05:23:48 +00:00
Roger Dingledine
29cf8a0a45 move us to 0.0.9.1
svn:r3150
2004-12-15 19:51:35 +00:00
Roger Dingledine
e1bc3f097e bugfix: when we're reporting event circuit status, don't call it a stream.
while we're at it, include ":port" in the stream event string.


svn:r3148
2004-12-14 03:36:33 +00:00
Roger Dingledine
b6173b7b68 0.0.9 broke hibernation. darn it.
svn:r3147
2004-12-13 19:42:46 +00:00
Nick Mathewson
75cefd8989 Remove bugfixes that did not actually do anything, before we start a cargo cult.
svn:r3145
2004-12-13 18:48:12 +00:00
Nick Mathewson
8c85c0bef8 Note that length checking on base64_decode is kinda conservative
svn:r3144
2004-12-13 18:38:19 +00:00
Nick Mathewson
1e71b83890 Fix a bug in parsing HashedControlPassword.
svn:r3143
2004-12-13 18:32:29 +00:00
Roger Dingledine
6cc7d32afc clarify a log entry
svn:r3142
2004-12-13 02:23:22 +00:00
Roger Dingledine
a8582ae223 note a future thing we should do
svn:r3141
2004-12-13 01:30:41 +00:00
Roger Dingledine
c0cb824857 move us to 0.0.9
svn:r3139
2004-12-13 00:52:35 +00:00
Roger Dingledine
011ad3cba5 clean up logging,
make it clearer which warns are bugs,
make the control log event match its specification,
point out a bug in how we deal with failure when renewing the tls context.


svn:r3138
2004-12-13 00:44:39 +00:00
Nick Mathewson
972124aab9 Only launch dns workers when we are actually starting a server.
svn:r3137
2004-12-13 00:09:00 +00:00
Roger Dingledine
464338b250 when hibernating, don't advertise any ports
this is important for the dirport, because clients will still
ask you for a directory, and they'll be sad when you're down.
and do the other ports too, because hey, they're not listening.


svn:r3133
2004-12-11 23:53:59 +00:00
Roger Dingledine
1477bf18e7 fix header text of torrc.sample
svn:r3129
2004-12-10 19:22:15 +00:00
Roger Dingledine
470cdea7f8 make the 64 bit args print correctly on 64 bit archs
svn:r3123
2004-12-08 12:30:20 +00:00
Nick Mathewson
fd4c624677 Belt *or* suspenders will be sufficient when casting things to unsigned char.
svn:r3122
2004-12-08 07:20:21 +00:00
Roger Dingledine
524a8bdc70 bump to 0.0.9rc7
svn:r3121
2004-12-08 01:14:56 +00:00
Nick Mathewson
fe6eb34a10 Solaris CC freaks out if isspace and friends get anything other than an int. We learned that, so we casted. But it is also a bad idea to cast a signed char to an int and expect things to work on win32. Now we cast to unsigned char, then to int, then pass to isspace. Ug
svn:r3120
2004-12-08 00:42:50 +00:00
Nick Mathewson
fc8a2596e1 Log contents of bw_accounting when we read it; fix memory leak.
svn:r3118
2004-12-07 23:20:10 +00:00
Roger Dingledine
ca95ed74ac resolve tequila's crash bug: you can't free something
and then keep using it.


svn:r3117
2004-12-07 21:57:37 +00:00
Roger Dingledine
ad4f440e10 rearrange debug logs to make more sense
svn:r3116
2004-12-07 21:57:10 +00:00