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
27b8797245
clean up some more.
...
i think i'm getting closer.
svn:r2931
2004-11-21 11:20:28 +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
66779137bf
Add missing dereference; stop throwing zeroes around.
...
svn:r2702
2004-11-07 22:18: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
Nick Mathewson
d9e0f3f9bc
Make sure control command bodies are always followed by a NUL
...
svn:r2678
2004-11-04 22:30:49 +00:00
Nick Mathewson
347d3f9d62
Start implementing control interface.
...
svn:r2652
2004-11-03 01:32:26 +00:00
Nick Mathewson
6980929e64
Use strlcpy, not strcpy.
...
svn:r2610
2004-10-27 06:48:16 +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
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
Roger Dingledine
0b4d3c4df7
parse HttpProxy address in config
...
fix a potential confusion in fetch_from_buf_http()
make all our int config options non-negative
better bounds checking on options that are ports
svn:r2456
2004-10-12 20:22:09 +00:00
Nick Mathewson
f6fc2b9dd2
Add fix for remote-crash bug.
...
svn:r2447
2004-10-12 18:38:36 +00:00
Roger Dingledine
44ff309c26
touch-ups
...
svn:r2192
2004-08-07 09:01:04 +00:00
Roger Dingledine
dbf150bd4e
list the port and socks version when complaining about unsafe socks
...
svn:r2188
2004-08-07 04:03:01 +00:00
Roger Dingledine
6e9bdc862c
when they use tor as an http proxy, point them at a better url
...
svn:r2161
2004-08-06 19:44:17 +00:00
Roger Dingledine
8b55f73bbe
put the have_warned_about_unsafe_socks static var inside the function
...
svn:r2128
2004-08-04 01:08:10 +00:00
Roger Dingledine
8cb4124121
warn if we use an unsafe socks variant
...
for now, warn every time. we should decide how often we want to warn;
one problem here is that there are several scenarios where we use an
unsafe socks variant safely, so the warning may be inaccurate. hm.
svn:r2126
2004-08-03 23:42:33 +00:00
Roger Dingledine
379768290e
fix a bug related to reading usernames for socks4
...
this hasn't bitten us yet, but hey.
svn:r2026
2004-07-12 16:51:05 +00:00
Roger Dingledine
207fcb35d1
tweaks and bugfix on resolve/resolved code
...
svn:r1980
2004-06-17 21:11:09 +00:00
Nick Mathewson
3708886939
Implement RESOLVE/RESOLVED cells and socks resolve code
...
svn:r1978
2004-06-17 18:13:09 +00:00
Roger Dingledine
4181d18b3d
declare the epipe bug a non-bug.
...
now we catch and ignore epipe signals, and when write returns epipe,
we simply return -1 and close the socket/connection.
svn:r1928
2004-06-01 17:31:13 +00:00
Nick Mathewson
ba14428d66
Fix segfault
...
svn:r1895
2004-05-19 19:28:24 +00:00
Nick Mathewson
7511fbf993
Resolve some XXXs
...
svn:r1889
2004-05-18 15:35:21 +00:00
Nick Mathewson
720281b32e
Close rogue <b>s
...
svn:r1838
2004-05-10 07:27:29 +00:00
Roger Dingledine
c6d4a00c5f
more doxygen markup
...
plenty more remains
svn:r1824
2004-05-09 16:47:25 +00:00
Nick Mathewson
93576d5289
Add doxygen markup for util and buffers
...
svn:r1820
2004-05-07 17:04:12 +00:00
Nick Mathewson
682a805092
Comments for nearly all non-tricky files
...
svn:r1796
2004-05-05 21:32:43 +00:00
Roger Dingledine
25909c2c29
patches on patches
...
svn:r1763
2004-05-02 03:15:55 +00:00
Nick Mathewson
f6fe336ad4
Documenmt buffers.c; remove function that nobody ever calls.
...
svn:r1760
2004-05-01 22:08:43 +00:00
Nick Mathewson
6fa2ded74c
Fix windows compile
...
svn:r1757
2004-05-01 20:55:31 +00:00
Nick Mathewson
908ccb9dcd
Handle windows socket errors correctly; comment most of common.
...
svn:r1756
2004-05-01 20:46:28 +00:00
Nick Mathewson
7055f837ab
Make Tor build on win32 with VC6 without warnings.
...
svn:r1739
2004-04-28 20:13:21 +00:00
Nick Mathewson
06624df622
Log number of bytes pending after read.
...
svn:r1726
2004-04-26 23:05:58 +00:00
Nick Mathewson
ad07c62938
Add a macro to catch unhandled openssl errors.
...
svn:r1723
2004-04-26 23:00:07 +00:00
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
Roger Dingledine
3fa170e11f
more futzing towards tls
...
not there yet
svn:r429
2003-09-07 10:24:40 +00:00
Roger Dingledine
99035f3520
clean read_to_buf more
...
svn:r428
2003-09-05 11:25:24 +00:00
Nick Mathewson
fd20011c26
Add initial interfaces and code for TLS support. Interfaces are right; code needs work and testing.
...
svn:r424
2003-09-04 16:05:08 +00:00
Nick Mathewson
cd3467bb01
Attempt to make sockets code work right on windows.
...
svn:r398
2003-08-14 17:13:52 +00:00
Roger Dingledine
c6f70e36e0
implemented total read rate limiting
...
svn:r365
2003-07-05 07:10:34 +00:00
Roger Dingledine
dbf3435cde
simplify fetch_from_buf; cull idle dnsworkers.
...
svn:r354
2003-06-25 00:31:41 +00:00
Nick Mathewson
95e5384af3
Change many files to new log_fn format
...
svn:r333
2003-06-17 22:18:26 +00:00
Roger Dingledine
cbe7be1f78
remove on-the-fly compression feature
...
it wasn't working, and it was harder than we'd anticipated
not worth it.
svn:r316
2003-06-13 10:23:42 +00:00
Roger Dingledine
39e9d79038
add circuit-level sendme relay cells
...
remove sendme cells
replace malloc with tor_malloc
patch (but not track down) bug in onion pending list
streamline connection_ap handshake
svn:r293
2003-05-20 06:41:23 +00:00
Roger Dingledine
0560008497
terminology shift: data->relay, topic->relay, topic->stream
...
svn:r258
2003-05-01 06:42:29 +00:00
Nick Mathewson
acc33c18e2
Tests for crypto; more tests for buffers
...
svn:r234
2003-04-16 15:24:09 +00:00
Nick Mathewson
1fa0fc1487
Introduce a few unit tests (from older code), refactor compression setup/teardown
...
svn:r232
2003-04-15 19:10:18 +00:00
Nick Mathewson
c217b1ca71
Add magic to end of C files to make emacs happy; split test invocation into separate file.
...
svn:r224
2003-04-07 02:12:02 +00:00