Commit Graph

250 Commits

Author SHA1 Message Date
Roger Dingledine
3d79eb52ab stick to nick's nul/null convention
svn:r6763
2006-07-15 19:21:30 +00:00
Nick Mathewson
b4b8da5d23 Turn a while into a do/while; save a redundant test
svn:r6683
2006-06-24 02:10:21 +00:00
Nick Mathewson
5c0d7fb016 Resolve control flow warning.
svn:r6658
2006-06-18 20:39:46 +00:00
Nick Mathewson
0932f463ff Ah. That seems to work.
svn:r6657
2006-06-18 16:39:26 +00:00
Nick Mathewson
5ba72d0ae5 another write_to_buf_zlib fix.
svn:r6656
2006-06-18 16:20:38 +00:00
Nick Mathewson
a9cffd2ff0 Re-enable buffer RAM guard values.
svn:r6653
2006-06-18 15:53:54 +00:00
Nick Mathewson
11c2e97d51 Another _zlib fix.
svn:r6652
2006-06-18 09:03:48 +00:00
Nick Mathewson
10b7b57616 Temporarily disable sentinels on buffers
svn:r6649
2006-06-18 08:44:34 +00:00
Nick Mathewson
9376d901ed make zlib buffer function set buf_highwater properly
svn:r6648
2006-06-18 08:21:27 +00:00
Nick Mathewson
cd38511a1e Part of incremental encryption logic for buffers: there is a subtle yucky point documented in a comment.
svn:r6637
2006-06-18 07:27:47 +00:00
Roger Dingledine
fab1feee26 complain when we hit wsaenobufs on recv or write too.
perhaps this will help us hunt the bug.


svn:r6321
2006-04-08 07:54:11 +00:00
Roger Dingledine
d8195e4128 Implement Jason Holt's SafeSocks config option.
Also put a URL in the warning message for unsafe socks4 use --
previously we'd only had the URL for unsafe socks5 use. Oops.


svn:r6190
2006-03-19 01:44:53 +00:00
Roger Dingledine
9a5df4cef5 resume being printist: if the hostname contains non-printable
characters, then fail. this time don't even bother telling the
server operator about these cases, because what's he going to do?

if it turns out that some significant population somewhere in the
world uses non-printable hostnames and wants to use tor, then i
hereby assume that they will contact us.


svn:r6171
2006-03-15 23:36:57 +00:00
Roger Dingledine
e8fd871d8b Stop being printist: just because our local platform doesn't
consider an alleged destination to be printable doesn't mean
nobody in the world will want to use it.


svn:r6167
2006-03-15 19:17:34 +00:00
Nick Mathewson
bd8ffccae7 More cleanups noticed by weasel; also, remove macros that nobody uses.
svn:r6143
2006-03-12 23:31:16 +00:00
Nick Mathewson
5777ee0e1a Add some functions to escape values from the network before sending them to the log. Use them everywhere except for routerinfo->plaftorm, routerinfo->contact_info, and rend*.c. (need sleep now)
svn:r6087
2006-03-05 09:50:26 +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
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
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
39265dd72e In my private little universe, terminals are still 80 columns. Impose a 160-character-per-line limit; this will creep down.
svn:r5548
2005-12-09 05:37:26 +00:00
Nick Mathewson
fea19528a1 assert_buf_ok was showing up in the profile; remove it from critical-path functions, since it hasnt triggered for ages.
svn:r5479
2005-11-30 22:48:58 +00:00
Roger Dingledine
c4aa9e7941 Add a new config option TestSocks so people can see if their
applications are using socks4, socks4a, socks5-with-ip, or
socks5-with-hostname. This way they don't have to keep mucking
with tcpdump and wondering if something got cached somewhere.


svn:r5399
2005-11-16 23:37:35 +00:00
Roger Dingledine
bf2be9abd7 Do round-robin writes of at most 16 kB per write. This might
be more fair on loaded Tor servers, and it might resolve our
Windows crash bug. It might also slow things down.


svn:r5332
2005-10-29 18:19:37 +00:00
Nick Mathewson
5d85560d9e Remove last vestiges of old logging interface.
svn:r5317
2005-10-25 18:01:01 +00:00
Nick Mathewson
f9b0be526e Use LD_BUG as appropriate; convert rend* and router* to new logging interface; use new circ_log_path interface
svn:r5302
2005-10-24 19:39:45 +00:00
Nick Mathewson
55f2ab9cc3 Migrate a few more files to domained logging
svn:r5285
2005-10-18 22:21:29 +00:00
Nick Mathewson
998cf8d622 Try to extract as many descriptors as possible from truncated http responses. (when DIR_PURPOSE_FETCH_ROUTERDESC)
svn:r5249
2005-10-14 02:26:13 +00:00
Nick Mathewson
ba24193ab5 Make doxygen marginally happier
svn:r5208
2005-10-06 04:33:40 +00:00
Nick Mathewson
de198d800b Never call free() on tor_malloc()d memory. This is unlikely to be our current leak, but it may help dmalloc work.
svn:r5168
2005-09-30 20:47:58 +00:00
Nick Mathewson
92451f74a8 Reformat inconsistent function declarations.
svn:r5160
2005-09-30 01:09:52 +00:00
Roger Dingledine
fba01c3cc0 bugfix: we were whining about using socks4 or socks5-with-local-lookup
even when they used an IP in the "virtual" range we designed exactly
for this case.


svn:r5142
2005-09-24 21:56:04 +00:00
Roger Dingledine
6a52aa52fe fix a pair of hard-coded urls
svn:r4887
2005-08-30 07:01:30 +00:00
Nick Mathewson
4870877231 Add SOCKSAndDNS link to appropriate log message, since we wind up pointing everybody to it anyway
svn:r4695
2005-08-04 20:12:44 +00:00
Nick Mathewson
0828feaf7c Add belt-and-suspenders fix to coredump from yesterday; document more functions in buffers.c
svn:r4532
2005-07-12 18:19:30 +00:00
Roger Dingledine
8f9790a023 fix a seg fault with autodetecting which controller version is being used
svn:r4531
2005-07-12 05:48:15 +00:00
Roger Dingledine
9c67ae34f1 overall cleanup and streamlining and doccing
also fix a DoS avenue on dirservers


svn:r4468
2005-06-20 23:04:13 +00:00
Nick Mathewson
9b4aa8d2ab Implement all the easy bits of the new control protocol
svn:r4449
2005-06-17 20:37:21 +00:00
Nick Mathewson
f9f09f1c5e Start implementing framework for revised control spec.
svn:r4447
2005-06-17 18:49:55 +00:00
Roger Dingledine
91b1fb7ff7 some more cleaning and docing
svn:r4415
2005-06-11 21:17:38 +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
Roger Dingledine
2587fa09f9 move more docs into our code
svn:r4406
2005-06-11 06:07:22 +00:00
Roger Dingledine
fcd0fc3364 flesh out the source file descriptions for doxygen
svn:r4404
2005-06-11 05:31:17 +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
Roger Dingledine
d922fa7b10 fix another underflow in keeping stats
these size_ts are subtle buggers


svn:r4364
2005-06-09 03:57:54 +00:00
Nick Mathewson
87caad5445 Fix an underflow in buffer use conting.
svn:r4360
2005-06-08 21:55:02 +00:00
Nick Mathewson
b0538591c7 Reset buf->highwater every time buf_shrink is called, not just on suffessful shrink.
svn:r4353
2005-06-08 20:17:32 +00:00
Roger Dingledine
4c43789435 Some play code to throw away old buffers sometimes rather
than constantly reallocing them; just in case this is our memory
problem. It looks for now like it isn't, so disabled.


svn:r4349
2005-06-08 17:27:11 +00:00
Nick Mathewson
baa10cbbfa Instrument buffers.c and rephist.c memory usage
svn:r4317
2005-06-06 17:03:21 +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
8b9ae25224 Change some >=s to >s in buf_resize, so that we do not denormalize buffers on resize.
svn:r4172
2005-05-03 03:25:04 +00:00
Nick Mathewson
14bac4dad4 Elaborate on buf_shrink comment.
svn:r4169
2005-05-02 23:41:39 +00:00
Roger Dingledine
aa6bcd50ca comment buf_shrink
svn:r4168
2005-05-02 23:39:09 +00:00
Nick Mathewson
ad547cbb8c Correct and simplify buf_shrink logic
svn:r4167
2005-05-02 23:36:13 +00:00
Nick Mathewson
d6a6c8785b When removing all bytes from a buffer, reset buf->cur=buf->mem
svn:r4166
2005-05-02 23:32:23 +00:00
Nick Mathewson
a312ce1d3b Change buffer shrinking strategy: only try to shrink once every 3 minutes. Do not try to read over buffer size unless buffer is nearly empty.
svn:r4165
2005-05-02 23:17:08 +00:00
Nick Mathewson
9c683c7613 Make buffer shrinking algorithm a little smarter.
svn:r4164
2005-05-02 22:49:24 +00:00
Nick Mathewson
fe65e57ca1 Re-do fragmented control message handling to work with new buf_t system.
svn:r4144
2005-04-27 22:01:34 +00:00
Nick Mathewson
d0a9a8bdd3 Appease VC7. It has a strangely puritanical attitude about what programmers are allowed to do a consenting void*.
svn:r4140
2005-04-27 20:02:52 +00:00
Nick Mathewson
53607d3bb3 Turn SENTINELS back on; give NOINLINE a name and turn it off.
svn:r4139
2005-04-27 19:40:31 +00:00
Roger Dingledine
4c4a14e3cb turn off the mongo debugging stuff, for performance tests
svn:r4137
2005-04-27 17:21:42 +00:00
Nick Mathewson
52376dc9e8 Rename buf->start to buf->cur; fix bug in read_to_buf; still debug with paranoia.
svn:r4130
2005-04-27 02:55:21 +00:00
Nick Mathewson
746768df5d Add even more debugging code; temporarily disable inlines in buffers.c
svn:r4129
2005-04-27 00:53:44 +00:00
Roger Dingledine
2a7aec0ffd fix function prototype, fix typo
svn:r4126
2005-04-26 21:29:20 +00:00
Nick Mathewson
ecc76d8245 Avoid overflow on wrapping a TLS read.
svn:r4125
2005-04-26 21:20:22 +00:00
Nick Mathewson
9ba2dd7ea1 Clean/renormalize whitespace
svn:r4122
2005-04-26 20:55:32 +00:00
Nick Mathewson
ef2409e4ed Change the implementation of buf_t a lot: make it a ring buffer to minimize memmove on flush. This may break the universe, but it is probably Necessary For Perfomance.
svn:r4121
2005-04-26 20:53:22 +00:00
Roger Dingledine
12ea3a26b2 bugfix: make a debug log stop lying
svn:r4110
2005-04-25 15:43:05 +00:00
Nick Mathewson
5827e2e216 Fix "JAP-client" hideous ASN1 bug, twice. (Fix1: check more thoroughly for TLS errors when handling certs. Fix2: stop assert(0)ing on uncaught TLS errors.)
svn:r4085
2005-04-23 14:26:02 +00:00
Roger Dingledine
97637549bb tie MAX_DIR_SIZE to MAX_BUF_SIZE
resolve bug 80


svn:r4052
2005-04-07 22:13:17 +00:00
Nick Mathewson
0e81265359 update copyright notices.
svn:r3982
2005-04-01 20:15:56 +00:00
Nick Mathewson
97dad670ea Renormalize whitespace
svn:r3757
2005-03-14 03:18:35 +00:00
Nick Mathewson
aaf70df3bd Fix signed/unsigned warning
svn:r3736
2005-03-10 18:45:42 +00:00
Nick Mathewson
b494c2223d Specify and implement fragmented control messages to allow for (among other things) long GETINFO replies. Otherwise we could hit the 64K barrier on questions like "please dump your client-side DNS cache."
svn:r3726
2005-03-02 20:22:10 +00:00
Nick Mathewson
4ddf768a4f Forward-port new reasons; clean up code more; add code to convert new reasons to SOCKS5 reply codes; add code to convert errnos to reasons. New code still needs to get invoked.
svn:r3719
2005-03-01 22:16:15 +00:00
Nick Mathewson
6e6d95b3db Change from inet_ntoa to a threadproof tor_inet_ntoa.
svn:r3656
2005-02-22 08:18:36 +00:00
Roger Dingledine
a005509c9d update url for when users try to use socksport as an http proxy
svn:r3265
2005-01-03 23:19:15 +00:00
Roger Dingledine
f50b785c3b and forward port the cleanup
svn:r3211
2004-12-22 10:04:50 +00:00
Roger Dingledine
18320557a1 fix a crash: if you do socks4 with an IP of 0.0.0.x then we get tricked
into thinking you're doing socks4a, and we look for the next byte.

thanks to aphex for finding this.


svn:r3207
2004-12-22 09:52:29 +00:00
Roger Dingledine
ad4f440e10 rearrange debug logs to make more sense
svn:r3116
2004-12-07 21:57:10 +00:00
Nick Mathewson
b457cfb5eb Spell-check strings and comments
svn:r3052
2004-12-01 03:48:14 +00:00
Nick Mathewson
7fbd297532 Suggestion from weasel: Make tor --version --version dump the cvs Id of every file.
svn:r3019
2004-11-29 22:25:31 +00:00
Roger Dingledine
22727b4edc wrong is ok, and right is fine, but in between is apparently
totally unacceptable to me.


svn:r3005
2004-11-28 11:39:53 +00:00
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