Commit Graph

80 Commits

Author SHA1 Message Date
Roger Dingledine
e34c201bb3 and other debugs
svn:r1722
2004-04-26 22:22:18 +00:00
Roger Dingledine
80d0b634a4 add a debugging entry, to find the wants-to-read-but-can't bug
svn:r1719
2004-04-26 21:15:06 +00:00
Roger Dingledine
25d54257fb use tor_assert
remove obsolete BUF_OK macro


svn:r1697
2004-04-25 20:37:37 +00:00
Roger Dingledine
36d7cc8529 make the max buf size 10 megabytes, not 1 megabyte
need to implement flexible buffer sizes soon


svn:r1553
2004-04-08 02:19:35 +00:00
Nick Mathewson
789df20e7d There is no need to cast void* to other pointer types.
svn:r1524
2004-04-07 20:11:28 +00:00
Nick Mathewson
ba196a9d17 Use (set|get)_uint(16|32) in lieu of memcpy where reasonable.
svn:r1462
2004-04-03 03:07:25 +00:00
Roger Dingledine
b4a61d1ab1 better way: always nul-terminate. then sometimes use it, sometimes not.
svn:r1408
2004-03-31 05:10:34 +00:00
Roger Dingledine
87dbd36a3c let fetch_from_buf_http tolerate nuls in the http body
teach directory.c about which places it needs to nul-terminate
body before it uses it, and which places it must not


svn:r1407
2004-03-31 05:01:30 +00:00
Roger Dingledine
66f878513f deal with hardware word alignment
this was causing the seg faults on sparc processors

i wonder if i got them all.


svn:r1314
2004-03-20 09:30:30 +00:00
Roger Dingledine
52e813951a start tracking the 'broken pipe' error
svn:r1261
2004-03-11 20:15:53 +00:00
Nick Mathewson
9b4203266e Make OP work on windows! (Also misc logging tweaks)
svn:r1258
2004-03-11 06:19:08 +00:00
Nick Mathewson
2da54de968 Make tor build on windows again. More work still needed
svn:r1247
2004-03-09 22:01:17 +00:00
Roger Dingledine
0ab367ed91 re-try streams at most 4 times
svn:r1242
2004-03-07 23:50:15 +00:00
Nick Mathewson
b7633e2e67 Try to find out early if buffers get trashed or double-freed.
svn:r1225
2004-03-03 22:49:15 +00:00
Nick Mathewson
f039eca658 Stop trying to flush on broken sockets marked for close.
svn:r1163
2004-02-28 19:14:11 +00:00
Roger Dingledine
dd632e697e clean up some log messages and severities
still plenty more left to clean


svn:r1158
2004-02-28 07:01:22 +00:00
Roger Dingledine
a24b6e6d4f make flush_buf have a sane return convention
svn:r1157
2004-02-28 05:22:07 +00:00
Peter Palfrader
1bc2384c5a Give the nice message about not being an HTTP proxy an <h1> headline
svn:r1139
2004-02-27 01:33:02 +00:00
Roger Dingledine
2c74f19d7e writing html in C strings sucks
svn:r1127
2004-02-26 22:10:55 +00:00
Roger Dingledine
8f2b429a3b when they use tor as an http proxy, give them an http 501 failure
svn:r1126
2004-02-26 22:02:22 +00:00
Roger Dingledine
b42b16357f note an assert trigger, if you use an old broken netscape socks4
svn:r1022
2004-01-30 15:15:11 +00:00
Roger Dingledine
45a66c6955 make a relay_header_t struct and pack/unpack funcs
split 7-byte stream_id string into 2-byte recognized and 2-byte stream_id
fix two seg faults in fetch_from_buf_http
fix several lurking seg faults in handling unexpected relay cells

still need to
 * clean up relay_crypt
 * use relay dummies if there's going to be a conflict with rh.recognized
 * check for a conflict when generating stream_ids


svn:r953
2003-12-19 05:09:51 +00:00
Roger Dingledine
6a19e64066 remove trailing whitespace
svn:r951
2003-12-17 21:09:31 +00:00
Roger Dingledine
5ecd6b6bad make fetch_from_buf_http malloc its strings rather
than use fixed-size strings

reorganize directory_handle_command so it'll be easier to do more with
our directory servers


svn:r950
2003-12-17 09:42:28 +00:00
Nick Mathewson
7c439c30d0 Resolve format warnings on MacOS X 10.3
svn:r938
2003-12-16 05:33:11 +00:00
Roger Dingledine
0ea88d508d oops, i broke buffers. fixed.
svn:r931
2003-12-14 08:15:41 +00:00
Roger Dingledine
9e3608ce7b more friendly warning when a connection buffer overflows
svn:r918
2003-12-14 04:18:43 +00:00
Roger Dingledine
fe856406be initial patches on patches
svn:r814
2003-11-16 17:00:02 +00:00
Nick Mathewson
dafb0e6a6e Make AP connections wait for a circuit if none exists.
Also:
  - Refactor socks request into a separate struct
  - Add a separate 'waiting for circuit' state to AP connections
    between 'waiting for socks' and 'open'.

Arma: can you check out the XXX's I've added to connection_edge? I may
be mishandling some async and close logic.


svn:r783
2003-11-11 02:41:31 +00:00
Roger Dingledine
efce1b8b3e put small buffers back in place
svn:r629
2003-10-19 01:10:38 +00:00
Roger Dingledine
f96f964a19 try to make cvs more stable for now. need to test this more in a bit.
svn:r612
2003-10-17 10:00:01 +00:00
Roger Dingledine
afd8fa5a97 change buf->buf to buf->mem
maybe this will mean fewer dumb errors


svn:r599
2003-10-15 19:17:21 +00:00
Nick Mathewson
75170f052b fix bug with overzealous shrinking; add more comments.
svn:r597
2003-10-15 19:07:07 +00:00
Roger Dingledine
58ec05877a make the buffer resize stuff work
and make listener connections not have bufs


svn:r584
2003-10-14 03:06:48 +00:00
Nick Mathewson
ee9e54b434 Make buffers grow and shrink as needed.
svn:r583
2003-10-14 01:34:31 +00:00
Roger Dingledine
4d0b8f00b1 clarify the warning for unrecognized socks version
(generally happens when people use tor as an httpd proxy)


svn:r576
2003-10-11 23:38:20 +00:00
Roger Dingledine
b9628f266f change WARNING to WARN
and fix a few typos


svn:r571
2003-10-10 01:48:32 +00:00
Nick Mathewson
36939303c9 Update LICENSE and copyright dates.
svn:r560
2003-10-08 02:04:08 +00:00
Roger Dingledine
a6bab569ab socks5 now works
(or at least, we can talk to mozilla.)


svn:r536
2003-10-04 01:37:01 +00:00
Roger Dingledine
0f25887048 clean up connection_assert_ok compiler warnings
svn:r498
2003-09-27 07:33:07 +00:00
Roger Dingledine
deac704399 connection_new() can't ever fail
svn:r497
2003-09-27 07:28:44 +00:00
Roger Dingledine
9e5cafc395 first pass: obey log convention
ERR is if something fatal just happened

WARNING is something bad happened, but we're still running. The bad thing
is either a bug in the code, an attack or buggy protocol/implementation
of the remote peer, etc. The operator should examine the bad thing and
try to correct it.
(No error or warning messages should be expected. I expect most people
to run on -l warning eventually.)

NOTICE is never ever used.

INFO means something happened (maybe bad, maybe ok), but there's nothing
you need to (or can) do about it.

DEBUG is for everything louder than INFO.


svn:r486
2003-09-26 10:03:50 +00:00
Roger Dingledine
3b5191d36d various bugfixes and updates
redo all the config files for the new format (we'll redo them again soon)

fix (another! yuck) segfault in log_fn when input is too large
tor_tls_context_new() returns -1 for error, not NULL
fix segfault in check_conn_marked() on conn's that die during tls handshake

make ORs also initialize conn from router when we're the receiving node

make non-dirserver ORs upload descriptor to every dirserver on startup
add our local address to the descriptor
add Content-Length field to POST command
revert the Content-Length search in fetch_from_buf_http() to previous code
fix segfault in memmove in fetch_from_buf_http()
raise maximum allowed headers/body size in directory.c


svn:r484
2003-09-25 10:42:07 +00:00
Nick Mathewson
3d4ccb781a Refactor buffers; implement descriptors.
'buf_t' is now an opaque type defined in buffers.c .

Router descriptors now include all keys; routers generate keys as
needed on startup (in a newly defined "data directory"), and generate
their own descriptors.  Descriptors are now self-signed.

Implementation is not complete: descriptors are never published; and
upon receiving a descriptor, the directory doesn't do anything with
it.

At least "routers.or" and orkeygen are now obsolete, BTW.


svn:r483
2003-09-25 05:17:11 +00:00
Roger Dingledine
40d0fca63a cleanups, bugfixes, more verbose logs
Fixed up the assert_*_ok funcs some (more work remains)

Changed config so it reads either /etc/torrc or the -f arg, never both

Finally tracked down a nasty bug with our use of tls:
  It turns out that if you ask SSL_read() for no more than n bytes, it
  will read the entire record from the network (and maybe part of the next
  record, I'm not sure), give you n bytes of it, and keep the remaining
  bytes internally. This is fine, except our poll-for-read looks at the
  network, and there are no bytes pending on the network, so we never know
  to ask SSL_read() for more bytes. Currently I've hacked it so if we ask
  for n bytes and it returns n bytes, then it reads again right then. This
  will interact poorly with our rate limiting; we need a cleaner solution.


svn:r481
2003-09-24 21:24:52 +00:00
Roger Dingledine
9fe1ed26ff get network/host order working right again for socks4
svn:r476
2003-09-21 06:44:53 +00:00
Roger Dingledine
ed51df7453 bugfixes and note missing features
deal with content-length headers better when reading http
don't assume struct socks4_info is a packed struct
fail the socks handshake if destip is zero
flesh out conn_state_to_string() for dir conn
fix typo (bug) in connection_handle_read()
directory get is now called fetch, post is now upload
reopen logs on sighup


svn:r475
2003-09-21 06:15:43 +00:00
Roger Dingledine
078c5ab617 leave the socks handshake on the inbuf until it's complete
this paves the way for supporting socks5 and other handshakes
it also removes those pesky AP-only variables from connection_t

also hacked a fix for a bug where some streams weren't ending properly --
maybe because marked connections weren't flushing properly?


svn:r472
2003-09-18 08:11:31 +00:00
Roger Dingledine
b97945e411 add in directory 'post' support
svn:r471
2003-09-17 20:09:06 +00:00
Roger Dingledine
c0f5ddcf33 fix confirmed win32 bug
svn:r435
2003-09-08 23:10:24 +00:00