Commit Graph

265 Commits

Author SHA1 Message Date
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
Roger Dingledine
8ac5f24c33 easy tweaks on r12607
svn:r12608
2007-11-29 15:30:32 +00:00
Roger Dingledine
aaf35cccf7 karsten's second refactoring patch
svn:r12607
2007-11-29 15:25:04 +00:00
Nick Mathewson
6fcda5299f r14727@31-33-67: nickm | 2007-11-05 18:34:35 -0500
Make VERSIONS variable-length.


svn:r12391
2007-11-05 23:34:39 +00:00
Nick Mathewson
9a20a64b62 r16438@catbus: nickm | 2007-11-05 16:45:45 -0500
Initial code for variable-length cells. CERT and VERSIONS  need to use them.


svn:r12390
2007-11-05 21:46:35 +00:00
Roger Dingledine
e5885deab5 Separate "SOCKS_COMMAND_CONNECT_DIR" into two flags in
edge_connection_t: want_onehop if it must attach to a circuit with
only one hop (e.g. for the current tunnelled connections that use
begin_dir), and use_begindir if we mean to use a BEGIN_DIR relay
command to establish the stream rather than the normal BEGIN. Now
we can make anonymized begin_dir connections for (e.g.) more secure
hidden service posting and fetching.


svn:r12244
2007-10-28 08:16:19 +00:00
Peter Palfrader
1a94e84661 Say "using socksX _to_ port y" instead of "socksX _on_ port y". it confuses weasel less
svn:r11834
2007-10-10 15:44:34 +00:00
Nick Mathewson
91f83cfc2d r14830@catbus: nickm | 2007-08-29 13:50:10 -0400
Make controllers accept LF as well as CRLF.  Update spec to reflect this.  Remove now-dead code.  Make controller warning about v0 protocol more accurate.


svn:r11299
2007-08-29 19:02:33 +00:00
Nick Mathewson
480db0f00a r14034@catbus: nickm | 2007-07-31 05:22:56 -0400
possible fix for bug 473: always set buf->cur on buf_remove_from_front.


svn:r11004
2007-07-31 09:31:15 +00:00
Nick Mathewson
9fb77a6479 Disable SENTINELS in buffers: it may be responsible for making platform mallocs() be inefficient, and we havent needed it in a long long time.
svn:r10994
2007-07-30 17:51:14 +00:00
Nick Mathewson
9260a824ef Yet another buffer RAM patch: tNever ever ever keep a buffer memory chunk around for an empty buffer that could go on the freelist. This wants profiling to make sure that performance doesnt suffer.
svn:r10993
2007-07-30 17:47:43 +00:00
Nick Mathewson
0d274e1db1 r13952@catbus: nickm | 2007-07-27 19:18:46 -0400
Weasel noticed that many buffers spend their time with empty 4k, 8k, and 16k memory chunks.  Thus, be more aggressive about putting empty chunks on the freelist, regardless of their high water marks.  (Also, run buffer_shrink_freelist on the 8k-chunk freelist.)


svn:r10953
2007-07-27 23:19:02 +00:00
Nick Mathewson
a5477c7bb9 r13944@catbus: nickm | 2007-07-27 15:52:35 -0400
Fix warnings on platforms where rlim values can be signed.
 Add an 8k buffer freelist.
 


svn:r10948
2007-07-27 19:53:29 +00:00
Nick Mathewson
bc9a7be943 r13939@catbus: nickm | 2007-07-27 14:33:22 -0400
When dumping memory usage, list bytes used in buffer memory free-lists.


svn:r10947
2007-07-27 18:33:37 +00:00
Roger Dingledine
a1ab2c8087 free bridge list on exit; try harder to free buffer freelists on exit.
svn:r10854
2007-07-17 11:33:38 +00:00
Roger Dingledine
fcbb817db5 free another string, and the buffer freelists, on exit.
svn:r10851
2007-07-17 09:26:45 +00:00
Nick Mathewson
5adfa09fce r13477@catbus: nickm | 2007-06-17 14:22:03 -0400
Sun CC likes to give warnings for the do { } while(0) construction for making statement-like macros.  Define STMT_BEGIN/STMT_END macros that do the right thing, and use them everywhere.


svn:r10645
2007-06-17 18:22:39 +00:00
Nick Mathewson
1866ad3506 r13274@catbus: nickm | 2007-06-05 19:06:30 -0400
Remove some deadcode that seems unlikely to return


svn:r10509
2007-06-06 04:51:25 +00:00
Nick Mathewson
9aaf3d182f r12934@catbus: nickm | 2007-05-24 14:11:18 -0400
When freeing slack buffers, free the buffers at the end of the freelist first.


svn:r10313
2007-05-24 18:12:41 +00:00
Nick Mathewson
e043b86f47 r12764@catbus: nickm | 2007-05-15 17:17:39 -0400
Enable (and cope with) more GCC 4.2 warnings.


svn:r10196
2007-05-15 21:17:48 +00:00
Nick Mathewson
e3b2a7b53b r12935@Kushana: nickm | 2007-05-10 11:25:09 -0400
Make buffer unit tests pass again


svn:r10158
2007-05-10 15:25:40 +00:00
Roger Dingledine
8e8144cd58 fix a printf size_t/int mismatch from r10150
svn:r10152
2007-05-10 04:04:44 +00:00
Nick Mathewson
34a09c24b5 r12706@catbus: nickm | 2007-05-09 18:39:46 -0400
Keep two freelists for buffer ram chunks: one of 4k chunks, and one of 16k chunks.  Also, document the whole business.


svn:r10150
2007-05-09 22:39:49 +00:00
Nick Mathewson
b248ed620f r12704@catbus: nickm | 2007-05-09 17:43:34 -0400
Periodically clean the freelist of buffer memory chunks.


svn:r10149
2007-05-09 21:43:41 +00:00
Roger Dingledine
3d00738ec7 simplify connection_watch_events()
hope this doesn't break it


svn:r10025
2007-04-25 07:20:04 +00:00
Nick Mathewson
94eef608ae r12784@Kushana: nickm | 2007-04-23 19:24:09 -0400
Avoid another assert failure in the new buffer memory code.  (This time, it hit when freeing a 4k buffer with some data on it.)


svn:r10011
2007-04-23 23:24:53 +00:00
Nick Mathewson
3831d77dba r12782@Kushana: nickm | 2007-04-23 18:20:19 -0400
Avoid a segfault when freeing a buffer with size 0.


svn:r10010
2007-04-23 22:20:45 +00:00
Nick Mathewson
2f4784cbd8 r12499@catbus: nickm | 2007-04-23 10:42:23 -0400
Keep a freelist of unused 4k buffer chunks, rather than wasting 8k for every inactive connection_t.


svn:r10006
2007-04-23 14:42:27 +00:00
Nick Mathewson
473c266fc2 r12496@catbus: nickm | 2007-04-22 23:04:05 -0400
When logging memory usage, break down memory used in buffers by buffer type.


svn:r10004
2007-04-23 03:04:46 +00:00
Nick Mathewson
648065fcb4 r12763@Kushana: nickm | 2007-04-20 18:42:58 -0400
Initial version of code to stop using socket pairs for linked connections.  Superficially, it seems to work, but it probably needs a lot more testing and attention.


svn:r9995
2007-04-21 17:26:12 +00:00
Nick Mathewson
92f62b3684 r12077@catbus: nickm | 2007-03-04 16:08:23 -0500
Remove support for v0 control protocol from 0.2.0.x trunk; send back error when we receive a v0 control message.  (Leave "if(v1){...}"blocks indented for now so this patch is easier to read.)  ((Finally, the linecount goes _down_ a little.))


svn:r9735
2007-03-04 21:08:28 +00:00
Roger Dingledine
50f22e858a doc pedant
svn:r9634
2007-02-24 07:50:38 +00:00
Nick Mathewson
11e5656ab7 r11826@catbus: nickm | 2007-02-16 14:58:38 -0500
Resolve 56 DOCDOC comments.


svn:r9594
2007-02-16 20:01:02 +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
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