Commit Graph

2547 Commits

Author SHA1 Message Date
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
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
bd5524bfc7 fix comment
svn:r3110
2004-12-07 15:37:35 +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
Nick Mathewson
a6aa5eebd6 Fix some memory leaks and unlikely segfaults
svn:r3103
2004-12-07 07:48:16 +00:00
Roger Dingledine
3ff0077cbb bump us to 0.0.9rc7-cvs
svn:r3102
2004-12-07 07:37:01 +00:00
Roger Dingledine
2297c57ba5 note an improvement on our uname we might want to make one day
svn:r3101
2004-12-07 07:35:32 +00:00
Roger Dingledine
8f01b643c3 ORPort must be defined if ORBindAddress is defined.
svn:r3100
2004-12-07 06:51:46 +00:00
Nick Mathewson
0f49fd3bcd Fix leakable rsa key
svn:r3099
2004-12-07 06:48:02 +00:00
Roger Dingledine
e0e40e51ae clean up docs a bit for default log lines.
svn:r3098
2004-12-07 06:38:41 +00:00
Roger Dingledine
2ff38fdf83 when recommending new-format log lines, if the upper bound is LOG_ERR,
leave it implicit.


svn:r3097
2004-12-07 06:27:39 +00:00
Nick Mathewson
d19648b314 Renormalize whitespace
svn:r3095
2004-12-07 05:33:55 +00:00
Nick Mathewson
ac759adb43 Make unit tests work on win32
svn:r3094
2004-12-07 05:31:38 +00:00
Nick Mathewson
08e3090aff More win32 fixes: 1) tolerate extra "readable" events better. 2) when being multithreaded, leave parent fdarray open.
svn:r3092
2004-12-06 23:19:55 +00:00
Nick Mathewson
249a36586f Fix parse_iso_time on platforms without strptime.
svn:r3091
2004-12-06 22:39:10 +00:00
Roger Dingledine
4006246b9e bump us to 0.0.9rc6
svn:r3089
2004-12-06 06:27:39 +00:00
Roger Dingledine
f00631e6b9 answer resolved ip in network order
svn:r3087
2004-12-06 06:14:45 +00:00
Roger Dingledine
f10f24a61c avoid using uninitialized variable
svn:r3086
2004-12-06 06:07:57 +00:00
Roger Dingledine
0859d09352 don't use cache for resolving .foo.exit names, but do reply immediately
if we're asked to resolve an IP.foo.exit.


svn:r3085
2004-12-06 06:06:13 +00:00
Roger Dingledine
577665f608 fix indenting
svn:r3084
2004-12-06 05:26:19 +00:00
Roger Dingledine
f21564eb29 send an end to the streams we close when we hibernate, rather
than just chopping them off


svn:r3083
2004-12-05 13:02:18 +00:00
Roger Dingledine
1c9c813866 check if we have a cached resolve for a tor-resolve address *after*
we remove the .foo.exit part of the address.


svn:r3082
2004-12-05 12:47:46 +00:00
Roger Dingledine
5ba3328172 fix a minor leak in my recent commit
svn:r3081
2004-12-05 12:35:00 +00:00
Roger Dingledine
469135e7e2 talk about quotas rather than bandwidths, in the logs
svn:r3080
2004-12-05 12:26:02 +00:00
Roger Dingledine
50a314c931 int is not necessarily the same size as size_t
svn:r3079
2004-12-05 11:58:30 +00:00
Roger Dingledine
ef6c9d18e7 New circuit building strategy: keep a list of ports that we've used in the past 6 hours, and always try to have 2 circuits open or on the way
that will handle each such port. (We can extend this to include addresses
if exit policies shift to require that.) Seed us with port 80 so web
browsers won't complain that Tor is "slow to start up".

This was necessary because our old circuit building strategy just involved
counting circuits, and as time went by we would build up a big pile of
circuits that had peculiar exit policies (e.g. only exit to 9001-9100)
which would take up space in the circuit pile but never get used.

Fix router_compare_addr_to_addr_policy: it was not treating a port of *
as always matching, so we were picking reject *:* nodes as exit nodes too.

If you haven't used a clean circuit in an hour, throw it away, just to
be on the safe side.

This means after 6 hours a totally unused Tor client will have no
circuits open.


svn:r3078
2004-12-05 07:10:08 +00:00
Roger Dingledine
32e74d3525 fix comment
svn:r3077
2004-12-04 13:58:34 +00:00
Roger Dingledine
02b3229a04 plus add a comment re: the previous bug
svn:r3076
2004-12-04 10:18:41 +00:00
Roger Dingledine
52676364b9 bugfix: router_exit_policy_rejects_all() was broken, so we were
sometimes picking middleman nodes as our last hop, which wasn't
very useful.


svn:r3075
2004-12-04 08:56:59 +00:00
Roger Dingledine
2532e9405e Now we allow writing to the buffer even when the stream if marked for
close, if we're planning to wait to flush it.

This is important because we were sending a socks reject back if we're
closing and hadn't already sent one, but it wasn't actually getting
written since the conn was already marked-for-close.


svn:r3074
2004-12-04 07:13:37 +00:00
Roger Dingledine
5a6e117caf React to eof immediately on non-open edge connections.
Stop keeping track of num_retries for apconns, since they expire
after 60 seconds anyway.

When warning about retrying or giving up, print the address, so
the user knows which one it's talking about.


svn:r3073
2004-12-04 03:26:35 +00:00
Roger Dingledine
c644886c38 bugfix: When we were checking to see if an ap_conn should time out
waiting for its connected cell, we were calculating time from when the
ap_conn was created. So if it waited say 20 seconds before being attached,
then we would immediately decide that the circuit had timed out.

Also, make circuit_dump_by_conn() display actual circuit progress,
including circuits that haven't been attached to the conn yet but
hope to when it finishes connecting.


svn:r3072
2004-12-04 02:51:11 +00:00
Roger Dingledine
675f60aa13 whoops
just because it says snprintf doesn't mean it's a noop


svn:r3071
2004-12-04 01:23:04 +00:00
Nick Mathewson
fc87758ff3 Add function to check that addr_policy_t is okay; change struct addr_policy_t to addr_policy_t.
svn:r3070
2004-12-04 01:14:36 +00:00
Roger Dingledine
e694268644 bump us to 0.0.9rc6-cvs
darn these bugs


svn:r3069
2004-12-04 00:36:34 +00:00
Roger Dingledine
8d69dc472b make circuit building and router parsing less noisy
svn:r3068
2004-12-04 00:25:54 +00:00
Roger Dingledine
f79a7d8d62 while hibernating, hup should not regrow our listeners.
svn:r3067
2004-12-03 23:53:35 +00:00
Nick Mathewson
a980446d0c Be more proactive about noticing underflows: size_t values greater than 0x800...00 are likely to be trouble.
svn:r3064
2004-12-02 04:33:01 +00:00
Roger Dingledine
db5e100cde clean up 3 more underflow possibilities
svn:r3063
2004-12-02 04:31:52 +00:00
Roger Dingledine
0799804c60 fix redundant (and dangerous) NUL termination
svn:r3062
2004-12-02 04:16:18 +00:00
Nick Mathewson
e3f6f92cf7 check for duplicate circuit ID _after_ updating circ_id_type.
svn:r3058
2004-12-01 04:55:03 +00:00
Roger Dingledine
a3395e893f bump to 0.0.9rc5
svn:r3056
2004-12-01 04:32:51 +00:00
Roger Dingledine
82f3ebf195 move StatusFetchPeriod to 15 minutes so it's within bounds by default
svn:r3055
2004-12-01 04:27:11 +00:00
Roger Dingledine
ef04cfcbad one more typo
svn:r3054
2004-12-01 04:13:15 +00:00
Nick Mathewson
41ba4575b3 Fix windows build.
svn:r3053
2004-12-01 03:51:59 +00:00
Nick Mathewson
b457cfb5eb Spell-check strings and comments
svn:r3052
2004-12-01 03:48:14 +00:00
Nick Mathewson
6e88abf418 If we are using select, make sure we stay within FD_SETSIZE.
svn:r3051
2004-12-01 03:15:59 +00:00
Roger Dingledine
bde1d5bfb2 do even less inside our signal handler,
just to be extra paranoidly safe


svn:r3050
2004-12-01 02:54:13 +00:00
Nick Mathewson
a889926e1c Clarify chosen tag progression
svn:r3047
2004-11-30 16:07:20 +00:00
Roger Dingledine
3929f58018 clean obsolete circuit_log_path code
svn:r3046
2004-11-30 10:47:48 +00:00
Roger Dingledine
eb558d0a84 clean up the other "Tell Roger" log that dfc keeps getting
svn:r3042
2004-11-30 09:02:25 +00:00
Roger Dingledine
7a8c1ca1e4 a few minor tweaks
svn:r3041
2004-11-30 08:54:08 +00:00
Roger Dingledine
19ada3f7fa write down our "how to have two defaults for dirfetchperiod"
issue, so we don't forget about it.


svn:r3040
2004-11-30 08:44:19 +00:00
Roger Dingledine
1d4af1930c Let resolve conns retry/expire also, rather than sticking around forever.
Put the check-if-requested-exitrouter-will-reject-us code in the
circuit_attach loop, so it gets checked periodically and not just
once at the beginning. This is useful in case the routerlist changes,
but also in case the address gets resolved into something that we learn
we'll reject.


svn:r3039
2004-11-30 08:39:14 +00:00
Roger Dingledine
d383c23e73 refuse .exit addresses immediately if the requested node would
refuse the request (e.g. due to exit policy or wrong version)


svn:r3038
2004-11-30 08:15:09 +00:00
Nick Mathewson
5ec4e75cdb Make tor-resolve accept x.y.exit addresses again
svn:r3036
2004-11-30 07:06:05 +00:00
Nick Mathewson
bec7a1c6e8 use shorter minimum key lifetime until 008 is dead
svn:r3035
2004-11-30 06:44:07 +00:00
Nick Mathewson
f19e9b8577 doxygen uses backslashes, not forward-slashes
svn:r3033
2004-11-30 06:17:35 +00:00
Nick Mathewson
a3477223de clarify why strlcpy is safe in truncated log messages
svn:r3032
2004-11-30 06:15:06 +00:00
Nick Mathewson
a5d3325c5c Fix last patch
svn:r3031
2004-11-30 06:12:21 +00:00
Nick Mathewson
c8abe1907d Rename parse_address to parse_extended_hostname (since we have other kinds of addresses); make its output an enum; support HEXDIGEST.exit hostnames.
svn:r3029
2004-11-30 03:44:10 +00:00
Nick Mathewson
ebab451eed Make version parsing tests pass
svn:r3028
2004-11-30 03:41:06 +00:00
Nick Mathewson
fd68834b17 Give an early error if you pass a .onion or a .exit hostname to tor-resolve
svn:r3027
2004-11-30 03:12:37 +00:00
Nick Mathewson
ad7db5e43a Add casei versions of strcmpstart/strcmpend
svn:r3026
2004-11-30 03:10:56 +00:00
Nick Mathewson
ee7bef1458 Enforce coding style.
svn:r3025
2004-11-30 02:26:41 +00:00
Nick Mathewson
e764d00e15 If anybody set DirFetchPostPeriod, give them StatuFetchPeriod instead. Impose minima and maxima for all *Period options; impose even tighter maxima for fetching if we are a caching dirserver. Clip rather than rejecting. arma: are these good?
svn:r3024
2004-11-30 02:23:51 +00:00
Nick Mathewson
ce505f5033 note possible alternative for how to do CVS versions; ask arma which he likes.
svn:r3023
2004-11-29 23:06:51 +00:00
Nick Mathewson
6507be4290 Implement new version format for post 0.1.
svn:r3022
2004-11-29 23:04:26 +00:00
Nick Mathewson
7fbd297532 Suggestion from weasel: Make tor --version --version dump the cvs Id of every file.
svn:r3019
2004-11-29 22:25:31 +00:00
Nick Mathewson
aff5122685 Fetch cached running-routers from servers that serve it (that is, authdirservers, and servers running 0.0.9rc5-cvs or later.)
svn:r3018
2004-11-29 21:01:34 +00:00
Nick Mathewson
b6b07d1d98 Remove needless -2 in log code. This was not an underflow risk, sinze we only call format_msg from one place, where buf_len==10024
svn:r3017
2004-11-29 20:39:55 +00:00
Roger Dingledine
671a2de762 clean up the previous underflow check, and also point out
yet another one that may be a problem. nick?


svn:r3016
2004-11-29 08:40:24 +00:00
Roger Dingledine
c1dc17e6e2 put in initial support for ".nickname.exit" addresses, to let alice
decide what exit node to use; based on a patch by geoff goodell.

needs more work: e.g. it goes bananas building new circuits when the
chosen exit node's exit policy rejects the connection.


svn:r3015
2004-11-29 08:34:54 +00:00
Nick Mathewson
9ba7311c1c After implementing a feature, remember to disable the error message you used to get when requesting it.
svn:r3013
2004-11-29 07:59:00 +00:00
Nick Mathewson
eccfe23a21 Disallow NDEBUG. It is very stupid.
svn:r3012
2004-11-29 07:22:57 +00:00
Roger Dingledine
531c060b36 fix integer underflow in tor_vsnprintf()
(probably exploitable)


svn:r3011
2004-11-29 06:49:04 +00:00
Roger Dingledine
185f047450 prevent integer underflow
(not currently exploitable, ilja and i think)


svn:r3010
2004-11-29 06:43:21 +00:00
Roger Dingledine
9811f68310 bump to 0.0.9rc5-cvs
svn:r3009
2004-11-29 01:00:54 +00:00
Roger Dingledine
7fc30fc1e6 accept *:706 (silc) by default
svn:r3006
2004-11-28 15:49:12 +00:00
Roger Dingledine
22727b4edc wrong is ok, and right is fine, but in between is apparently
totally unacceptable to me.


svn:r3005
2004-11-28 11:39:53 +00:00
Nick Mathewson
f7c6ad065e correct multiple internal spaces
svn:r3004
2004-11-28 09:14:07 +00:00
Nick Mathewson
6f5dbefa7e Normalize space: add one between every control keyword and control clause.
svn:r3003
2004-11-28 09:05:49 +00:00
Roger Dingledine
67dc7baa59 bump to 0.0.9rc4
svn:r3001
2004-11-28 06:44:08 +00:00
Roger Dingledine
dad760ddd1 one of the debugging aids was misleading
svn:r3000
2004-11-28 06:33:14 +00:00
Nick Mathewson
32651dd108 connect() on win32 can do more things than we thought?
svn:r2999
2004-11-28 05:58:55 +00:00
Nick Mathewson
0702179d28 Very oops. make windows nonblocking sockets nonblocking
svn:r2998
2004-11-28 05:57:18 +00:00
Nick Mathewson
f77ff938b7 remember; tor_socket_errno has side effects!
svn:r2997
2004-11-28 05:48:02 +00:00
Roger Dingledine
40c97ac504 move the rendezous section of the torrc to the middle, since
it isn't server-only, and indeed it may be unwise to run a
hidden service on a server.


svn:r2995
2004-11-27 08:18:22 +00:00
Roger Dingledine
e5e45fe980 inform him more sanely
svn:r2993
2004-11-26 04:19:03 +00:00
Roger Dingledine
a7f92d7ffe inform the user that you noticed when he sent a USR2
svn:r2992
2004-11-26 04:17:57 +00:00
Roger Dingledine
81dad3e08b that's enough changes to bump to rc4-cvs
svn:r2991
2004-11-26 04:08:07 +00:00
Roger Dingledine
f9a0ab62b7 if you want to handle -USR2, you should catch it too.
svn:r2990
2004-11-26 04:03:19 +00:00
Roger Dingledine
7c9a707900 remove emacs droppings, since nick says he doesn't need them anymore
svn:r2989
2004-11-26 04:00:55 +00:00
Roger Dingledine
02a30a348a give up trying to track down the reason we're calling package_inbuf
with a package window of 0. it's safe to just catch the error cases
there and do the right thing.


svn:r2988
2004-11-26 03:43:54 +00:00
Roger Dingledine
179ad27b34 call set_max_file_descriptors() after we configure logs, so
it doesn't always do loglevel info logs on windows.


svn:r2987
2004-11-26 03:05:55 +00:00
Roger Dingledine
e24057b2bf when warning that a version is too new, don't use the confusing
text "is_obsolete_version():".


svn:r2986
2004-11-25 05:49:13 +00:00
Roger Dingledine
d254aeb09e bump to 0.0.9rc3
svn:r2984
2004-11-25 05:40:06 +00:00
Nick Mathewson
f91152ce6a Clarify a bunch of log messages
svn:r2983
2004-11-25 04:20:10 +00:00
Peter Palfrader
f2a96ce1fe Flush the logfd after we print "Tor opening log file", so we don't see those messages days later
svn:r2980
2004-11-24 08:42:06 +00:00
Roger Dingledine
914d346095 update conn_state_to_string
svn:r2979
2004-11-24 07:58:15 +00:00
Roger Dingledine
a2042a8b1d a little help for dfc to debug his "resolve 800 things at once" test
svn:r2978
2004-11-24 07:51:30 +00:00
Roger Dingledine
c89afb7917 avoid infinite loop in tor-resolve if tor hangs up on it
svn:r2977
2004-11-24 07:45:42 +00:00
Roger Dingledine
83e7043eb8 don't process marked-for-close conns further.
(fix assert trigger -- if we're lucky.)


svn:r2975
2004-11-24 06:41:58 +00:00
Roger Dingledine
7d55f3685e make tor-resolve work, uh, more. this time for sure!
svn:r2974
2004-11-24 06:16:36 +00:00
Roger Dingledine
cca469ec58 make tor-resolve work again
svn:r2973
2004-11-24 06:01:52 +00:00
Roger Dingledine
0eebfe3558 bugfix: let socks do multiple rounds of negotiation again
(which is needed for socks5)


svn:r2970
2004-11-24 04:35:28 +00:00
Roger Dingledine
090c84627c patch to nick's patch
svn:r2969
2004-11-24 03:58:45 +00:00
Nick Mathewson
74f74a06c6 make nt service version match actual version
svn:r2968
2004-11-24 00:55:39 +00:00
Nick Mathewson
e84f964aad bump windows version stuff to 009rc2
svn:r2967
2004-11-24 00:33:30 +00:00
Nick Mathewson
1bec1b3d37 Better notice for hibernate interval spans; when estimate is 0, start out awake.
svn:r2963
2004-11-23 22:34:23 +00:00
Nick Mathewson
5fa55c8317 Bugfix: when no units are given, default to seconds or bytes.
svn:r2960
2004-11-23 10:52:27 +00:00
Roger Dingledine
a284b0db8f another slightly less confusing message
nick: we need to figure out if we should say anything different
here when the wake-up time and the expected back-to-sleep time
have both passed.


svn:r2956
2004-11-23 10:05:56 +00:00
Roger Dingledine
b6cb547667 less confusing message upon hibernation
svn:r2955
2004-11-23 09:21:03 +00:00
Roger Dingledine
921c40abe7 fail more gracefully next time
svn:r2954
2004-11-23 09:01:37 +00:00
Roger Dingledine
57a392d8d8 initialize rephist before we init_from_config, since init_from_config
can make us init_keys if we're going to hibernate, which makes us build
a router_desc.


svn:r2953
2004-11-23 09:00:55 +00:00
Roger Dingledine
d7fb38cfe3 update unit tests to reflect changed interface
svn:r2952
2004-11-23 08:36:26 +00:00
Roger Dingledine
7ed738b34c fix some typos; move to 0.0.9rc1
svn:r2951
2004-11-23 07:37:25 +00:00
Nick Mathewson
f5319a010d Dr. Seuss on iterating circular lists: "It's fun to have fun, but you
have to know how."


svn:r2948
2004-11-23 06:08:08 +00:00
Nick Mathewson
0a58bbe0dd Fix critical bug in circuit_list_path: cpath is a circular list! (Also reimplement circuit_log_cpath using circuit_list_cpath).
svn:r2946
2004-11-23 00:11:36 +00:00
Nick Mathewson
cd70264377 Clean up some logging and interfaces
svn:r2945
2004-11-23 00:08:26 +00:00
Nick Mathewson
22dba27d8d Normalize a few more kinds of whitespace. We now dislike:
- func (args)
  - if (x){
This doesn't normalize if(x), for(x); while(x), and friends.


svn:r2943
2004-11-22 23:28:26 +00:00
Nick Mathewson
fe32c2d141 Fix sign-related warnings
svn:r2942
2004-11-22 22:50:17 +00:00
Nick Mathewson
d4754b334c Compile cleanly on windows; prevent some insane bandwidth cases (e.g., "BandwidthBurst 1000 TB" from occuring.
svn:r2941
2004-11-22 22:24:10 +00:00
Nick Mathewson
983a335f3b Normalize space
svn:r2939
2004-11-22 22:13:34 +00:00
Nick Mathewson
f17c08beed Apply NT service patch from Osamu Fujino. This still has some problems (indicated in a comment adapted from the patch submission email), but it is better than before and better than nothing.
svn:r2938
2004-11-22 22:10:37 +00:00
Nick Mathewson
956b463dfe Implement weekly/monthly/daily accounting
svn:r2936
2004-11-22 21:56:51 +00:00
Nick Mathewson
55df2620c6 Add function to format local time in ISO format
svn:r2935
2004-11-22 21:38:44 +00:00
Nick Mathewson
805c9e3673 Absolutely never call close_temp_logs while validating log options.
svn:r2934
2004-11-22 20:08:07 +00:00
Roger Dingledine
4f2c2c9948 The crowning bugfix.
The problem was that with high load, circuit package window was
reaching 0. Whenever we got a circuit-level sendme, we were
reading a lot on each socket, but only writing out a bit. So we
would eventually reach eof. This would be noticed and acted on
even when there are still bytes sitting in the inbuf.


svn:r2932
2004-11-21 11:30:33 +00:00
Roger Dingledine
27b8797245 clean up some more.
i think i'm getting closer.


svn:r2931
2004-11-21 11:20:28 +00:00
Roger Dingledine
310a8da0d2 break reached_eof() out of process_inbuf()
svn:r2930
2004-11-21 10:14:57 +00:00
Roger Dingledine
671d84dc2f some more debugging aids
svn:r2929
2004-11-21 09:39:01 +00:00
Roger Dingledine
6a516dfdd3 be more greedy about filling up all relay cells.
this may have some bugs in it still.
and it may end up not being what we want to do.


svn:r2928
2004-11-21 07:43:12 +00:00
Nick Mathewson
bb18d4238f Dont keep rephist info for routers that havent had activity for 24 hours.
svn:r2926
2004-11-21 05:14:46 +00:00
Nick Mathewson
bdb61f2a04 fix typo
svn:r2925
2004-11-21 05:06:22 +00:00
Nick Mathewson
36f4e15e81 Call init_keys() where needed; fix hibernate bug.
svn:r2924
2004-11-21 04:19:04 +00:00
Nick Mathewson
bfc2e95230 Bump windows version
svn:r2923
2004-11-21 04:18:36 +00:00
Roger Dingledine
a4b1eb5630 allow StrictEntryNode and StrictExitNode to be singular
svn:r2922
2004-11-20 23:16:03 +00:00
Roger Dingledine
73da4bad46 stop some more seg faults
svn:r2921
2004-11-20 12:55:41 +00:00
Roger Dingledine
63353462f8 if your requested exit node has bandwidth 0, pick it anyway
svn:r2920
2004-11-20 12:41:05 +00:00
Roger Dingledine
d4ac7300d6 and a comment so i don't try to 'fix' it again later
svn:r2919
2004-11-20 12:17:19 +00:00
Roger Dingledine
246b14d8e9 yes, in fact, i broke it. putting back.
svn:r2918
2004-11-20 12:16:47 +00:00
Roger Dingledine
6322287dc1 printfs want carriage returns
svn:r2917
2004-11-20 08:00:57 +00:00
Roger Dingledine
dd19cf6ba3 kill -USR2 now moves all logs to loglevel debug
plus fix some typos


svn:r2914
2004-11-20 07:33:55 +00:00
Roger Dingledine
a30a5bce0f simplify close_temp_logs()
(nick, did i break this?)


svn:r2913
2004-11-20 07:08:00 +00:00
Roger Dingledine
a8840db4ac remove another possible sigpipe cause
svn:r2912
2004-11-20 06:52:13 +00:00
Nick Mathewson
8acaf8e187 Add "MEMUNIT" and "INTERVAL" types to configuration. Also tweak Accounting setup. More docs needed
svn:r2911
2004-11-20 00:37:00 +00:00
Roger Dingledine
2e4763655d bugfix: when our poll is interrupted, we believed the revents values.
svn:r2907
2004-11-17 20:26:39 +00:00
Nick Mathewson
647c076c8f add a TODO item and some comment changes.
svn:r2904
2004-11-16 03:32:01 +00:00
Roger Dingledine
3e4f30fbb9 bump us to 0.0.9pre6
svn:r2902
2004-11-16 03:29:09 +00:00
Roger Dingledine
abdf073f14 minor fixes
svn:r2901
2004-11-16 03:12:53 +00:00
Nick Mathewson
89a456a1d4 Fix a fun bug in read_all that was corrupting config files on windows, and probably doing other bad stuff too.
svn:r2898
2004-11-16 00:08:56 +00:00
Nick Mathewson
6143c515cd Make log_fn not fail so miserably on VC6
svn:r2896
2004-11-15 23:30:26 +00:00
Nick Mathewson
d63d5cb139 Whitespace normalization
svn:r2895
2004-11-15 23:29:24 +00:00
Nick Mathewson
5b668d8557 ugly macros to make log_fn play nice on non-GCC compilers.
svn:r2894
2004-11-15 21:18:07 +00:00
Nick Mathewson
7a8ac5dfef Tweak on patch to make authoritative directory servers cache
directories on disk.  Make authdirservers cache *their own*
directories instead of the ones they download.  This gives better
liveness, and marginally better resistance to broken authdirservers.

Authdirservers don't cache running-routers at all: r-r isn't stored to
disk, so there's no point right now.


svn:r2893
2004-11-15 16:17:59 +00:00
Roger Dingledine
dbd4dadff7 Authoritative dirservers now also cache the directory, since
they weren't writing anything into their datadirectory, so
when they stop and start, they would know nothing until they
fetched a directory from another authdirserver.


svn:r2891
2004-11-15 09:38:17 +00:00
Roger Dingledine
50c15943a2 move second stat to a cleaner place
svn:r2890
2004-11-15 09:22:01 +00:00
Roger Dingledine
4b76fe8036 Break DirFetchPostPeriod into:
- DirFetchPeriod for fetching full directory,
  - StatusFetchPeriod for fetching running-routers,
  - DirPostPeriod for posting server descriptor,
  - RendPostPeriod for posting hidden service descriptors.

Also make sure the hidden service descriptors are at a random
offset from each other, to hinder linkability.


svn:r2889
2004-11-15 09:05:54 +00:00
Roger Dingledine
67aa3b66c5 clean up socks handling, refuse connections to port 0
svn:r2888
2004-11-15 07:50:15 +00:00
Roger Dingledine
72dd656b88 a first cut at a print_usage()
svn:r2887
2004-11-15 07:29:27 +00:00
Nick Mathewson
c909a8a64b Only record bandwidth usage when accounting is enabled
svn:r2886
2004-11-15 04:48:53 +00:00
Nick Mathewson
930464c889 Change "warn if unverified routers are very skewed" to "never warn about unverified router skew"
svn:r2885
2004-11-15 04:28:24 +00:00
Nick Mathewson
22a0d82749 Cache running-routers; compress running-routers; serve compressed running-routers.z
svn:r2883
2004-11-15 04:04:20 +00:00
Nick Mathewson
076f120951 Patch to patch: do not send both error and done for one command.
svn:r2882
2004-11-15 04:02:59 +00:00
Roger Dingledine
ee591be3f2 fix a bug in configuring accounting in options_act()
svn:r2881
2004-11-15 04:01:31 +00:00
Roger Dingledine
47993ae6fb some fixes so far
svn:r2880
2004-11-15 03:53:03 +00:00
Nick Mathewson
5109159ff9 Fix compilation. Duh.
svn:r2876
2004-11-14 22:53:51 +00:00
Nick Mathewson
3e6edf20cc Resolve some hibernating-related XXXX009s.
svn:r2875
2004-11-14 22:21:23 +00:00
Nick Mathewson
402c75fb06 Allow more clock skew from unrecognized hosts than from recognized ones.
svn:r2874
2004-11-14 22:08:25 +00:00
Nick Mathewson
ffe9b01ad7 Split X509 certificate liveness checks into a separate function
svn:r2873
2004-11-14 22:07:48 +00:00
Nick Mathewson
57536f138a Fetch running-routers.
Split logic to initiate dirfetch, running-routers fetch, and
descriptor post.  arma: There are some XXXs here that raise design
questions which we should solve before the next release.

The biggest problem is this: Right now, the directory is about 50X as
large as running-routers uncompressed, and about 36X as large
compressed.  Assuming:

    - everybody gets the compressed version of everything,

    - everybody gets cached directories from random dirservers and
      uncached r-r from authdirservers

    - everybody downloads r-r at the same rate they now download dirs,

then using r-r from will *increase* authdirserver directory bandwidth usage
if there are significantly more caches than authdirservers.

I think it's safe to leave this in for now, since there aren't 3x36 caching
dirservers, but we should make everybody with a dirport cache running-routers
soon.  But I could be wrong.


svn:r2872
2004-11-14 21:46:40 +00:00
Nick Mathewson
2078b136f6 Make running-routers fetch (apparently) work
svn:r2871
2004-11-14 21:35:30 +00:00
Nick Mathewson
bb80d60fe7 Hibernate if we start tor during the "wait for wakeup-time" phase of an accounting interval. Log our hibernation plans better.
svn:r2869
2004-11-14 21:11:06 +00:00
Nick Mathewson
a732727a2b Add simpler option_is_same, as suggested by arma. Finish implementing SAVECONF
svn:r2868
2004-11-14 20:51:28 +00:00
Nick Mathewson
270b942edf Note where torrc goes.
svn:r2865
2004-11-14 19:08:08 +00:00
Nick Mathewson
26973578bf Fix windows whitespace
svn:r2860
2004-11-14 18:21:17 +00:00
Nick Mathewson
aba71028be Add an unreachable return 0.
svn:r2859
2004-11-14 18:20:12 +00:00
Nick Mathewson
05d5996410 Fix cast warning in tor-resolve.c
svn:r2857
2004-11-14 18:14:15 +00:00
Nick Mathewson
4f835673be Remove redundant declaration
svn:r2855
2004-11-14 17:22:10 +00:00
Nick Mathewson
783bbcf471 Fix "implicit declaration of ftello" warning: add AC_FUNC_FSEEKO in configure.in and always include orconfig.h before anything else
svn:r2854
2004-11-14 17:21:32 +00:00
Roger Dingledine
846f71dcca make kill -USR1 work again
svn:r2853
2004-11-14 13:35:47 +00:00
Roger Dingledine
5dcc6fd8b2 ok ok the stat wasn't redundant
but the warn was


svn:r2852
2004-11-14 13:35:39 +00:00
Roger Dingledine
14c7ad409f remove redundant stdio.h
i guess that wasn't the fix


svn:r2849
2004-11-14 09:49:27 +00:00
Roger Dingledine
bd4d99b3fe clean up the ftello call a little bit.
but i'm still getting:
log.c:94: warning: implicit declaration of function `ftello'


svn:r2848
2004-11-14 09:48:54 +00:00
Roger Dingledine
4564367b2a Remove redundant stat() for reading cached directory, and remove
confusing warn when the cached directory isn't there yet.


svn:r2847
2004-11-14 09:40:07 +00:00
Roger Dingledine
3f5c113815 clean a comment
svn:r2844
2004-11-14 04:55:02 +00:00
Nick Mathewson
ed4fa18699 normalize whitespace
svn:r2839
2004-11-13 23:34:01 +00:00
Nick Mathewson
ae7821bd88 Bump windows version
svn:r2838
2004-11-13 23:28:16 +00:00
Nick Mathewson
aab929abe0 Use the data, *then* free it. It works so much better.
svn:r2837
2004-11-13 23:27:50 +00:00
Nick Mathewson
dc48e7aeed Document remaining configuration options; add a ccheck for redundant authentication mechanisms in options_validate; add TODO items for post-009 hibernation features
svn:r2833
2004-11-13 17:17:04 +00:00
Nick Mathewson
08627d5d87 Track whether descriptor is dirty/uploaded. When any options are set, mark it dirty. Once a minute, regenerate and upload the server descriptor if it is dirty.
svn:r2832
2004-11-13 16:53:48 +00:00
Nick Mathewson
0b42e31fe0 Comment a confusing conditional
svn:r2828
2004-11-13 02:54:30 +00:00
Roger Dingledine
5864f4ac01 fix a seg fault when fetching rendezvous descs
svn:r2825
2004-11-12 21:59:27 +00:00
Nick Mathewson
a3788d5c9d Fix argument to strncpy.
svn:r2824
2004-11-12 21:14:51 +00:00
Nick Mathewson
a8f9ba91db Nobody was using the return values from smartlist_(set|del|del_keeporder), so remove them.
svn:r2823
2004-11-12 21:14:06 +00:00
Nick Mathewson
238a895e69 Add a FAST_SMARTLIST define to optionally inline smartlist_get and smartlist_len, which are two major profiling offenders.
svn:r2822
2004-11-12 20:41:52 +00:00
Nick Mathewson
c466b7e72f Speed up tor_strndup a lot: profiling suggests that our use of strlcpy here was a bad idea.
svn:r2821
2004-11-12 20:41:03 +00:00
Nick Mathewson
eabcf6618e Write most of the implementation for SAVECONF.
svn:r2820
2004-11-12 20:09:54 +00:00
Nick Mathewson
5109de5626 Rename exit_policy to addr_policy, since it gets used for SOCKS and directory connections too. Make all policies get validated in options_validate, and make SOCKS/directory policies get set in options_act.
svn:r2819
2004-11-12 19:39:13 +00:00
Peter Palfrader
a1e7ad4855 Fix two comments in torrc.sample.in directly in the upstream source
svn:r2812
2004-11-12 17:04:42 +00:00
Nick Mathewson
60880cda84 Resolve a bunch of FIXME items; mark a lot more for attention; ask for clarification on some. Turn all XXXX008 ("showstopper for 0.0.8 release") items into XXXX009 or XXXX, since plainly they were not showstoppers for 0.0.8. Add/clean some docs.
svn:r2808
2004-11-12 16:39:03 +00:00
Nick Mathewson
2a5bcb29e6 Resolve FIXME: Possible solution to note_disconnect problem; needs thought and review.
svn:r2807
2004-11-12 05:52:19 +00:00
Nick Mathewson
5d92fbe30e Use autoconf to enable largefile support where necessary. Use ftello where available, since ftell can fail at 2GB.
svn:r2806
2004-11-12 05:05:41 +00:00
Nick Mathewson
0faab62cd9 Resolve FIXMES: sometimes an error code is just an error code
svn:r2805
2004-11-12 05:03:50 +00:00
Roger Dingledine
90e0ad517e dfc caught a SIGXFSZ error when his debugfile reached 2GB.
so if they exist, catch them and ignore them.
write() will fail normally and we'll look at errno like
normal human beings.


svn:r2804
2004-11-12 04:59:37 +00:00
Roger Dingledine
c106ab8315 clean torrc sample
change log files to end in .log for logrotate to notice
mention that address doesn't need to be defined


svn:r2803
2004-11-12 04:00:07 +00:00
Roger Dingledine
fde595feb7 when clients do --list-fingerprint, it's misleading to
give them one, because it will never be the same again


svn:r2800
2004-11-11 13:24:10 +00:00
Nick Mathewson
6252cba522 apply patch from Andre Eisenbach: include event code with events, as required by control-spec.txt
svn:r2799
2004-11-11 00:54:53 +00:00
Nick Mathewson
e69d9647ed Remove XXXX009 comment telling us to do the last (circID-related) fix
svn:r2798
2004-11-10 20:19:45 +00:00
Nick Mathewson
954570486f Resolve a FIXME: use identity comparison, not nickname comparison, to
choose circuit ID types.  This is important because our view of "the
nickname of the router on the other side of this connection" is
skewed, and depends on whether we think the other rotuer is
verified--and there's no way to know whether another router thinks you
are verified.

For backward compatibility, we notice when the other router chooses
the same circuit ID type as us (because it's running an old version),
and switch our type to be polite.


svn:r2797
2004-11-10 20:14:37 +00:00
Nick Mathewson
ec49905fb8 When we think we have no bandwidth, guess that we will run for 1 day.
svn:r2795
2004-11-10 19:32:44 +00:00
Nick Mathewson
9c22b428bf Clarify a warning about /.tor
svn:r2794
2004-11-10 14:29:18 +00:00
Nick Mathewson
a43db78e8d Resolve FIXME items: make the kill-unattached-AP timeout symbolic
svn:r2793
2004-11-10 14:28:47 +00:00
Nick Mathewson
c9af37d1ba Resolve FIXME items: make circuit_free_cpath_node static
svn:r2792
2004-11-10 14:28:04 +00:00
Nick Mathewson
fde4129ac3 Resolve FIXME items: clarify two XXXX comments for 009
svn:r2791
2004-11-10 14:27:26 +00:00
Nick Mathewson
aa1c0c4d67 Resolve FIXME items: fix assert failure on malformed socks4a qreuests. (bug reported by Anna Shubina wrt old Netscapes)
svn:r2790
2004-11-10 14:26:34 +00:00
Nick Mathewson
8de9cfe184 Resolve FIXME items: make expand_filename handle ~ and ~username
svn:r2789
2004-11-10 14:23:31 +00:00