Commit Graph

289 Commits

Author SHA1 Message Date
Roger Dingledine
67aa3b66c5 clean up socks handling, refuse connections to port 0
svn:r2888
2004-11-15 07:50:15 +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
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
0faab62cd9 Resolve FIXMES: sometimes an error code is just an error code
svn:r2805
2004-11-12 05:03:50 +00:00
Nick Mathewson
5a5be93f80 Normalize whitespace; add a "tell me about all the unnormalized whitespace" target; fix a braino in dirserv.c
svn:r2758
2004-11-09 20:04:00 +00:00
Roger Dingledine
394554cfbf Clean up copyrights.
Break connection_consider_empty_buckets() out of
connection_read_bucket_decrement().


svn:r2698
2004-11-07 01:33:06 +00:00
Roger Dingledine
6c61ed4fb5 Make options no longer a global variable.
Now we can try setting an option but back out if it fails to parse, or
  if it's disallowed (e.g. changing RunAsDaemon from 1 to 0).
Use parse_line_from_str rather than parse_line_from_file.


svn:r2692
2004-11-06 05:18:11 +00:00
Roger Dingledine
59453ac6ef add a ControlPort and control listener conn.
note that print_usage is obsolete.


svn:r2671
2004-11-04 06:41:49 +00:00
Roger Dingledine
d0c158c8d6 clarify the bandwidthburst and bandwidthrate are in bytes
(niels had thought they were in bits, or kb, or something)


svn:r2669
2004-11-04 03:25:43 +00:00
Roger Dingledine
a4753283dd better interface for connection_ap_handshake_socks_reply()
make --list-fingerprint print the fingerprint again


svn:r2668
2004-11-03 23:13:28 +00:00
Nick Mathewson
451f8b5045 - Implement all of control interface except authentication, setconfig,
and actually making the sockets.
- Make sure that identity-based nicknames start with $.
- Use new string_join interface.


svn:r2661
2004-11-03 18:33:07 +00:00
Nick Mathewson
4fdaa5de51 Streamline the two redundant "Has the second rolled over?" checks in prepare_for_poll and connection_bucket_refill; also, generate BANDWIDTH control events
svn:r2657
2004-11-03 16:38:04 +00:00
Roger Dingledine
12e92eb82f connection_read_bucket_decrement() has a side-effect that
we need to get even if we just read 0 bytes


svn:r2656
2004-11-03 10:18:31 +00:00
Nick Mathewson
347d3f9d62 Start implementing control interface.
svn:r2652
2004-11-03 01:32:26 +00:00
Nick Mathewson
8db0abb687 First attempt at hibernation code. It needs more work around the XXXXs, but first I want arma to review the basic approach while I meditate on how to fix them.
svn:r2649
2004-11-02 23:47:32 +00:00
Nick Mathewson
ad4dc74482 Use a stricter set of warnings; make them all pass.
svn:r2645
2004-11-02 03:02:17 +00:00
Roger Dingledine
984ffec105 implement first piece of hibernation
still need to track bandwidth, and make decisions based on bandwidth


svn:r2630
2004-10-31 20:28:41 +00:00
Nick Mathewson
2fbf31533b Tricksy compiler warnings! We hates them, hates them forever, my precious!
svn:r2615
2004-10-27 21:14:11 +00:00
Roger Dingledine
0113a643a2 quick-and-dirty dir policy since the dirservers are getting hammered
nick, could you abstract this sometime so we don't repeat the
sockspolicy code twice?


svn:r2589
2004-10-25 06:16:26 +00:00
Nick Mathewson
ef4ac65f5e Document the swiss-army-knife that retry_listeners has become
svn:r2584
2004-10-24 01:50:33 +00:00
Nick Mathewson
0df2d383d1 Many non-native speakers use Tor. It is our duty to ensure that our log messages set an example of good English spelling.
svn:r2583
2004-10-24 01:29:01 +00:00
Nick Mathewson
57f09573f5 Every 60 seconds, check whether the listeners are still alive, and relaunch the dead ones.
svn:r2581
2004-10-24 01:22:40 +00:00
Nick Mathewson
5d53828c57 Handle more errnos from accept() without closing the connection. This may fix a bug that could close OR listeners when (a) TCP connections were hung up before accept() could be called, or (b) during FD exhaustion.
svn:r2579
2004-10-24 00:55:18 +00:00
Roger Dingledine
de65052312 don't assert multiple things in the same tor_assert()
svn:r2544
2004-10-16 22:14:52 +00:00
Nick Mathewson
25a046df74 Fix unit tests, make it compile
svn:r2543
2004-10-16 21:57:24 +00:00
Nick Mathewson
47dc024f7e Change interface of parse_addr_port() to return address in host order, since most users seem to want that.
svn:r2542
2004-10-16 21:53:30 +00:00
Nick Mathewson
0f144d6a04 fix warning on win32
svn:r2518
2004-10-14 15:41:41 +00:00
Roger Dingledine
cf9664151d bugfix on a really old bug:
if read() fails on a stream, send back an end cell before you
close it down.


svn:r2509
2004-10-14 09:28:31 +00:00
Nick Mathewson
1c9426d6e0 Build without warnings on mac gcc 3.3
svn:r2487
2004-10-14 03:18:14 +00:00
Roger Dingledine
aebc3a03ba more int to size_t conversions, fixing one or more amd64 bugs
plus a whitespace patch on config.c from vicman


svn:r2482
2004-10-14 02:47:09 +00:00
Nick Mathewson
0d5a847f12 Remove need for dirservers file: now, we note trusted dirservers in configuration options, and only need to remember addr:port and key digest for each one.
svn:r2479
2004-10-14 01:44:32 +00:00
Roger Dingledine
2b7b86f5e6 stop trying to print a NULL
plus make router_nickname_is_approved() more obviously unused


svn:r2469
2004-10-13 20:17:45 +00:00
Nick Mathewson
e0cce8fba8 Unify tests for "did I originate this nonopen OR connection?"
svn:r2468
2004-10-13 20:05:57 +00:00
Nick Mathewson
508970f85d fix typo
svn:r2466
2004-10-13 19:55:40 +00:00
Nick Mathewson
149f57bdef answer question about rep_hist_note_connect_failed
svn:r2464
2004-10-13 19:42:36 +00:00
Nick Mathewson
0383afac9a Use parse_addr_port() function instead of ad-hoc variants
svn:r2441
2004-10-12 15:52:09 +00:00
Roger Dingledine
136d4e5739 prefer tor_free to free
plus complain more loudly when we fail to parse a dir we just fetched


svn:r2401
2004-09-29 06:52:36 +00:00
Nick Mathewson
c66e4c4870 Flush more changes from sandbox
- make clients cache directories and use them to seed their router lists
   at startup.  This means clients have a datadir again.
 - Introduce a global_write_bucket.  We need to respond better to exhausting
   it.
 - Remove the last vestiges of LinkPadding and TrafficShaping.
 - Configuration infrastructure support for warning on obsolete options.
 - Refactor directory header parsing to use smartlist_split_string.
 - Respond to content-encoding headers by trying to uncompress as appropriate.
 - Reply with a deflated directory when a client asks for "dir.z".
   (We could use allow-encodings instead, but allow-encodings isn't
   specified in HTTP 1.0.)


svn:r2335
2004-09-08 06:52:33 +00:00
Nick Mathewson
9836ccda8c Move a paren 4 characters to the left; fix a bug in OutboundBindAddress
svn:r2330
2004-09-02 23:25:23 +00:00
Roger Dingledine
2d8a1f208a if they ask for exactly one entrynode, don't pick it as an exitnode.
also, fix part of the zero-identity-router-in-stats bug


svn:r2252
2004-08-17 07:09:02 +00:00
Roger Dingledine
0a6e27208b o Handle servers with dynamic IP addresses: don't replace
options->Address with the resolved one at startup.
  o detect our address right before we make a routerinfo each time.
o external IP vs bind-IP. Already done, just use options->Address.
o OutboundBindAddress config option, to bind to a specific
  IP address for outgoing connect()s.


svn:r2241
2004-08-16 11:43:18 +00:00
Roger Dingledine
699a9d8b46 commit some minor fixes from this sandbox so i can commit the next one
svn:r2229
2004-08-15 05:28:09 +00:00
Roger Dingledine
7506cce649 stop wasting cpu time on authdirservers
we were making a new directory only when the old one was dirty, but
every time we made one, we'd dirty it by testing it right then.


svn:r2199
2004-08-08 11:15:38 +00:00
Roger Dingledine
b2c7b5adfb fix a race condition in 008pre2: don't try to extend onto a connection
that's still handshaking.

for servers in clique mode, require the conn to be open before you'll
choose it for your path.


svn:r2198
2004-08-08 10:32:36 +00:00
Roger Dingledine
276d953b22 fix an assert: check the sockspolicy before we make/add the connection,
else we close a connection without assigning it a state, which is bad
because it fails assert_conn_ok()


svn:r2156
2004-08-06 09:56:36 +00:00
Roger Dingledine
0da256ef97 when we get a sigint, don't accept new connections/circuits,
but delay 30 seconds until exiting.
if we get a second sigint, exit immediately.


svn:r2070
2004-07-20 23:31:00 +00:00
Roger Dingledine
dc7951a5a7 a whole swath of fixes
introduce an authdir_mode() macro to match the others.
don't initialize uptime to the number of seconds since 1970.
non-authoritative dirservers don't cache their directory on disk.
make only authdirservers use clique_mode.
only read approved-routers file if you're an authdirserver.
even authdirservers fetch a new directory in do_hup.
retry_all_connections() is now called retry_all_listeners().
router_parse_list_from_string() correctly reports the router number
  it's working on.
only call dirserv_add_own_fingerprint() and
   dirserv_add_descriptor() on startup if we're an authdirserver.
if AuthDir and !ORPort then fail.
if AuthDir and ClientOnly then fail.


svn:r2061
2004-07-20 10:17:43 +00:00
Roger Dingledine
a5ff0527e6 it turns out we weren't looking at the result from getsockopt().
now we do.
but i'm not sure it matters, since we also poll for reads, and if
there's an error with the connecting socket, poll is supposed to
return readable, so we should notice it then.

who knows.


svn:r2057
2004-07-19 23:26:21 +00:00
Nick Mathewson
54c129d8dc abstract ORPort/SocksPort checks into server_mode(), proxy_mode(), clique_mode(), etc. Dont change underlying comments.
svn:r2054
2004-07-18 21:47:04 +00:00