Commit Graph

1848 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
b4dad0e6a4 fix the assert bug reported by bassclef@163.com
svn:r3237
2005-01-02 06:16:46 +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
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
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
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
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
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
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
470cdea7f8 make the 64 bit args print correctly on 64 bit archs
svn:r3123
2004-12-08 12:30:20 +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
Roger Dingledine
33cf6f2f61 clean two more minor memory leaks
svn:r3115
2004-12-07 19:42:45 +00:00
Nick Mathewson
06ce31b948 Only set a cookie when we intend to.
svn:r3114
2004-12-07 19:36:43 +00:00
Roger Dingledine
e93077c82a fix a minor leak for people offering hidden services
svn:r3113
2004-12-07 17:49:14 +00:00
Roger Dingledine
29a8e80326 log bytes written with kill -USR1 too
svn:r3112
2004-12-07 16:50:47 +00:00
Roger Dingledine
012255fe60 fix the other half of the pipe race
svn:r3111
2004-12-07 16:37:32 +00:00
Roger Dingledine
538c3b0c26 avoid a sigpipe from a race: if we get the end right after
the app has hung up on us, we shouldn't hold-open-until-flush.


svn:r3109
2004-12-07 15:31:54 +00:00
Roger Dingledine
802d374a99 I'm a bad person.
Stop treating the uint16_t's as null-terminated strings,
and stop looking at the byte after them to see if it's null,
because sometimes you're not allowed to look there.


svn:r3108
2004-12-07 15:29:54 +00:00
Roger Dingledine
a2d80ec767 were we on crack??
svn:r3107
2004-12-07 09:18:25 +00:00
Roger Dingledine
41b809d2aa salvage another 300 bytes per hup
svn:r3106
2004-12-07 09:11:38 +00:00
Roger Dingledine
d9f86e2782 and bust another memory leak
svn:r3105
2004-12-07 08:58:26 +00:00
Roger Dingledine
5d961c2c06 plug another memory leak
svn:r3104
2004-12-07 08:51:10 +00:00