Commit Graph

855 Commits

Author SHA1 Message Date
Nick Mathewson
9cec3a13f5 remove some functions that are not used; #if0 out some files that are not likely to be used.
svn:r5471
2005-11-30 06:27:59 +00:00
Nick Mathewson
6b49a93bd5 Move code to check for zero digests into util.c
svn:r5468
2005-11-30 02:47:59 +00:00
Nick Mathewson
72cb64406a HT_NEXT invalidates the last iterator; fix rmv-related segfault.
svn:r5458
2005-11-26 00:42:25 +00:00
Roger Dingledine
b6b1b4f283 Bandaid workaround to make cvs not crash tor clients.
This is not a real fix. I didn't look at the rest of the code.
Nick?


svn:r5455
2005-11-25 02:16:10 +00:00
Nick Mathewson
05482a0899 Add functions to return number of elts in associative containers
svn:r5448
2005-11-23 07:48:13 +00:00
Nick Mathewson
a39269572f Replace balanced trees with hash tables: this should make stuff significantly faster.
svn:r5441
2005-11-23 04:18:45 +00:00
Roger Dingledine
8182eb69cd a smidgen more hint when we fail to seed the rng
svn:r5438
2005-11-21 01:12:01 +00:00
Nick Mathewson
83d6b0387b Try to build with OpenSSL 0.9.6. Lets pay attention to see if anybody complains.
svn:r5398
2005-11-16 05:22:44 +00:00
Nick Mathewson
6c361468c1 Loops without an increment step can suck, even on windows.
svn:r5376
2005-11-15 03:16:32 +00:00
Nick Mathewson
9b432311c4 Make new logging stuff work on windows; fix a couple of windows typos.
svn:r5375
2005-11-15 03:05:23 +00:00
Nick Mathewson
e022aa73e6 Hm; looks like the callback business was unnecessary, since DHparams_dup() copies dh->length.
svn:r5372
2005-11-14 21:17:38 +00:00
Nick Mathewson
027d0ef18c Use a callback to set our DH parameters; set SSL_OP_SINGLE_DH_USE.
svn:r5371
2005-11-14 19:20:47 +00:00
Nick Mathewson
887178e710 Oops. It looks like there *was* an easy way to make openssl do what we wanted.
svn:r5370
2005-11-14 19:18:31 +00:00
Roger Dingledine
ed4f15b2a7 When logging via syslog, include the pid whenever we provide
a log entry. Suggested by Todd Fries.


svn:r5366
2005-11-13 22:28:07 +00:00
Roger Dingledine
5ef2927870 correct nick's comment
svn:r5360
2005-11-11 21:44:38 +00:00
Nick Mathewson
f14743a975 Note that much of check_dh_key is voodoo; make x in DH be only 320 bits for DH speed improvement: this wants auditing. [We have blessing from Ian on this.] (Note that DH in SSL is not yet affected.)
svn:r5359
2005-11-11 20:18:00 +00:00
Roger Dingledine
87e8e7b4fa using an unsigned int for something that requires at least 3 bytes
makes me uncomfortable.


svn:r5340
2005-11-01 06:15:48 +00:00
Roger Dingledine
c68cadc0c8 tor_assert had a misleading comment
svn:r5338
2005-11-01 06:12:51 +00:00
Roger Dingledine
a2a4f4ae61 cleanups and a smidgen more docs
svn:r5335
2005-11-01 03:47:55 +00:00
Nick Mathewson
3c36a14ba6 Call ERR_remove_state() on the main thread on shutdown,too
svn:r5322
2005-10-26 02:20:48 +00:00
Nick Mathewson
9492424d3f Per comments at the bottom of openssl/FAQ, call even more functions to
clean up OpenSSL's toys when it's done playing.  (Why isn't there an
OpenSSL_free_everything() function?)


svn:r5321
2005-10-25 19:01:48 +00:00
Nick Mathewson
5d85560d9e Remove last vestiges of old logging interface.
svn:r5317
2005-10-25 18:01:01 +00:00
Roger Dingledine
d7e136240a consistency is the hobgoblin of little armas
svn:r5316
2005-10-25 17:58:43 +00:00
Nick Mathewson
049f6c0131 Switch remaining files to new log interface.
svn:r5315
2005-10-25 17:52:14 +00:00
Nick Mathewson
7a9774eff0 Also here.
svn:r5314
2005-10-25 17:42:09 +00:00
Peter Palfrader
0738c24b97 Fix log levels notice and warn for new logging stuff
svn:r5313
2005-10-25 17:41:43 +00:00
Nick Mathewson
e7e170a59e Change more files to new loggin interface. 3 left.
svn:r5310
2005-10-25 08:20:10 +00:00
Nick Mathewson
932106f54c Efficiency hack: call tor_fix_source_file late, not early. Add "BUG" domain. Domains are now bitmasks... just in case. Make some err msgs non-general.
svn:r5309
2005-10-25 07:05:03 +00:00
Nick Mathewson
beaf898fe5 add more domains
svn:r5300
2005-10-24 19:36:43 +00:00
Nick Mathewson
a20835ac92 Check for even more windows version flags, and note any we do not recognize.
svn:r5297
2005-10-24 18:37:09 +00:00
Nick Mathewson
1bd3f6cc9a Update more files to new log stuff.
svn:r5286
2005-10-18 22:56:40 +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
edf5698474 Start dividing log messages into logging domains. No, LD_ is not the best of identifiers. src/or has not been converted yet. Domains dont do anything yet.
svn:r5284
2005-10-18 21:58:19 +00:00
Nick Mathewson
5828f8920e Add a "Map from digest to void*" abstraction, since we already faked it in 3 places by encoding keys in hex and sticking them in a strmap.
svn:r5278
2005-10-18 20:11:39 +00:00
Nick Mathewson
0349598928 stupid gcc. stupid nickm.
svn:r5277
2005-10-18 17:52:45 +00:00
Nick Mathewson
95514b32a5 Make smartlist_foreach always use the fast versions.
svn:r5275
2005-10-18 17:38:07 +00:00
Nick Mathewson
48ade882c3 Remove assert in sort-of c-itical path
svn:r5267
2005-10-18 05:06:36 +00:00
Nick Mathewson
cf73ff195b Actually, use #defines for common case. Nothing to see here.
svn:r5266
2005-10-18 05:03:44 +00:00
Nick Mathewson
768160c872 Inline key smartlist functions; use fast versions by default.
svn:r5265
2005-10-18 04:51:07 +00:00
Peter Palfrader
0d9aedfcea Downgrade a few INFO level logs to DEBUG again. Also add two or three new
logs in cases where a calling function's log was downgraded and we wouldn't
get any log message otherwise.


svn:r5263
2005-10-17 16:21:42 +00:00
Roger Dingledine
03dcef4c78 start the process of reducing clutter in server logs
svn:r5253
2005-10-17 00:35:53 +00:00
Nick Mathewson
11b76b9ca5 Allow tor_gzip_uncompress to extract as much as possible from truncated compressed data. Also, fix a bug where truncated compressed data could break tor_gzip_uncompress. [This last part is a backport candidate.]
svn:r5247
2005-10-13 22:48:09 +00:00
Nick Mathewson
9bc2467626 Okay, try to use RAND_poll() from OpenSSL where available.
svn:r5229
2005-10-08 05:47:15 +00:00
Roger Dingledine
c4757e0705 LOG_ERR is for when we know we're going to exit. use LOG_WARN in other
cases.


svn:r5220
2005-10-07 19:53:57 +00:00
Nick Mathewson
010bcfa9df Win32 compilation/correctness fixes.
svn:r5218
2005-10-07 19:33:47 +00:00
Nick Mathewson
150e5ac098 disable RAND_poll() for the alpha of the day; at least 24 hours of testing is in order for something like that.
svn:r5216
2005-10-07 19:17:20 +00:00
Nick Mathewson
a53ecc94f9 Add half our entropy from RAND_poll in OpenSSL. These know how to use egd (if present) openbsd weirdness (if present), vms/os2 weirdness (if we ever port there), and more in the future.
svn:r5215
2005-10-07 19:03:09 +00:00
Nick Mathewson
a89daaeca9 Once an hour (not just on startup) give OpenSSL some more entropy.
Add entropy in 512-bit chunks, not 160-bit chunks.  (This latter
change is voodoo.)


svn:r5211
2005-10-06 22:22:22 +00:00
Nick Mathewson
cc35e1720f Using RAND_pseudo_bytes instead of RAND_bytes is an accident waiting to happen, and does not really speed us up much when we do it. So stop doing it.
svn:r5210
2005-10-06 22:18:01 +00:00
Nick Mathewson
ba24193ab5 Make doxygen marginally happier
svn:r5208
2005-10-06 04:33:40 +00:00
Nick Mathewson
92abf1b653 Make windows platform detection smarter. {Untested.}
svn:r5198
2005-10-05 22:04:45 +00:00
Nick Mathewson
f8c07e1f33 free EVP cipher information on shutdown to remove some spurious dmalloc complaints.
svn:r5180
2005-10-03 21:10:35 +00:00
Nick Mathewson
fd04db90b5 Stop leaking storage for EVP keys. (This would be a critical bug if it had ever appeared in a released version.)
svn:r5179
2005-10-03 20:53:27 +00:00
Nick Mathewson
c5ee3e961e Reorganize some quick-and-dirty code to find out what openssl stuff is leaking, using dmalloc.
svn:r5178
2005-10-03 20:20:38 +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
26e7a05725 even better function start checks; give dmalloc a chance of working.
svn:r5162
2005-09-30 01:39:24 +00:00
Nick Mathewson
92451f74a8 Reformat inconsistent function declarations.
svn:r5160
2005-09-30 01:09:52 +00:00
Nick Mathewson
5c53545d81 Add a bunch more warnings to out warning suite; resolve them; pack structs a little better.
svn:r5150
2005-09-29 22:59:17 +00:00
Nick Mathewson
2999cbf233 Use EVP_CIPHER_CTX version of AES from openssl, so openssl can use engines (if they exist).
svn:r5146
2005-09-27 19:39:25 +00:00
Nick Mathewson
0873386600 Point readers of the code to opensslv.h, since everybody who sees 0x0090700f looks at me like some kind of loon
svn:r5140
2005-09-24 16:39:33 +00:00
Nick Mathewson
d661fde082 Possible fix to make aes build on woody
svn:r5139
2005-09-24 16:37:24 +00:00
Nick Mathewson
96988b45b4 Use OpenSSL AES when OpenSSL has version 0.9.7 or later.
svn:r5129
2005-09-23 18:50:50 +00:00
Nick Mathewson
f8a80e8d59 Helper functions to perform our truncated base64 encoding on hexdigests.
svn:r5087
2005-09-18 02:18:59 +00:00
Nick Mathewson
312af36126 Make smartlist_add_all more efficient.
svn:r5086
2005-09-18 02:17:02 +00:00
Nick Mathewson
6973ef9be4 Add a touch_file() function to compat so we can update cache mtimes.
svn:r5067
2005-09-14 23:27:52 +00:00
Nick Mathewson
922cee3d0c Clean up a few warnings that make gcc twig out a bit.
svn:r5062
2005-09-14 20:59:25 +00:00
Nick Mathewson
d9bf9e48c0 Add documentation to a few functions in container.c; reformat function definitions
svn:r5026
2005-09-13 15:30:22 +00:00
Nick Mathewson
d4fb1fcd6c Two new functions like write_bytes_to_file: one takes a list of byte-and-len structs; one appends.
svn:r5024
2005-09-13 06:19:31 +00:00
Nick Mathewson
c1a6940e73 make compile slightly happier on const-zealous compilers
svn:r5015
2005-09-12 08:29:53 +00:00
Nick Mathewson
2689cb081b We have so many special cases for smartlists of strings, why not add a sort function?
svn:r5014
2005-09-12 08:27:01 +00:00
Nick Mathewson
8d70ae01b8 Fix a memory leak in smartlist_string_remove.
svn:r5002
2005-09-12 05:20:29 +00:00
Nick Mathewson
24bfac635d Document SMARTLIST_FOREACH macro, along with previously-naughty foo_sl_idx variable.
svn:r5000
2005-09-11 23:14:14 +00:00
Nick Mathewson
a4f32e77ef Fix segfault in win32 unittests.
svn:r4983
2005-09-10 02:34:32 +00:00
Nick Mathewson
d26523e089 Use tor_listdir in test.c instead of duplicating ode.
svn:r4981
2005-09-10 01:42:42 +00:00
Nick Mathewson
035b1953eb Add sorting/searching to smartlist
svn:r4977
2005-09-09 23:12:54 +00:00
Nick Mathewson
6b479b3cfa Only do openssl accel stuff if version is at least 0.9.7
svn:r4973
2005-09-09 22:07:15 +00:00
Nick Mathewson
09d83c564b Add missing arg to windows tor_listdir()
svn:r4972
2005-09-09 21:34:59 +00:00
Nick Mathewson
2f6eb10fb4 Implement tor_listdir on windows. Untested.
svn:r4971
2005-09-09 21:29:23 +00:00
Nick Mathewson
c4b3bf06c6 add strupper function
svn:r4934
2005-09-08 18:33:51 +00:00
Roger Dingledine
780261aa2e don't crash now that LongLivedPorts can be null
svn:r4923
2005-09-08 06:47:27 +00:00
Nick Mathewson
b6a13b6cdf Add directory listing functions to util.[ch]. Watch the features creep!
svn:r4906
2005-09-03 04:40:05 +00:00
Nick Mathewson
29a6c17d67 Allow tor_gzip_uncompress to handle multiple concatenated compressed strings.
svn:r4882
2005-08-29 18:01:38 +00:00
Roger Dingledine
fa507c63e8 put quotes around user-supplied strings so they are more likely to
realize if they add bad characters (like quotes) to the torrc


svn:r4844
2005-08-26 18:40:44 +00:00
Roger Dingledine
d5e426ab51 add a tor_dup_addr() function to simplify malloc()+tor_inet_ntoa()
svn:r4838
2005-08-26 07:37:07 +00:00
Nick Mathewson
9321db8c29 Fix bug with tor_memmem finding a match at the end of the string.
svn:r4803
2005-08-22 00:34:23 +00:00
Roger Dingledine
121ea4dd93 a url for better reference
svn:r4778
2005-08-15 01:03:50 +00:00
Nick Mathewson
d1c094637d Try to resolve another reported solaris x86 warning
svn:r4771
2005-08-12 17:26:43 +00:00
Nick Mathewson
789374dbbd Make GCC very happy, even with lots of warnings set. Also, try to fix some reported Solaris x86 warnings.
svn:r4770
2005-08-12 17:24:53 +00:00
Nick Mathewson
943ef5256b fix whitespace issues
svn:r4752
2005-08-08 21:59:48 +00:00
Roger Dingledine
f4eec180a2 disarm a trap that's lying in wait for us
svn:r4741
2005-08-08 17:31:57 +00:00
Nick Mathewson
9345323b18 far far cleaner implementation of handshake checking logic. Backport candidate.
svn:r4736
2005-08-07 20:36:14 +00:00
Roger Dingledine
bfe65db284 ok, so now it was just redundant. nick, do you recall what rfc
you were trying to point to?


svn:r4727
2005-08-07 17:11:33 +00:00
Roger Dingledine
b9a7482c02 note another potential security problem with generating key material
from our DH handshake.


svn:r4724
2005-08-06 16:50:51 +00:00
Roger Dingledine
261bf4c4d4 rfc 3536 "provides a glossary of terms used in the IETF when discussing
internationalization."


svn:r4723
2005-08-05 22:08:57 +00:00
Nick Mathewson
224fecb281 Appease insane windows compiler. (Oh no, an extra semi, the sky is falling!)
svn:r4722
2005-08-05 19:25:23 +00:00
Nick Mathewson
197eb2b2cb fix harmless copy-and-paste error
svn:r4718
2005-08-05 14:59:14 +00:00
Nick Mathewson
ea2aa107a7 cover a few more cases; needs testing and once-over
svn:r4717
2005-08-05 14:20:38 +00:00
Nick Mathewson
666ab41e2b parse_addr_port was vague about what to do when port_out was NULL. Make it behave usefully.
svn:r4716
2005-08-05 01:51:19 +00:00
Nick Mathewson
3fa821d911 oops, that array got bigger
svn:r4708
2005-08-04 23:18:51 +00:00
Nick Mathewson
7a9eb49f5f Discard special bignum values.
svn:r4706
2005-08-04 23:14:42 +00:00
Nick Mathewson
546fba7b04 Fix windows warning
svn:r4697
2005-08-04 22:25:39 +00:00
Nick Mathewson
11ff0aba80 Make clients regenerate their keys when their IP address changes.
svn:r4688
2005-08-03 20:42:17 +00:00
Nick Mathewson
98f1265309 Fix compile failures on tor_gettimeofday() fix for windows
svn:r4685
2005-08-03 17:16:48 +00:00
Nick Mathewson
176e9055cc Probably broken attempt to improve tor_gettimeofday granularity on windows.
svn:r4683
2005-08-03 16:28:39 +00:00
Nick Mathewson
48787c839e Fix logic to set TIME_T_MAX; apparently, everybody had thought of the prospect of a signed time_t but me.
svn:r4675
2005-07-25 18:10:08 +00:00
Roger Dingledine
cfd6514482 and a nearby define
svn:r4643
2005-07-23 02:19:43 +00:00
Nick Mathewson
b98e4a0cd7 add parenthesis to U64_PRINTF_ARG macro
svn:r4642
2005-07-23 02:12:40 +00:00
Nick Mathewson
18c11eb3bc Be consistent about preferring foo* to struct foo*
svn:r4637
2005-07-22 21:12:10 +00:00
Roger Dingledine
8c657e4157 cosmetic fixes
svn:r4601
2005-07-18 23:33:19 +00:00
Roger Dingledine
bb97d7f4ea slightly cleaner fix
svn:r4599
2005-07-18 23:16:09 +00:00
Roger Dingledine
893652da84 bugfixes: smartlist_join_strings2() was underflowing a size_t
if you gave it an empty smartlist; and it wasn't terminating in
this case even if you asked it to.

this does not appear to be exploitable in any reasonable cases.


svn:r4598
2005-07-18 23:11:46 +00:00
Nick Mathewson
97c58f066a whitespace fixes
svn:r4544
2005-07-13 17:24:55 +00:00
Nick Mathewson
278bac421f Fix windows compilation
svn:r4543
2005-07-13 15:24:33 +00:00
Nick Mathewson
50e11ee16a Fix possible double call to inflateEnd.
svn:r4540
2005-07-13 05:26:43 +00:00
Roger Dingledine
4457c181f5 note a worrying double-free possibility in torgzip.
nick?


svn:r4537
2005-07-12 23:21:15 +00:00
Nick Mathewson
d85bfe83bf Make errors retrievable from tor_socketpair; resolve bug 163.
svn:r4509
2005-06-30 07:17:38 +00:00
Nick Mathewson
584a0ae397 Fix an fd leak in start_daemon
svn:r4508
2005-06-30 06:56:00 +00:00
Nick Mathewson
1647b6f837 Fix libc compilation
svn:r4497
2005-06-27 23:40:17 +00:00
Nick Mathewson
806da0d8b2 Compile on win32
svn:r4496
2005-06-27 23:35:04 +00:00
Roger Dingledine
09e87f452d note a bug in our tor_socketpair implementation
can somebody fix this or create a flyspray entry for it?


svn:r4483
2005-06-26 05:03:21 +00:00
Nick Mathewson
a37db0da26 Appease the hungry God of GCC: it hates K&R style unspecified args!
svn:r4470
2005-06-21 01:07:32 +00:00
Nick Mathewson
2aff87caae Load hardware acceleration options when/where available. Can anybody test this?
svn:r4467
2005-06-20 18:56:35 +00:00
Roger Dingledine
8fdab20704 fix typo
svn:r4453
2005-06-18 02:23:11 +00:00
Nick Mathewson
5fee58adfb Add a tor_memmem function
svn:r4452
2005-06-18 02:17:11 +00:00
Nick Mathewson
d4972bd2e1 Remove code that has been #if-0ed for a long time.
svn:r4435
2005-06-15 18:34:46 +00:00
Roger Dingledine
2111c0e263 a bit more cleanup
svn:r4417
2005-06-12 04:33:26 +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
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
Nick Mathewson
a6f51001a5 New whitespace normalization rule: no blank line at EOF.
svn:r4378
2005-06-09 16:46:51 +00:00
Nick Mathewson
8b2a7ff9fe Remove extraneous newlines from libevent log messages. Backport candidate?
svn:r4350
2005-06-08 17:41:32 +00:00
Nick Mathewson
1d9bc936c2 Adapt patch from Adam Langley: fix possible memory leak in tor_lookup_hostname
svn:r4326
2005-06-07 13:45:58 +00:00
Nick Mathewson
5420aed38e Possible bugfix for 151: backport candidate.
svn:r4318
2005-06-06 20:02:09 +00:00
Nick Mathewson
ea5591ee4d Implement --disable-threads
svn:r4187
2005-05-10 20:02:52 +00:00
Nick Mathewson
10b2208d93 Make Tor compile with no warnings with gcc4.0 on OSX
svn:r4184
2005-05-07 05:55:06 +00:00
Roger Dingledine
50505e677e fix a comment
svn:r4157
2005-05-02 21:49:04 +00:00
Roger Dingledine
509405a5f7 clean up this TOR_FRAGILE business
svn:r4116
2005-04-26 18:52:16 +00:00
Nick Mathewson
4fb95f166e Apparently, ASN1 failures are not treated as SSL connection errors, but are just general OpenSSL errors. Or something. Anyway, bulletproof tor_tls_handshake.
svn:r4098
2005-04-23 20:35:38 +00:00
Roger Dingledine
54fd9df23f LOG_ERR is for when you're planning to die.
svn:r4087
2005-04-23 14:35:13 +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
Nick Mathewson
f3b833cb47 Make libevent_logging_callback static.
svn:r4058
2005-04-08 03:47:18 +00:00
Roger Dingledine
8aa0df56f6 Stop putting nodename in the Platform string of server descriptors.
It doesn't actually help, and it is confusing/upsetting some people.


svn:r4037
2005-04-06 21:11:05 +00:00
Roger Dingledine
652dde72f1 bugfix: chdir to your datadirectory at the *end* of the
daemonize process, not the beginning. this was a problem
because the first time you run tor, if your datadir isn't
there, and you have runasdaemon set to 1, it will try to
chdir to it before it tries to create it. oops.


svn:r4033
2005-04-06 19:07:38 +00:00
Nick Mathewson
4991290935 Revise control spec and implementation to allow all log messages to be sent to controller with their severities intact.
svn:r4010
2005-04-05 22:56:17 +00:00
Nick Mathewson
7bf443e985 I hear the smart kinds compile before committing. Then they never miss parens
svn:r3999
2005-04-03 06:00:00 +00:00
Nick Mathewson
f696fd98bf Make smartlist_string_remove consistent with smartlist_string
svn:r3998
2005-04-03 05:58:23 +00:00
Nick Mathewson
ff545c3103 Add useful smartlist_string_remove function.
svn:r3996
2005-04-03 05:52:32 +00:00
Nick Mathewson
2a332bf0b8 Fix unterminated comment
svn:r3991
2005-04-03 05:21:16 +00:00
Nick Mathewson
0e81265359 update copyright notices.
svn:r3982
2005-04-01 20:15:56 +00:00
Nick Mathewson
73f6c1531e fix typo in earlier libevent mmessage suppress patch
svn:r3950
2005-04-01 07:16:52 +00:00
Nick Mathewson
410ecfcc71 Add code to suppress spurious libevent log msgs; use it to resolve bug 68.
svn:r3948
2005-04-01 07:05:21 +00:00
Nick Mathewson
efe9ca659a Use recent libevent features when possible
svn:r3940
2005-04-01 02:37:40 +00:00
Nick Mathewson
837d7dff69 Try to make crash-on-shutdown bug harder to trigger.
svn:r3939
2005-04-01 02:37:10 +00:00
Roger Dingledine
4a82ac12b8 add a tor_tls_is_server method to remember if conn->tls
was an initiator or a receiver


svn:r3931
2005-03-31 07:46:38 +00:00
Roger Dingledine
80901fde69 remember some thoughts about using WSAStartup to learn
how many sockets we get to use on win32.


svn:r3905
2005-03-28 01:11:02 +00:00
Nick Mathewson
905c16846a Fix a few more instances of memory not freed on exit (found by weasel).
svn:r3830
2005-03-23 06:20:50 +00:00
Roger Dingledine
248867caf5 bugfix: make smartlist_join_strings2 actually use the separator/terminator
svn:r3805
2005-03-22 05:37:59 +00:00
Nick Mathewson
df9c8feac7 Commit fixes for several pending tor core tasks: document all DOCDOCed functions; time out uncontrolled unattached streams; feed reasons to SOCKS5 (refactoring connection_ap_handshake_socks_reply in the process); change DirFetchPeriod/StatusFetchPeriod to have a special "Be smart" value.
svn:r3769
2005-03-17 12:38:37 +00:00
Nick Mathewson
be38e0a490 Fix a fun windows bug: apparently windows stat wants paths not to end with slash.
svn:r3766
2005-03-16 00:04:59 +00:00
Nick Mathewson
0197b47ce9 Fix some more obscure compiler warnings
svn:r3758
2005-03-14 03:28:46 +00:00
Nick Mathewson
97dad670ea Renormalize whitespace
svn:r3757
2005-03-14 03:18:35 +00:00
Nick Mathewson
c185825585 Finish implementing GETINFO; make it easy to query address maps.
svn:r3732
2005-03-03 06:37:54 +00:00
Nick Mathewson
97bc49bd72 Try a little harder to avoid openssl SSL* double-free reports.
svn:r3710
2005-02-28 02:52:51 +00:00
Nick Mathewson
0a2be3c9d8 Fix strmap_free to release memory actually held by the strmap.
svn:r3708
2005-02-28 02:21:40 +00:00
Nick Mathewson
bed6c05453 give a better warning when tor points at an https server.
svn:r3706
2005-02-28 01:55:09 +00:00
Nick Mathewson
2be0508f0d Be specific about which "illegal character" we just saw in the cert.
svn:r3699
2005-02-25 21:05:42 +00:00
Nick Mathewson
bbaa3c7792 Implement more control spec functionality
- Mapaddress
- Postdescriptor
- GetInfo on descriptors

Required changes elsewhere:
- Keep the most recent running_routers_t in the routerlist_t. That way we
  can learn about new routers and remember whether we were last told that
  they were up or down.  Also enables more simplifications.
- Keep the signed descriptor inside routerinfo_t.  This makes
  descriptor_entry_t in dirservers.c unneeded.
- Rename AddressMap (the verb) to MapAddress. Keep AddressMap as a noun.
- Check addresses for plausibility before mapping them.


svn:r3696
2005-02-25 20:46:13 +00:00
Roger Dingledine
55c3f15ed1 Forward-port the trick to bump up ConnLimit as far as it can
go, but not past MAXCONNECTIONS. Also throw away the FAKE_POLL
caveats since 0.1.0 doesn't need it any more.


svn:r3657
2005-02-22 23:52:44 +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
Nick Mathewson
e8da6b26b6 Note a non-bug in read_file_to_str as used. If we start to rely on it behaving differently, we need to change how it behaves. [Noticed by Chris Palmer]
svn:r3655
2005-02-22 07:18:46 +00:00
Nick Mathewson
d37f4dd8a9 But on windows, localtime and gmtime _are_ threadsafe.
svn:r3654
2005-02-22 07:09:17 +00:00
Nick Mathewson
70c3580f81 Patch to localtime/gmtime handling: use the _r variants where available. Use mutexes to fake _r where necessary. Make mutexes no-ops where no threading is enabled.
svn:r3653
2005-02-22 07:03:03 +00:00
Nick Mathewson
d01718841e Remove assumptions that maximum path length is anything like 1024. From comments by Chris Palmer
svn:r3652
2005-02-22 06:38:39 +00:00
Nick Mathewson
bb53a0bddd remove spurious semicolons
svn:r3650
2005-02-22 04:55:19 +00:00
Nick Mathewson
d060f845f2 Snarf some logic from python, adapted to our own needs, to handle gethostbyname_r correctly across platforms.
svn:r3649
2005-02-22 04:50:31 +00:00
Nick Mathewson
a68fcbf807 Initial IRIX compatibility fixes: check for inttypes.h; check for platform cell_t.
svn:r3648
2005-02-22 04:26:45 +00:00
Nick Mathewson
6bd81c9ee2 Fix windows build: do not spuriously include openssl where not needed; handle lack of gethostbyname_r properly.
svn:r3644
2005-02-22 02:51:55 +00:00
Roger Dingledine
b5bddd8cfd bugfix: actually use the argument to strmap_free()
svn:r3640
2005-02-20 23:12:20 +00:00
Roger Dingledine
596d65ec3b avoid case (not yet triggered) where smartlists could grow out
of control


svn:r3636
2005-02-19 03:02:33 +00:00
Nick Mathewson
aac97a3c6a Tell openssl how to use locks and how to find thread ids -- this may prevent race conditions surrounding the error queue.
svn:r3622
2005-02-13 22:32:25 +00:00
Nick Mathewson
f6221b695f Apply windows patch from Dmitri Bely
svn:r3617
2005-02-12 21:03:37 +00:00
Nick Mathewson
5d836c8140 Free tls resources on exit too
svn:r3615
2005-02-11 01:41:19 +00:00
Nick Mathewson
915202048e Handle return value from getaddrinfo properly
svn:r3526
2005-02-03 23:13:36 +00:00
Nick Mathewson
a035032f09 Use getaddrinfo and gethostbyname_r where available. Note that these are not necessarily threadsafe: this needs more thinking. Perhaps we should back down on this multithreading idea.
svn:r3522
2005-02-03 21:31:04 +00:00
Nick Mathewson
e4b21c97f7 Forward-port SGI Compatibility patches from Jan Schaumann
svn:r3517
2005-02-03 19:59:10 +00:00
Roger Dingledine
051cda803e point out a potential thread/process leak problem when we're out of memory
svn:r3512
2005-02-03 07:35:24 +00:00
Peter Palfrader
ddd724ef94 Add --with-dmalloc configure option
svn:r3508
2005-02-03 07:25:10 +00:00
Roger Dingledine
f3b74a2adb http://www.erlenstar.demon.co.uk/unix/faq_2.html says we
should call _exit, not exit, from child processes.


svn:r3506
2005-02-03 06:40:06 +00:00
Roger Dingledine
c53c7a0b4c clarify what smartlist_remove promises, since we rely on it.
svn:r3473
2005-01-31 00:24:59 +00:00
Nick Mathewson
083b67cda5 Add rudimentary pthread support that needs more testing.
svn:r3439
2005-01-27 22:34:48 +00:00
Nick Mathewson
fbb7f869c5 fwd-port win32 isprint fix
svn:r3410
2005-01-22 00:42:58 +00:00
Roger Dingledine
2a908e5180 forward-port: fix win32 compile
svn:r3406
2005-01-22 00:35:09 +00:00
Roger Dingledine
a2e441da06 give a header file for ntohs
svn:r3388
2005-01-20 20:15:14 +00:00
Nick Mathewson
29b6637a62 Compilation fixes for win32 version detection.
svn:r3385
2005-01-20 19:03:09 +00:00
Nick Mathewson
432e313c81 Make zlib detection happy on little-endian platforms; fix unit tests.
svn:r3384
2005-01-20 19:02:35 +00:00
Nick Mathewson
f8c14bbf1f Detect windows platform correctly
svn:r3377
2005-01-19 23:10:16 +00:00
Nick Mathewson
2c803bff9a Make detect_compression_method work on platforms with more evil chars.
svn:r3376
2005-01-19 23:07:43 +00:00
Nick Mathewson
69fa5be7b6 Workaround for webservers that lie about Content-Encoding: Tor now tries to autodetect compressed directories and compression itself. (resolves bug 65)
svn:r3374
2005-01-19 22:40:33 +00:00
Nick Mathewson
324b192f68 Make Tor use Niels Provos's libevent instead of it's current
poll-but-sometimes-select mess.  This will let us use faster async cores
(like epoll, kpoll, and /dev/poll), and hopefully work better on Windows
too.

There are some fairly nasty changes to main.c here; this will almost
certainly break something.  But hey, that's what alphas are for.


svn:r3341
2005-01-12 06:42:32 +00:00
Roger Dingledine
51f47d746e clean up smartlist_string_isin so callers don't have to manage bufs
themselves


svn:r3338
2005-01-12 04:53:53 +00:00