Nick Mathewson
4e735da5da
Also set event_mask=0 in connection_free_all, and dont send events to marked control conns (for good measure)
...
svn:r4729
2005-08-07 19:27:38 +00:00
Roger Dingledine
5c4da9dec6
incomplete patch for matt's info controller signal term bug
...
svn:r4728
2005-08-07 19:20:55 +00:00
Nick Mathewson
303258972b
Fix idiot bug. The "free the IP history" code belons in connection_free_all(), not in connection_free(). You can all mock me now.
...
svn:r4691
2005-08-04 18:29:01 +00:00
Nick Mathewson
11ff0aba80
Make clients regenerate their keys when their IP address changes.
...
svn:r4688
2005-08-03 20:42:17 +00:00
Nick Mathewson
18c11eb3bc
Be consistent about preferring foo* to struct foo*
...
svn:r4637
2005-07-22 21:12:10 +00:00
Nick Mathewson
c3a62c1739
Initial, somewhat dodgy implementation of helper nodes. It has too many XXXXs, it logs too verbosely, and it doesnt do persistence.
...
svn:r4633
2005-07-22 17:32:25 +00:00
Roger Dingledine
452c98058f
missed one
...
svn:r4567
2005-07-14 23:08:55 +00:00
Roger Dingledine
d8d0feb633
tell us what kind of listener it is, too
...
svn:r4566
2005-07-14 23:07:05 +00:00
Nick Mathewson
f86a1e634f
fix opening listener log msg
...
svn:r4565
2005-07-14 23:04:31 +00:00
Nick Mathewson
e94f95a716
Populate address field of listeners with an actually sane value.
...
svn:r4564
2005-07-14 22:56:17 +00:00
Roger Dingledine
2259032ea1
trivial changes on nick's rendezvous commit
...
svn:r4553
2005-07-14 08:43:19 +00:00
Nick Mathewson
cf13b3e4a6
Macro-fu to get DEBUG events working.
...
svn:r4539
2005-07-13 05:14:42 +00:00
Nick Mathewson
658e1196d0
Change retry_listeners: when force is false, close and re-open a minimal set of listeners (i.e., those that do not match the configuration). This fixes a possible bug on some windowses. Maybe.
...
svn:r4528
2005-07-11 17:20:22 +00:00
Nick Mathewson
f9f09f1c5e
Start implementing framework for revised control spec.
...
svn:r4447
2005-06-17 18:49:55 +00:00
Nick Mathewson
d4972bd2e1
Remove code that has been #if-0ed for a long time.
...
svn:r4435
2005-06-15 18:34:46 +00:00
Nick Mathewson
232861ba42
Docment or add DOCDOC comments to undocumented functions in src/or. Make function definition format uniform.
...
svn:r4411
2005-06-11 18:52:12 +00:00
Roger Dingledine
2587fa09f9
move more docs into our code
...
svn:r4406
2005-06-11 06:07:22 +00:00
Nick Mathewson
0831823763
Change end-of-file NLNL convention. It turns out arma I and I agree.
...
svn:r4382
2005-06-09 19:03:31 +00:00
Roger Dingledine
cfc89f8753
pay more attention to the ClientOnly config option
...
svn:r4367
2005-06-09 08:54:42 +00:00
Roger Dingledine
aff308e6d9
reenable the part of the code that tries to flush as soon as an OR outbuf
...
has a full tls record available. perhaps this will make OR outbufs not grow
as huge except in rare cases, thus saving lots of cpu time plus memory.
svn:r4343
2005-06-08 04:55:06 +00:00
Roger Dingledine
040a748d87
i screwed up the dirport reachability testing when we don't yet
...
have a cached version of the directory. hopefully now fixed.
svn:r4284
2005-05-23 05:20:52 +00:00
Roger Dingledine
b86716b839
If a socks connection ends because read fails, don't warn that you're
...
not sending a socks reply back. (bug reported by Warren Barrow)
svn:r4277
2005-05-21 00:15:23 +00:00
Roger Dingledine
f0e309e5bd
add HttpProxyAuthenticator config option too
...
svn:r4272
2005-05-20 08:51:45 +00:00
Roger Dingledine
b7d6b8a397
doxygeny goodness from tyranix
...
svn:r4262
2005-05-17 17:01:36 +00:00
Nick Mathewson
10b2208d93
Make Tor compile with no warnings with gcc4.0 on OSX
...
svn:r4184
2005-05-07 05:55:06 +00:00
Roger Dingledine
5265bbd2b8
first iteration of scrubbing sensitive strings from logs.
...
also generally clean up log messages.
svn:r4174
2005-05-03 10:04:08 +00:00
Nick Mathewson
a312ce1d3b
Change buffer shrinking strategy: only try to shrink once every 3 minutes. Do not try to read over buffer size unless buffer is nearly empty.
...
svn:r4165
2005-05-02 23:17:08 +00:00
Nick Mathewson
fe65e57ca1
Re-do fragmented control message handling to work with new buf_t system.
...
svn:r4144
2005-04-27 22:01:34 +00:00
Nick Mathewson
9ba2dd7ea1
Clean/renormalize whitespace
...
svn:r4122
2005-04-26 20:55:32 +00:00
Roger Dingledine
509405a5f7
clean up this TOR_FRAGILE business
...
svn:r4116
2005-04-26 18:52:16 +00:00
Nick Mathewson
74dc7eedc5
Add kludgy function to force controllers to flush EVENT_ERR_MSG events.
...
svn:r4057
2005-04-08 03:36:39 +00:00
Nick Mathewson
31c12e265f
Move a quote, fix a log.
...
svn:r4056
2005-04-08 03:26:44 +00:00
Roger Dingledine
dabafddb82
fix format bug
...
svn:r4051
2005-04-07 22:03:56 +00:00
Nick Mathewson
8cc3307e0d
Improve conn_*_to_string; add circuit_state_to_string; make skewed-descriptor messages better.
...
svn:r4047
2005-04-07 21:07:19 +00:00
Nick Mathewson
b897cb1ec3
Change conn_(type|state)_to_string from const arrays to switch functions so we (I) will not make Tor crash the next time we (I) add a new state.
...
svn:r4045
2005-04-07 20:25:22 +00:00
Roger Dingledine
620419b421
oh, and accept() into the right place, too.
...
svn:r4029
2005-04-06 16:16:31 +00:00
Roger Dingledine
70f3b3ef86
Forward-port the checking of
...
sin_addr.s_addr == 0 || sin->sin_port == 0.
This just happened on moria2, so I guess it happens rarely
on Linux as well as OS X.
We can't afford to accept OR conns from 0.0.0.0:0, since we
send created cells back to the first addr:port that matches,
and we'd better not send them to the wrong place.
So, let's drop them all for now, and see if we can find a pattern
later.
svn:r4028
2005-04-06 15:42:35 +00:00
Roger Dingledine
9cbaf4603d
fix an assert trigger: when we have the rare case of accepting
...
a conn on 0.0.0.0:0, then when we look through the connection array,
we'll find any of the workers. this is no good.
svn:r4027
2005-04-06 15:19:32 +00:00
Nick Mathewson
88dc243bb5
Rename circuit_get_by_stream to circuit_get_by_edge_conn, and actually start using it. Watch out, kids!
...
svn:r4026
2005-04-06 06:43:21 +00:00
Roger Dingledine
5f0a84cbe2
update conn-type-state-strings to handle https states for ORs
...
svn:r4018
2005-04-06 04:55:17 +00:00
Nick Mathewson
ac268a8340
Fix Tor for no-threading compilation: move connection_unregister from _connection_free to connection_free.
...
svn:r4013
2005-04-06 00:46:57 +00:00
Nick Mathewson
0dc02328af
Move most of *_mark_for_close out of macros.
...
svn:r3992
2005-04-03 05:22:33 +00:00
Nick Mathewson
0e81265359
update copyright notices.
...
svn:r3982
2005-04-01 20:15:56 +00:00
Roger Dingledine
c2a05e1ca9
redo the state descriptors now that we have a controller-wait state
...
svn:r3934
2005-03-31 17:36:24 +00:00
Roger Dingledine
36baf7219d
stop most cases of hanging up on a socks connection without sending
...
the socks reject. audit for remaining ones. also make things more
uniform so we always remember to hold-open-until-flushed, etc.
svn:r3891
2005-03-27 04:55:13 +00:00
Roger Dingledine
1328383482
make it clearer to the human that his server is testing
...
its reachability. tell him when it succeeds, or when 20
minutes pass and it hasn't succeeded yet.
svn:r3882
2005-03-26 01:43:39 +00:00
Roger Dingledine
9b9dbad0b7
fix another case where we need to send a socks reply (reject)
...
back before we close the conn.
svn:r3876
2005-03-25 11:12:14 +00:00
Roger Dingledine
9685164fe5
don't mark a router down just because your httpsproxy is unreachable
...
svn:r3874
2005-03-25 10:55:06 +00:00
Nick Mathewson
d26bcfab92
Note where connection that hasnt sent end was marked.
...
svn:r3872
2005-03-25 05:54:50 +00:00
Roger Dingledine
bd37c9a3bd
REUSEADDR on normal places means you can rebind to the port
...
right after somebody else has let it go. But REUSEADDR on win32
means to let you bind to the port _even when somebody else
already has it bound_. So, don't do that on Win32.
svn:r3867
2005-03-24 23:20:06 +00:00
Roger Dingledine
0dc91fd9c0
fix an assert -- we're not allowed to write onto a conn after we've
...
connection_unregistered it. there's still more work to be done here,
since we need to make sure to send back the socks-reply as soon as we
know what it will be -- we can't just wait until connection-about-to-close
to deal with it.
svn:r3847
2005-03-23 23:19:18 +00:00
Roger Dingledine
fb8a319ffe
fix an over-eager assert, to make httpsproxy get a little farther
...
svn:r3846
2005-03-23 22:11:59 +00:00
Roger Dingledine
a799dad937
forward-port the commenting out of the assert that glenn fink was
...
triggering. we still don't know why he was triggering it.
svn:r3841
2005-03-23 20:42:37 +00:00
Roger Dingledine
7373042a7b
fix assert triggers (bugs 109 and 96), and put in some
...
debugging logs to notice future repeat bugs.
svn:r3826
2005-03-23 02:52:55 +00:00
Roger Dingledine
e28b8aaa40
make httpsproxy more likely to work
...
(don't let OR conns do tls until they've finished connecting and
doing the proxy dance.)
svn:r3824
2005-03-22 23:57:18 +00:00
Nick Mathewson
df9c8feac7
Commit fixes for several pending tor core tasks: document all DOCDOCed functions; time out uncontrolled unattached streams; feed reasons to SOCKS5 (refactoring connection_ap_handshake_socks_reply in the process); change DirFetchPeriod/StatusFetchPeriod to have a special "Be smart" value.
...
svn:r3769
2005-03-17 12:38:37 +00:00
Nick Mathewson
97dad670ea
Renormalize whitespace
...
svn:r3757
2005-03-14 03:18:35 +00:00
Nick Mathewson
115271f65e
Implement the common case of ATTACHSTREAM.
...
svn:r3751
2005-03-12 04:22:01 +00:00
Nick Mathewson
afe414f070
Revise all calls to connection_edge_end to avoid sending MISC, and to take errno into account where possible.
...
svn:r3720
2005-03-01 22:42:31 +00:00
Nick Mathewson
4ddf768a4f
Forward-port new reasons; clean up code more; add code to convert new reasons to SOCKS5 reply codes; add code to convert errnos to reasons. New code still needs to get invoked.
...
svn:r3719
2005-03-01 22:16:15 +00:00
Nick Mathewson
b7b05dc1b2
make control interface stream IDs monotonically increasing to prevent possible races
...
svn:r3715
2005-03-01 01:15:01 +00:00
Nick Mathewson
97bc49bd72
Try a little harder to avoid openssl SSL* double-free reports.
...
svn:r3710
2005-02-28 02:52:51 +00:00
Nick Mathewson
26e6eb7539
Check returns from libevent calls better; stop poking at internals of events to see if they are live.
...
svn:r3691
2005-02-25 05:42:01 +00:00
Nick Mathewson
24d7ae6fe8
Insert missing ! in assert_connection_ok; test was accidentally reversed in revision 1.329 yesterday. Should fix bug 102
...
svn:r3685
2005-02-24 17:08:27 +00:00
Nick Mathewson
22c38b0f9b
Clarify comment. Use CONN_IS_EDGE more. Try to be more zealous about calling connection_edge_end when things go bad with edge conns in connection.c
...
svn:r3671
2005-02-23 20:35:26 +00:00
Nick Mathewson
6e6d95b3db
Change from inet_ntoa to a threadproof tor_inet_ntoa.
...
svn:r3656
2005-02-22 08:18:36 +00:00
Nick Mathewson
c2d5b67dd2
After we successfully connect, try handling pending stuff immediately, rather than waiting for the next call to connection_handle_write. Roger: is this right?
...
svn:r3647
2005-02-22 03:02:33 +00:00
Roger Dingledine
cbb4803ec8
forward-port some fixes
...
svn:r3631
2005-02-17 01:12:50 +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
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
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
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
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
bafb3e4a5b
fix another integer underflow caused by buckets going negative
...
svn:r3346
2005-01-12 12:19:00 +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
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
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
Roger Dingledine
036384fd8e
respond to an 009 XXX
...
svn:r3201
2004-12-22 02:55:26 +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
Roger Dingledine
012255fe60
fix the other half of the pipe race
...
svn:r3111
2004-12-07 16:37:32 +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
ef04cfcbad
one more typo
...
svn:r3054
2004-12-01 04:13:15 +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
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
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
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
6f5dbefa7e
Normalize space: add one between every control keyword and control clause.
...
svn:r3003
2004-11-28 09:05:49 +00:00
Nick Mathewson
f77ff938b7
remember; tor_socket_errno has side effects!
...
svn:r2997
2004-11-28 05:48:02 +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
914d346095
update conn_state_to_string
...
svn:r2979
2004-11-24 07:58:15 +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
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
Roger Dingledine
310a8da0d2
break reached_eof() out of process_inbuf()
...
svn:r2930
2004-11-21 10:14:57 +00:00