Nick Mathewson
dbba84c917
Avoid perma-blocking the controller on bug in shrink_freelist
...
In all likelihood, this bug would make Tor assert, but if it doesn't,
let's not have two bugs.
2010-11-12 13:05:58 -05:00
Robert Ransom
a421e284d0
Disable logging to control port connections in buf_shrink_freelists.
...
If buf_shrink_freelists calls log_warn for some reason, we don't want the log
call itself to throw buf_shrink_freelists further off the rails.
2010-11-12 03:07:09 -08:00
Robert Ransom
81affe1949
Move the original log_info call out of the core of buf_shrink_freelists.
...
Sending a log message to a control port can cause Tor to allocate a buffer,
thereby changing the length of the freelist behind buf_shrink_freelists's back,
thereby causing an assertion to fail.
Fixes bug #1125 .
2010-11-12 03:04:07 -08:00
Robert Ransom
6a0657d4bb
Disable logging to control port connections in buf_shrink_freelists.
...
If buf_shrink_freelists calls log_warn for some reason, we don't want the log
call itself to throw buf_shrink_freelists further off the rails.
2010-11-12 02:34:58 -08:00
Robert Ransom
6d2e02d79b
Move the original log_info call out of the core of buf_shrink_freelists.
...
Sending a log message to a control port can cause Tor to allocate a buffer,
thereby changing the length of the freelist behind buf_shrink_freelists's back,
thereby causing an assertion to fail.
Fixes bug #1125 .
2010-11-12 02:34:51 -08:00
Nick Mathewson
9516c1efdb
Remove XXXs about improving buf_t API: bufferevents are the future
2010-10-15 11:38:33 -04:00
Nick Mathewson
b49cf6a77a
Fix whitespace in bufferevents branch
2010-09-27 14:22:18 -04:00
Nick Mathewson
a16ed90ec8
Document and/or fix stuff found by Sebastian in code review
...
Thanks to Sebastian for his code-review of the bufferevents patch series.x
2010-09-27 14:22:18 -04:00
Sebastian Hahn
865bea3b89
Some bufferevents related fixes and pointers for nickm
2010-09-27 14:22:18 -04:00
Nick Mathewson
0c9b64d449
Get zlib compression working with bufferevents.
2010-09-27 14:22:11 -04:00
Nick Mathewson
9796b9bfa6
Implement SOCKS-client support for bufferevents
2010-09-27 12:31:14 -04:00
Nick Mathewson
bd3612cd2b
Get SSL connections and linked connections working with bufferevents.
...
Clients are now verified to work and build circuits correctly. There
are still a few warnings given here and there that I need to look into.
2010-09-27 12:31:14 -04:00
Nick Mathewson
44375d4eb8
Add a 0-pullup version of fetch_from_evbuffer_socks
2010-09-27 12:31:13 -04:00
Nick Mathewson
f6899f3a74
Documentation for inspect_evbuffer
2010-09-27 12:31:13 -04:00
Nick Mathewson
698085d56e
Add pullup-free version of fetch_from_evbuffer_http
2010-09-27 12:31:13 -04:00
Nick Mathewson
ddcb59bb70
Fix more remaining users of inbuf/outbuf to handle bufferevents instead.
2010-09-27 12:31:13 -04:00
Nick Mathewson
63079efb87
Add a fetch_from_evbuffer_http
2010-09-27 12:29:42 -04:00
Nick Mathewson
a0f4841e2b
Refactor SOCKS parsing code to handle evbuffers.
...
Now all of the logic is in a parse_socks() function that gets data
from a buf_t or evbuffer-specific wrapper.
2010-09-27 12:29:42 -04:00
Nick Mathewson
4836014168
Clone fetch_var_cell_from_buf() for evbuffers.
2010-09-27 12:28:43 -04:00
Nick Mathewson
0514917800
Add a new connection_fetch_from_buf_line() that can handle bufferevents
2010-09-27 12:28:43 -04:00
Nick Mathewson
57e7b54b7b
Teach read_event/write_event manipulators about bufferevents.
...
Add an --enable-bufferevents config switch.
2010-09-27 12:28:43 -04:00
Nick Mathewson
94aac84a71
Remove never-actually-finished code to use readv and writev for IO.
...
We'll get this feature for free with bufferevents, so there's no good reason
to clone it in Tor.
2010-09-27 12:28:43 -04:00
Roger Dingledine
47b23bd03e
A start at a patch for bug 1943 (alignment issues)
2010-09-20 18:40:32 -04:00
Nick Mathewson
8150e2ad24
Make buf_shrink_freelists warn, not crash, when n_to_skip is too high
...
This mitigates bug 1125, but doesn't fix its root cause (whatever
that is).
2010-08-10 15:58:41 -04:00
Sebastian Hahn
cc060ea220
Create reasons.h
2010-07-27 10:00:45 +02:00
Sebastian Hahn
0bfa34e1f6
Create control.h
2010-07-27 07:58:15 +02:00
Sebastian Hahn
0d33120c26
Create connection_or.h
2010-07-27 07:58:15 +02:00
Sebastian Hahn
78b6a4650b
Create connection_edge.h
2010-07-27 07:58:14 +02:00
Sebastian Hahn
c4f8f1316e
Create config.h
2010-07-27 07:58:14 +02:00
Sebastian Hahn
34dfce0d82
Create buffers.h
2010-07-27 07:56:26 +02:00
Nick Mathewson
14bc4dcc22
Rename log.h to torlog.h
...
This should make us conflict less with system files named "log.h".
Yes, we shouldn't have been conflicting with those anyway, but some
people's compilers act very oddly.
The actual change was done with one "git mv", by editing
Makefile.am, and running
find . -name '*.[ch]' | xargs perl -i -pe 'if (/^#include.*\Wlog.h/) {s/log.h/torlog.h/; }'
2010-07-09 22:05:38 -04:00
Sebastian Hahn
10fdb9ee0a
Add option to not warn when getting an IP instead of hostname
2010-06-07 12:44:25 +02:00
Nick Mathewson
b006e3279f
Merge remote branch 'origin/maint-0.2.1'
...
Conflicts:
src/common/test.h
src/or/test.c
2010-02-27 17:16:31 -05:00
Nick Mathewson
c3e63483b2
Update Tor Project copyright years
2010-02-27 17:14:21 -05:00
Nick Mathewson
350181529e
Merge branch 'safelogging2'
...
Conflicts:
ChangeLog
2009-12-15 17:26:09 -05:00
Nick Mathewson
fcbd65b45c
Refactor the safe_str_*() API to make more sense.
...
The new rule is: safe_str_X() means "this string is a piece of X
information; make it safe to log." safe_str() on its own means
"this string is a piece of who-knows-what; make it safe to log".
2009-12-15 17:25:34 -05:00
Sebastian Hahn
3807db001d
*_free functions now accept NULL
...
Some *_free functions threw asserts when passed NULL. Now all of them
accept NULL as input and perform no action when called that way.
This gains us consistence for our free functions, and allows some
code simplifications where an explicit null check is no longer necessary.
2009-12-12 03:29:44 +01:00
Sebastian Hahn
f258647433
Allow SafeLogging to exclude client related information
2009-12-12 02:26:11 +01:00
Nathan Freitas
8c585cce39
Include util.h and log.h as relative paths.
...
This shouldn't be necessary, but apparently the Android cross-compiler
doesn't respect -I as well as it should. (-I is supposed to add to the
*front* of the search path. Android's gcc wrapper apparently likes to add to
the end. This is broken, but we need to work around it.)
2009-09-29 00:52:52 -04:00
Nick Mathewson
707a6bd659
Merge commit 'public/socks-client'
...
Resolved conflict in:
src/or/or.h
2009-08-26 11:27:19 -04:00
Roger Dingledine
9ece0955f7
fix comments and other typos
2009-07-13 17:34:46 -04:00
Nick Mathewson
015189b5df
Move SOCKS reason-decoding switches into reasons.c
2009-06-19 12:40:23 -04:00
Christopher Davis
75472c19c3
Enable Tor to connect through SOCKS 4/5 proxies
...
Added a sanity check in config.c and a check in directory.c
directory_initiate_command_rend() to catch any direct connection attempts
when a socks proxy is configured.
2009-06-19 12:16:15 -04:00
Nick Mathewson
ec7e054668
Spell-check Tor.
2009-05-27 17:55:51 -04:00
Nick Mathewson
88d81ead83
Better debugging output for bug 977 case.
...
(Don't crash immediately if we have leftover chunks to free after
freeing chunks in a buffer freelist; instead log a debugging message
that might help.)
2009-05-12 13:54:21 -04:00
Karsten Loesing
9b32e8c141
Update copyright to 2009.
2009-05-04 11:28:27 -04:00
Nick Mathewson
c4b8fef362
Remove svn $Id$s from our source, and remove tor --version --version.
...
The subversion $Id$ fields made every commit force a rebuild of
whatever file got committed. They were not actually useful for
telling the version of Tor files in the wild.
svn:r17867
2009-01-04 00:35:51 +00:00
Nick Mathewson
52932d6f1a
Remove some code that is #ifdefed out, and that we no longer seem to use, if we ever did.
...
svn:r17827
2008-12-30 04:16:49 +00:00
Nick Mathewson
1e5f457461
Fix most DOCDOCs remaining and/or added by redox.
...
svn:r17734
2008-12-22 17:53:04 +00:00
Nick Mathewson
122170c1d3
Downlgrade tweak, and answer lots of XXX021s. No actual code fixes in this patch.
...
svn:r17686
2008-12-18 16:11:24 +00:00
Nick Mathewson
ecaee1d927
Remove fixed xxx020s; downgrade unfixed ones.
...
(The unfixed ones are being downgraded to regular XXXs mainly on the rationale that they don't seem to be exploding Tor, and they were apparently not showstoppers for 0.2.0.x-final.)
svn:r17682
2008-12-18 16:11:03 +00:00
Nick Mathewson
f43bcdc063
Use ctags and a python script to find identifiers that are never used anywhere, and remove the ones that we really want gone.
...
svn:r17651
2008-12-17 17:20:42 +00:00
Nick Mathewson
c36ddcbabf
Apparently sparc64 is way more strict about uint16_t access alignment than I had thought: it gave bus errors when messing with var-cell headers. Maybe this patch will fix bug 862.
...
svn:r17262
2008-11-12 14:41:44 +00:00
Nick Mathewson
ae3ce7b387
Patch from mwenge: update TrackHostExits mapping expiry times when the mappings are used, so that they expire a while after their last use, not a while after their creation.
...
svn:r17004
2008-09-29 14:53:53 +00:00
Roger Dingledine
2bde30efa6
read_to_buf should take an int *error_socket and return it.
...
svn:r16909
2008-09-14 08:35:41 +00:00
Nick Mathewson
f95d7c189b
Refactor unit test macros and tor_free_all() logic a bit so as to make it easier to free memory on failing tests, in order to suppress scanner warnings and to make dmalloc() usable with tests.
...
svn:r16816
2008-09-09 20:43:31 +00:00
Nick Mathewson
a8ddac96d8
handle ipv6 in socks5 requests.
...
svn:r16476
2008-08-08 16:41:59 +00:00
Nick Mathewson
1a76cd179a
When a struct ends with char a[1], the size of all earlier members of the struct is _not_ sizeof(st)-1; compilers add alignment. Problem spotted by rovv. Backport candidate.
...
svn:r16302
2008-07-31 12:18:14 +00:00
Nick Mathewson
4630f0453d
Explain how my emacs setup works in the HACKING file. Someone else may care too.
...
svn:r15228
2008-06-13 19:57:52 +00:00
Nick Mathewson
a886e86cbd
r16171@tombo: nickm | 2008-06-11 13:47:41 -0400
...
Lower number of syscalls used to write data to ordinary sockets through use of writev. Disabled till I have time to test it.
svn:r15133
2008-06-11 17:56:52 +00:00
Roger Dingledine
755cbe5d44
cosmetic patch by Bernhard M. Wiedemann, so our comments follow
...
the socks5 protocol better
svn:r14552
2008-05-04 09:36:48 +00:00
Roger Dingledine
5bf0a01011
forward-port r13799 and the 0.2.0.21-rc changelog
...
svn:r13808
2008-03-02 22:29:04 +00:00
Nick Mathewson
e68760ac0f
r14388@tombo: nickm | 2008-02-21 22:44:28 -0500
...
More 64-to-32 fixes.
svn:r13672
2008-02-22 03:44:36 +00:00
Nick Mathewson
daefbfe691
r14371@tombo: nickm | 2008-02-21 16:13:18 -0500
...
Fix all -Wshorten-64-to-32 warnings that appear on my macbook.
svn:r13662
2008-02-21 21:15:31 +00:00
Nick Mathewson
0e9dcfab97
r18286@catbus: nickm | 2008-02-20 21:10:33 -0500
...
Fix a bug that kept buf_find_string_offset from finding a string at the very end of the buffer. Add a unit test for this. Also, do not save a pointer to a chunk that might get reallocated by buf_pullup().
svn:r13635
2008-02-21 02:10:38 +00:00
Nick Mathewson
3b58f9929f
r18283@catbus: nickm | 2008-02-20 18:58:31 -0500
...
Fix assertion when searching for a string in an empty chunk.
svn:r13634
2008-02-20 23:58:48 +00:00
Nick Mathewson
304bdfdc6b
r18279@catbus: nickm | 2008-02-20 18:38:48 -0500
...
Log message to try to detect error in buffers.c
svn:r13633
2008-02-20 23:38:57 +00:00
Nick Mathewson
f0e523c6ef
r18272@catbus: nickm | 2008-02-20 18:20:33 -0500
...
add a flag to suppress overwriting the certificates file with new certificates, so we do not overwrite all certs when starting as an authority.
svn:r13630
2008-02-20 23:20:36 +00:00
Nick Mathewson
384a8ab777
r18267@catbus: nickm | 2008-02-20 16:57:45 -0500
...
Suppress signed/unsigned comparison warnings in buffers.c
svn:r13624
2008-02-20 21:57:48 +00:00
Nick Mathewson
7521ef9a00
r18264@catbus: nickm | 2008-02-20 12:48:21 -0500
...
fix bufs in buf_pos_t implementation.
svn:r13623
2008-02-20 17:48:39 +00:00
Nick Mathewson
cefe0a1959
r18255@catbus: nickm | 2008-02-20 11:44:55 -0500
...
Add asserts and refactor some comparisons in order to fix some veracode-identified issues. Note a bug in buffers.c
svn:r13618
2008-02-20 16:57:39 +00:00
Roger Dingledine
d1a195d3cb
call a "number of characters" a size_t, not an int
...
svn:r13594
2008-02-19 22:52:50 +00:00
Nick Mathewson
418c2e1b6b
r14181@tombo: nickm | 2008-02-15 16:48:17 -0500
...
Fix all but 2 DOCDOC items; defer many XXX020s (particularly those where fixing them would fix no bugs at the risk of introducing some bugs).
svn:r13529
2008-02-15 23:39:04 +00:00
Nick Mathewson
f3eaeb99a3
r18051@catbus: nickm | 2008-02-12 15:20:43 -0500
...
Re-tune mempool parametes based on testing on peacetime: use smaller chuncks, free them a little more aggressively, and try very hard to concentrate allocations on fuller chunks. Also, lots of new documentation.
svn:r13484
2008-02-12 20:20:52 +00:00
Nick Mathewson
141a5877f3
r14063@tombo: nickm | 2008-02-08 15:48:32 -0500
...
Add a bunch more code documentation; change the interface of fetch_var_cell_from_buf() so it takes the current link protocol into account and can't get confused by weird command bytes on v1 connections.
svn:r13430
2008-02-08 21:13:15 +00:00
Nick Mathewson
842a33ff20
Update some copyright notices: it is now 2008.
...
svn:r13412
2008-02-07 05:31:47 +00:00
Nick Mathewson
4d70094b6e
r17951@catbus: nickm | 2008-02-06 14:34:13 -0500
...
Add more documentation; change the behavior of read_to_buf_tls to be more consistent. Note a longstanding problem with current read/write interfaces.
svn:r13407
2008-02-06 19:34:32 +00:00
Nick Mathewson
a869574c56
r17947@catbus: nickm | 2008-02-06 11:57:53 -0500
...
Fix a bunch of DOCDOC items; document the --quiet flag; refactor a couple of XXXX020 items.
svn:r13405
2008-02-06 16:58:05 +00:00
Nick Mathewson
ec6c131da6
r17936@catbus: nickm | 2008-02-06 00:31:11 -0500
...
Fix/downgrade some more XXX020s.
svn:r13397
2008-02-06 05:31:21 +00:00
Nick Mathewson
ae6df065ed
r15890@tombo: nickm | 2008-01-12 17:19:51 -0500
...
Add a --disable-buffer-freelists configure argument to build without buffer RAM chunk freelists, so we can benchmark the impact of this.
svn:r13121
2008-01-13 00:20:44 +00:00
Nick Mathewson
614dc52623
r17467@catbus: nickm | 2008-01-05 19:54:20 -0500
...
fix whitespace
svn:r13035
2008-01-06 00:54:22 +00:00
Nick Mathewson
46a27c2f93
r15750@tombo: nickm | 2007-12-29 19:12:51 -0500
...
Make HTTP-processing code in buffers.c faster: do not pull up 50K of text into the first chunk if the headers end earlier than that.
svn:r13006
2007-12-30 00:13:07 +00:00
Nick Mathewson
cd85eac0d3
r17433@catbus: nickm | 2007-12-29 12:35:57 -0500
...
Incomplete code to avoid doing needless pull-ups on HTTP. Also, use memstr instead of strstr to find the content-length header.
svn:r13005
2007-12-29 17:36:03 +00:00
Nick Mathewson
f4f5dc4aca
r15745@tombo: nickm | 2007-12-29 00:15:17 -0500
...
Try even harder not to allocate chunks bigger than MAX_CHUNK_ALLOC.
svn:r13003
2007-12-29 05:16:30 +00:00
Nick Mathewson
bd32982c77
r17426@catbus: nickm | 2007-12-28 21:12:29 -0500
...
Remove need for buf_pullup in fetch_line_from_buf().
svn:r13002
2007-12-29 02:33:42 +00:00
Nick Mathewson
d7f5a73173
r17410@catbus: nickm | 2007-12-27 09:20:27 -0500
...
Exciting new entries in buf_dump_freelist_sizes() to make sure our freelist sizes are reasonable.
svn:r12996
2007-12-27 14:20:30 +00:00
Nick Mathewson
1a2b6c2ae3
r17407@catbus: nickm | 2007-12-27 00:18:31 -0500
...
Fix windows compile error
svn:r12995
2007-12-27 05:18:36 +00:00
Nick Mathewson
119b4e1edf
r17405@catbus: nickm | 2007-12-26 22:27:37 -0500
...
And clean up an assertion failure.
svn:r12993
2007-12-27 03:27:48 +00:00
Nick Mathewson
148e2e1c48
r17403@catbus: nickm | 2007-12-26 22:23:50 -0500
...
Apparently loops work better when you actually increment/decrement the loop variable. Who knew?
svn:r12992
2007-12-27 03:23:57 +00:00
Nick Mathewson
1503021ee5
r15723@tombo: nickm | 2007-12-26 19:25:51 -0500
...
Actually trim freelists.
svn:r12991
2007-12-27 00:25:54 +00:00
Nick Mathewson
3a5bee150f
r15721@tombo: nickm | 2007-12-26 17:07:10 -0500
...
Fix a nasty infinite loop in flush_buf[_tls].
svn:r12990
2007-12-26 22:07:14 +00:00
Nick Mathewson
27220fb395
r15719@tombo: nickm | 2007-12-26 14:02:12 -0500
...
More tweaks on 0-byte TLS writes.
svn:r12989
2007-12-26 19:02:15 +00:00
Nick Mathewson
80151b42df
r15717@tombo: nickm | 2007-12-26 13:55:53 -0500
...
Oops. flush_buf_tls can request more than the requested number of bytes. When that happens, do not let the size_t sz wrap around.
svn:r12988
2007-12-26 18:55:56 +00:00
Nick Mathewson
84b6e26c50
r15715@tombo: nickm | 2007-12-26 13:09:27 -0500
...
Peacetime managed to run overnight in paranoia mode. Disabling paranoia, so that buffers.c can be a little speedy again.
svn:r12987
2007-12-26 18:09:36 +00:00
Nick Mathewson
fb8cbc8642
r15710@tombo: nickm | 2007-12-25 19:36:03 -0500
...
Fix in flush_buf_tls: it is okay to flush an empty buffer, since we may have a partial TLS record pending.
svn:r12984
2007-12-26 00:36:05 +00:00
Nick Mathewson
a7ef07b4bd
r15693@tombo: nickm | 2007-12-25 19:11:29 -0500
...
Here, have some terribly clever new buffer code. It uses a mbuf-like strategy rather than a ring buffer strategy, so it should require far far less extra memory to hold any given amount of data. Also, it avoids access patterns like x=malloc(1024);x=realloc(x,1048576);x=realloc(x,1024);append_to_freelist(x) that might have been contributing to memory fragmentation. I've tested it out a little on peacetime, and it seems to work so far. If you want to benchmark it for speed, make sure to remove the #define PARANOIA; #define NOINLINE macros at the head of the module.
svn:r12983
2007-12-26 00:12:08 +00:00
Roger Dingledine
1d8a8063b9
clean up copyrights, and assign 2007 copyrights to The Tor Project, Inc
...
svn:r12786
2007-12-12 21:09:01 +00:00
Roger Dingledine
2b8ca7b4a4
patch from karsten to clean up documentation and to integrate
...
more fixes into rend-spec.txt.
svn:r12715
2007-12-07 21:27:58 +00:00
Nick Mathewson
2e378295d6
r16997@catbus: nickm | 2007-12-06 18:56:33 -0500
...
Make http://torproject urls into https://torproject urls. Patch from steve.
svn:r12708
2007-12-06 23:56:36 +00:00
Nick Mathewson
92372b156a
r16995@catbus: nickm | 2007-12-06 18:42:53 -0500
...
patch from steve: replace more tor.eff.org instances with torproject.org
svn:r12707
2007-12-06 23:42:59 +00:00