Commit Graph

174 Commits

Author SHA1 Message Date
Nick Mathewson
7fcceb2c25 r12074@catbus: nickm | 2007-03-04 15:11:43 -0500
Make all LD_BUG log messsages get prefixed with "Bug: ".  Remove manually-generated "Bug: "s from log-messages.  (Apparently, we remembered to add them about 40% of the time.)


svn:r9733
2007-03-04 20:11:46 +00:00
Roger Dingledine
9946bb7fbd cosmetic, comment, and todo fixes
svn:r9627
2007-02-24 01:12:53 +00:00
Nick Mathewson
d2893398f6 r11832@catbus: nickm | 2007-02-16 15:31:59 -0500
Fix 35 remaining DOCDOC comments. Yowza.


svn:r9596
2007-02-16 20:39:37 +00:00
Nick Mathewson
759c58151e r11775@catbus: nickm | 2007-02-12 16:39:09 -0500
Update copyright dates.


svn:r9570
2007-02-12 21:39:53 +00:00
Nick Mathewson
a24b9e6a66 r11694@catbus: nickm | 2007-02-07 13:25:01 -0500
Fix patch for 9510: never call control_event_stream_status on an exit connection. Should fix assert() noticed by xiando.


svn:r9514
2007-02-07 18:25:04 +00:00
Nick Mathewson
026c11c42e r11672@catbus: nickm | 2007-02-06 14:16:56 -0500
Fix third case of bug 367: make circuit get sent along with END_STREAM_REASON_DESTROY stream CLOSED events.


svn:r9510
2007-02-07 06:54:22 +00:00
Roger Dingledine
4ba57f68e4 more changes. i'm all caught up now.
svn:r9495
2007-02-06 02:49:07 +00:00
Nick Mathewson
03ef2156c9 r11637@catbus: nickm | 2007-02-05 12:41:51 -0500
Fix an XXXX012, and make circuits_pending_or_conns a static variable.  In addition to cleaning up the code, this may also resolve Bug 386 if Roger has the right intuition there.


svn:r9482
2007-02-05 17:42:40 +00:00
Nick Mathewson
fefba95363 r11629@catbus: nickm | 2007-02-02 15:06:17 -0500
Removing the last DOCDOC comment hurt so much that I had to use Doxygen to identify undocumented macros and comments, and add 150 more DOCDOCs to point out where they were.  Oops.  Hey, kids!  Fixing some of these could be your first Tor patch!


svn:r9477
2007-02-02 20:06:43 +00:00
Nick Mathewson
e521c96cb1 r12123@Kushana: nickm | 2007-02-02 13:57:42 -0500
Resolve remaining DOCDOC comments.


svn:r9476
2007-02-02 18:58:11 +00:00
Nick Mathewson
5cd1f0680e r11287@catbus: nickm | 2007-01-23 20:30:04 -0500
Yet more documentation. (Again, trying to see whether I have buildbot working).


svn:r9396
2007-01-24 01:30:07 +00:00
Roger Dingledine
35bd6caa1a Fix crash with "tor --list-fingerprint" (reported by seeess).
svn:r9328
2007-01-10 23:48:24 +00:00
Nick Mathewson
31e274ddd3 r9461@Kushana: nickm | 2006-10-31 20:30:12 -0500
Oops. Fix compile error in last build.


svn:r8888
2006-11-01 01:30:25 +00:00
Nick Mathewson
9e13a6f31c r9457@Kushana: nickm | 2006-10-31 18:35:17 -0500
Do not warn when an OR gives us a new circuit end reason. (This will prevent bug 351 from recurring.)


svn:r8887
2006-10-31 23:35:50 +00:00
Nick Mathewson
b27cb38dee r9307@Kushana: nickm | 2006-10-20 13:53:54 -0400
Have connection_about_to_close use an end_reason field in edge_connection_t to tell what reason to tell the controller for closing the stream.  Set end_reason in connection_edge_end, connection_mark_unattached_ap, and everwhere we set edge_has_sent_end.  Add a changelog entry.


svn:r8779
2006-10-20 17:54:48 +00:00
Nick Mathewson
bfdb93d8bd r9272@Kushana: nickm | 2006-10-19 12:52:37 -0400
Fix an XXX in handling destroy cells: when we get a destroy cell with reason FOO, do not tell the controller REASON=FOO.  Instead, say REASON=DESTROYED REMOTE_REASON=FOO. Suggested by a conversation with Mike Perry.


svn:r8760
2006-10-19 23:04:49 +00:00
Nick Mathewson
b713b370bf r9060@totoro: nickm | 2006-10-17 11:12:48 -0400
Apply patch from Mike Perry: add more reasons for circuit destroys. (Slightly tweaked to avoid allocating a number for an "internal" reason.)


svn:r8739
2006-10-17 15:20:00 +00:00
Nick Mathewson
26283e69ba r8973@totoro: nickm | 2006-10-09 11:45:47 -0400
Touch up last patch (to add REASON to CIRC events): make some reasons
 more sensible, send reasons only to controllers that have enabled
 extended events, and clean up whitespace.
 
 


svn:r8672
2006-10-09 15:47:50 +00:00
Nick Mathewson
b76fd968b4 r8972@totoro: nickm | 2006-10-09 10:36:22 -0400
Patch from Mike Perry: add a REASON field to closed and failed circ events.


svn:r8671
2006-10-09 15:47:27 +00:00
Roger Dingledine
604b13c910 remove some old debugging code
svn:r8657
2006-10-08 23:20:43 +00:00
Nick Mathewson
ce72a9914e r8822@totoro: nickm | 2006-10-01 16:24:22 -0400
Fix bug 303: reject attempts to use Tor as a one-hop proxy.


svn:r8566
2006-10-01 20:50:11 +00:00
Roger Dingledine
c22dc94fe6 make my bandwidth exercises actually happen
svn:r8400
2006-09-15 05:53:00 +00:00
Roger Dingledine
769f9201a6 Send out a burst of long-range drop cells after we've established that
we're reachable. Spread them over 4 circuits, so hopefully a few will
be fast. This exercises our bandwidth and bootstraps us quicker.


svn:r8399
2006-09-15 05:30:25 +00:00
Roger Dingledine
798b580695 fix assert found by DreadWingKnight: now that rendezvous streams
are attached to p_streams, the p_streams list can consist of both AP
and EXIT conns.


svn:r6945
2006-07-30 04:54:13 +00:00
Nick Mathewson
6dc13cdbeb r6948@Kushana: nickm | 2006-07-28 10:10:35 -0400
Identify some likely target fields for lowering; lower global_identifier (since we only use it for AP streams and origin circs).


svn:r6933
2006-07-28 15:11:11 +00:00
Nick Mathewson
5227395aba r6922@Kushana: nickm | 2006-07-26 16:32:24 -0400
Rename some fields, compress a bitfield, and document some structs and fields


svn:r6919
2006-07-27 05:03:57 +00:00
Nick Mathewson
4ff4577beb r6908@Kushana: nickm | 2006-07-26 12:38:52 -0400
Refactor connection_t into edge, or, dir, control, and base subtypes.  This might save some RAM on busy exit servers, but really matters most in terms of correctness.


svn:r6906
2006-07-26 19:07:26 +00:00
Nick Mathewson
e61d28dfb8 r6903@Kushana: nickm | 2006-07-25 18:22:48 -0400
No circuit can be both an intro point and a rend point, so we can merge both the cookie and the pk digest into one "rend_token" field for or circuits. This saves another 20 bytes per or circuit.


svn:r6904
2006-07-26 19:05:41 +00:00
Nick Mathewson
a88ec48a39 r6902@Kushana: nickm | 2006-07-25 17:30:27 -0400
Move rend_query to origin_circuit_t where it belongs; save another 17 bytes per OR circuit.


svn:r6903
2006-07-26 19:05:34 +00:00
Nick Mathewson
d27cbf5d4b Fix another segfault in assert_circuit_ok.
svn:r6818
2006-07-23 08:13:45 +00:00
Nick Mathewson
7239262f71 Don't tell anybody, but we're going OO here. This patch splits
circuit_t into origin_circuit_t and or_circuit_t.  I fixed some
segaults; there may be more.  We still need to move more rendezvous
stuff into subtypes.

This is a trial run for splitting up connection_t; if the approach is
insane, please say so soon so we can do something smarter.

Also, this discards the old HALF_OPEN code, which nobody seems to
want.


svn:r6817
2006-07-23 07:37:35 +00:00
Roger Dingledine
453062b028 fix typo, remove extraneous variable
svn:r6311
2006-04-03 11:24:14 +00:00
Roger Dingledine
36484f873a convert some more source files to the new log convention
svn:r6002
2006-02-13 08:28:42 +00:00
Roger Dingledine
5f051574d5 Happy new year!
svn:r5949
2006-02-09 05:46:49 +00:00
Roger Dingledine
2c221dd8db fix bug 245: When modifying the orconn_circid_map map, we would
sometimes decrement conn->n_circuits even when there was no circuit
originally. This caused conn->n_circuits to go negative.

We noticed this because we were checking if connections can be
closed based on conn->n_circuits == 0, so we were never closing
any connection that had ever had a circuit on it.


svn:r5931
2006-02-09 02:42:15 +00:00
Nick Mathewson
878962bee1 Add reasons to DESTROY and RELAY_TRUNCATED cells.
svn:r5734
2006-01-05 21:23:03 +00:00
Nick Mathewson
1af630d32c Bite the bullet and limit all our source lines to 80 characters, the way IBM intended.
svn:r5582
2005-12-14 20:40:40 +00:00
Nick Mathewson
7e632a7564 another possible patch related to circuit_free and memory stomping.
svn:r5580
2005-12-14 18:55:17 +00:00
Roger Dingledine
c9f6e6b0a0 sometimes, when we just started tor, we haven't created that
smartlist yet. so don't free it.


svn:r5577
2005-12-14 00:52:15 +00:00
Roger Dingledine
58366ffd24 when we changed from log_fn to debug/info/notice/warn/err,
we screwed up the formatting in wild and unpredictable ways.

fix it before it becomes convention to format logs in wild and
unpredictable ways.

still need to do src/common/ someday.


svn:r5551
2005-12-10 09:36:26 +00:00
Nick Mathewson
2d585941b8 Release memory from conn_circid_circuit_map on exit.
svn:r5535
2005-12-08 19:46:22 +00:00
Nick Mathewson
d2123388ad Better fix for last bug: avoids trying to double-mark circuits.
svn:r5511
2005-12-05 19:45:54 +00:00
Nick Mathewson
fedc9c8a60 We were neglecting to unlink marked circuits from soon-to-close OR connections.
svn:r5510
2005-12-05 19:26:09 +00:00
Nick Mathewson
f0abb1a74b Check magic when removing old connection from map.
svn:r5508
2005-12-05 19:01:34 +00:00
Nick Mathewson
1b0134dda8 Clean up some comments; remove some dead code
svn:r5493
2005-12-03 16:32:29 +00:00
Nick Mathewson
979fc3e69d cvs diff -u src/or/circuitlist.c | less almost never does what you want in C.
svn:r5491
2005-12-03 03:36:32 +00:00
Nick Mathewson
77a494dd55 Expunge remaining places where we used "tree" to mean "associative array".
svn:r5490
2005-12-03 02:21:31 +00:00
Nick Mathewson
148a1e969d Shave off another 4.7%: remove a linear search when figuring out which circuits wanted us to open a given OR connection.
svn:r5489
2005-12-03 02:12:37 +00:00
Roger Dingledine
1da454a42d when returning a list of circuits, don't return a list of the same
conn over and over. that's really bad for memory.


svn:r5463
2005-11-28 02:52:17 +00:00
Nick Mathewson
652e1899ac "How about 'never'? Does 'never' work for you?"
Weasel says circuit_get_by_conn is his main timesink.  Most of its
users were just checking whether OR conns had circuits, so add a
circuit count to OR conns, and check that. One was
circuit_about_to_close_conn, which was doing an O(n^2) series of calls
to get all circs on an OR conn, so make an O(n) function for that.
Finally, circuit_get_by_edge_conn was using it as a sanity test that
has been around for a while but never found any actualy insanity, so
kill that.

circuit_get_by_conn is finally dead, which is good, since it was never
sane to begin with.


svn:r5460
2005-11-26 01:43:57 +00:00
Roger Dingledine
fe221f3dff Start the process of treating internal circuits and exit circuits
separately. It's important to keep them separate because internal
circuits have their last hops picked like middle hops, rather than like
exit hops. So exiting on them will break the user's expectations.

- Stop cannibalizing internal circuits for general exits, and stop
  cannibalizing exit circuits for rendezvous stuff.

- Don't let new exit streams attach to internal circuits.

- When deciding if we have enough circuits for internal and for exit,
  don't count the wrong ones.

- Treat predicted resolves as predicted port 80 exits.


svn:r5457
2005-11-25 08:08:56 +00:00
Nick Mathewson
a39269572f Replace balanced trees with hash tables: this should make stuff significantly faster.
svn:r5441
2005-11-23 04:18:45 +00:00
Roger Dingledine
700c370a3b misc cleanups
svn:r5428
2005-11-19 01:56:58 +00:00
Roger Dingledine
409294153f remove some redundant (and misleading) code
svn:r5425
2005-11-19 00:44:24 +00:00
Roger Dingledine
a3c53e0af9 speed up the lookup-by-circid-orconn now that it seems that
our code works.


svn:r5358
2005-11-11 19:28:32 +00:00
Roger Dingledine
862a997495 when we were cannibalizing a circuit with a particular exit
node in mind, we weren't checking to see if that exit node
was already present earlier in the circuit. oops.


svn:r5357
2005-11-11 19:25:30 +00:00
Roger Dingledine
44b3f3060a make circ->onionskin a pointer, not a static array. moria2 was using
125000 circuit_t's after it had been up for a few weeks, which translates
to 20+ megs of wasted space.


svn:r5333
2005-10-29 19:13:48 +00:00
Nick Mathewson
5d85560d9e Remove last vestiges of old logging interface.
svn:r5317
2005-10-25 18:01:01 +00:00
Nick Mathewson
a38aa81bf8 fix another segv, this time in circid fix.
svn:r5312
2005-10-25 15:31:25 +00:00
Nick Mathewson
932106f54c Efficiency hack: call tor_fix_source_file late, not early. Add "BUG" domain. Domains are now bitmasks... just in case. Make some err msgs non-general.
svn:r5309
2005-10-25 07:05:03 +00:00
Nick Mathewson
fa338d85db Fix one possible source of reuse-a-circuit-id bug; convert circuitbuild to new logging
svn:r5301
2005-10-24 19:37:45 +00:00
Nick Mathewson
1bd3f6cc9a Update more files to new log stuff.
svn:r5286
2005-10-18 22:56:40 +00:00
Roger Dingledine
102df4a982 fix some typos
svn:r5283
2005-10-18 21:39:00 +00:00
Roger Dingledine
bec2271029 fix a few comments
svn:r5262
2005-10-17 08:41:58 +00:00
Nick Mathewson
cc35e1720f Using RAND_pseudo_bytes instead of RAND_bytes is an accident waiting to happen, and does not really speed us up much when we do it. So stop doing it.
svn:r5210
2005-10-06 22:18:01 +00:00
Roger Dingledine
c3aac3ff6b infrastructure for the 'change pseudonym' button.
not used yet.


svn:r5199
2005-10-05 22:31:21 +00:00
Nick Mathewson
92451f74a8 Reformat inconsistent function declarations.
svn:r5160
2005-09-30 01:09:52 +00:00
Nick Mathewson
c6347cdb0e suppress all our usual compiler warnings, including a longstanding one from tree.h
svn:r5149
2005-09-29 20:49:41 +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
149e9a5900 remove pointless XXXX. It was there to remind me to do something I already did.
svn:r4557
2005-07-14 16:37:33 +00:00
Roger Dingledine
2259032ea1 trivial changes on nick's rendezvous commit
svn:r4553
2005-07-14 08:43:19 +00:00
Roger Dingledine
271d49958e fix another compile warn
svn:r4516
2005-07-01 02:02:24 +00:00
Nick Mathewson
ec83652357 Logic to implement rendezvous/introduction via unknown servers.
- Add a new extend_info_t datatype to hold information needed to
  extend a circuit (addr,port,keyid,onion_key).  Use it in cpath and
  build_state.  Make appropriate functions take or return it instead of
  routerinfo_t or keyid.

- #if 0 needless check in circuit_get_by_edge_conn; if nobody triggers this
  error in 0.1.0.10, nobody will trigger it.

- Implement new hidden service descriptor format, which contains "extend
  info" for introduction points, along with protocol version list.
  - Parse new format.
  - Generate new format
  - Cache old and new formats alongside each other.
  - Directories serve "old" format if asked in old way, "newest available"
    format if asked in new way.
  - Use new format to find introduction points if possible; otherwise fall
    back.  Keep nickname lists and extendinfo lists in sync.
  - Tests for new format.

- Implement new "v2" INTRODUCE cell format.
  - Accept new format
  - Use new format if we have a versioned service descriptor that says the
    server accepts the new format.

- Add documentation for functions and data types.


svn:r4506
2005-06-29 21:46:55 +00:00
Nick Mathewson
64fc1f7bae Implement all the rest of the new controller protocol, debug a little, add some new features, add ADDRMAP events.
svn:r4460
2005-06-19 20:40:41 +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
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
Nick Mathewson
a6f51001a5 New whitespace normalization rule: no blank line at EOF.
svn:r4378
2005-06-09 16:46:51 +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
ab34901263 New and frightening code to implement fast-path first-hop CREATE_FAST cells. Watch out when we bump the version to 0.1.0.6-rc!
svn:r4162
2005-05-02 22:35:18 +00:00
Nick Mathewson
c6769a80fb Fixs a signed/unsigned comparison
svn:r4055
2005-04-08 03:26:23 +00:00
Nick Mathewson
6face4f482 Add missing "char"
svn:r4054
2005-04-08 03:07:07 +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
c92a2620d4 Try RB_TREE instead of SPLAY_TREE, but with a single-entry caching optimization.
svn:r4041
2005-04-07 05:09:19 +00:00
Nick Mathewson
a035b8e3c3 Make compare_orconn_circid_entries marginally faster and inlined, if that helps
svn:r4040
2005-04-07 04:50:25 +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
Nick Mathewson
4453e3794a Add a pointer from edge connections to their corresponding circuit (ulp!); add some debugging sanity-checking for cirid_orconn_map stuff
svn:r4024
2005-04-06 06:13:49 +00:00
Nick Mathewson
b7cdcf3462 Hopefully, this will make ORs much faster, and not break them: keep a big splay tree of (circid,orconn)->circuit mappings to make circuit_get_by_circid_conn much faster.
svn:r4020
2005-04-06 05:33:32 +00:00
Roger Dingledine
658463a751 clean up the circuit-mark-for-close patch
svn:r3994
2005-04-03 05:31:41 +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
7cf33ed495 resolve another 'hasn't sent end yet' bug
svn:r3911
2005-03-29 00:35:35 +00:00
Nick Mathewson
631ab5c69b Add a magic value to cpath_layer_t to make sure that we can tell valid cpaths from freed ones. I audited this once; it could use another audit.
svn:r3831
2005-03-23 06:21:48 +00:00
Roger Dingledine
f1ba4296c1 clean up and refactor some more
svn:r3798
2005-03-22 01:01:15 +00:00
Roger Dingledine
35953edae0 Implement controller's "extendcircuit" directive.
Also refactor circuit building so we plan the whole path ahead
of time.


svn:r3797
2005-03-22 00:42:38 +00:00
Roger Dingledine
4a497e5030 if our clock jumps forward by 100 seconds or more, assume something
has gone wrong with our network and abandon all not-yet-used circs.


svn:r3792
2005-03-19 23:58:42 +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
115271f65e Implement the common case of ATTACHSTREAM.
svn:r3751
2005-03-12 04:22:01 +00:00
Nick Mathewson
e14f812a67 Still more code to make sure we send the right number and kind of RELAY END cells
svn:r3723
2005-03-02 03:13:05 +00:00
Nick Mathewson
f672577bc6 Free even more things on shutdown. Temporarily move tor_free_all out from #ifdef so it gets tested more.
svn:r3614
2005-02-11 01:26:47 +00:00
Roger Dingledine
a7138f2535 fix another rogue connection_free that was causing us troubles
there are no doubt more lurking.


svn:r3478
2005-01-31 03:47:38 +00:00