Commit Graph

885 Commits

Author SHA1 Message Date
Nick Mathewson
f170e5798f r8692@Kushana: nickm | 2006-08-31 13:38:07 -0400
Fix bug 327 (part 2): Cast char to unsigned char before passing to toupper/tolower.  (Follow the same idiom as with isupper and friends, in case we run into the same problem on SGI or whereever it was.)


svn:r8310
2006-08-31 17:39:51 +00:00
Nick Mathewson
bc0c39f85d r8691@Kushana: nickm | 2006-08-31 13:30:46 -0400
Fix bug 327 (part 1): Use correct macro to test for GCC 3 or later.


svn:r8309
2006-08-31 17:39:47 +00:00
Nick Mathewson
fee33d2ff1 r8682@Kushana: nickm | 2006-08-29 17:58:59 -0400
Fix compilation on GCC2 by disabling fun attributes unless __GNUC_MAJOR__ >= 3.


svn:r8303
2006-08-29 21:59:20 +00:00
Nick Mathewson
6fcdcc7fc7 r8626@Kushana: nickm | 2006-08-27 23:45:46 -0400
Aw, crap.  Non-gcc bug.  We need regular windows builds.


svn:r8259
2006-08-28 03:46:21 +00:00
Roger Dingledine
9f5856c03d stop three memory leaks. nick, fix these if i'm wrong.
svn:r8235
2006-08-27 02:07:54 +00:00
Nick Mathewson
b050ecf86c r7404@Kushana: nickm | 2006-08-16 09:32:19 -0400
Pass hints to getaddrinfo; fix bug 280 (?)


svn:r7069
2006-08-16 18:47:19 +00:00
Roger Dingledine
4b94dabb53 note a compile warning that we should investigate one day.
svn:r7052
2006-08-14 09:44:54 +00:00
Nick Mathewson
b68ffcc193 r7341@Kushana: nickm | 2006-08-11 00:51:05 -0700
Amazing how much difference adding a ! to all your asserts can make.


svn:r7029
2006-08-11 07:51:34 +00:00
Nick Mathewson
33fc829273 r7337@Kushana: nickm | 2006-08-11 00:42:04 -0700
Only use __builtin_offsetof with gcc 4 or later


svn:r7028
2006-08-11 07:42:11 +00:00
Nick Mathewson
42a5d7a4ba r7335@Kushana: nickm | 2006-08-11 00:13:03 -0700
fix wide lines


svn:r7025
2006-08-11 07:17:16 +00:00
Nick Mathewson
ffab3b48a8 r7326@Kushana: nickm | 2006-08-10 23:50:49 -0700
And another GCC change: predict that tor_frees() are usually real frees, and tor_asserts() usually wont happen. Other test should wait till -fprofile-arcs


svn:r7022
2006-08-11 07:09:35 +00:00
Nick Mathewson
4eddbcf262 r7325@Kushana: nickm | 2006-08-10 23:37:31 -0700
Use gcc offsetof where available.


svn:r7021
2006-08-11 07:09:28 +00:00
Nick Mathewson
09a895e222 r7324@Kushana: nickm | 2006-08-10 23:23:15 -0700
Add more warnings to the list of those we tolerate. Start using GCC attributes more, for better error checking and better code generation.


svn:r7020
2006-08-11 07:09:17 +00:00
Nick Mathewson
1b7ad5aed3 r7030@Kushana: nickm | 2006-08-04 14:46:52 -0700
Close an fd leak on failed mmap()


svn:r6988
2006-08-05 17:53:32 +00:00
Nick Mathewson
7c596c166b r7029@Kushana: nickm | 2006-08-04 14:08:41 -0700
Remove now-spurious size and data arguments from tor_mmap_file


svn:r6987
2006-08-05 17:53:21 +00:00
Nick Mathewson
dbac3fb481 r7028@Kushana: nickm | 2006-08-04 13:10:16 -0700
Make data and size fields visible in tor_mmap_t; hide win magic differently.


svn:r6986
2006-08-05 17:53:08 +00:00
Nick Mathewson
db72fb9cdc r7025@Kushana: nickm | 2006-08-04 12:03:22 -0700
Finish (I hope) windows mmap impl.


svn:r6981
2006-08-04 19:03:40 +00:00
Nick Mathewson
bf72878cad r7012@Kushana: nickm | 2006-08-03 19:21:25 -0700
Add an "mmap handle" type to encapsulate bookkeeping elements of mmap issues; add prelim win32 impl


svn:r6980
2006-08-04 18:32:43 +00:00
Roger Dingledine
e64825126b turn future seg faults into asserts
svn:r6970
2006-08-03 04:23:45 +00:00
Nick Mathewson
80282d8f55 r6993@Kushana: nickm | 2006-07-31 16:19:21 -0400
Interesting how much a ! can change the behavior of an assert.


svn:r6962
2006-07-31 20:19:58 +00:00
Nick Mathewson
ea0f5ec8ad r6980@Kushana: nickm | 2006-07-31 13:18:22 -0400
Add a utility function to verify that a string has been through strlower.


svn:r6959
2006-07-31 18:01:37 +00:00
Nick Mathewson
d934607069 r6979@Kushana: nickm | 2006-07-31 13:16:58 -0400
Add assert_ok functions for strmap and digestmap; use them in unit test code.


svn:r6958
2006-07-31 18:01:27 +00:00
Nick Mathewson
3843b1b3d0 r6978@Kushana: nickm | 2006-07-31 13:16:14 -0400
Add isupper and islower wrappers to compat.h


svn:r6957
2006-07-31 18:01:22 +00:00
Nick Mathewson
2fe537c57a r6958@Kushana: nickm | 2006-07-29 18:54:15 -0400
Looks like we might need a priority queue.


svn:r6953
2006-07-31 17:59:37 +00:00
Nick Mathewson
8786b4b88e Fix a bug in HT_REMOVE.
svn:r6925
2006-07-27 18:35:25 +00:00
Nick Mathewson
45c3a4365f Get better numbers out of HT_REP_OK
svn:r6924
2006-07-27 17:37:37 +00:00
Peter Palfrader
521c006fd5 Remove .cvsignore files from trunk
svn:r6891
2006-07-25 01:00:48 +00:00
Nick Mathewson
6d2eb77555 Whitespace fix
svn:r6816
2006-07-23 07:19:49 +00:00
Nick Mathewson
35960e1162 Add a mem_is_zero function (I think we will need this) and a STRUCT_OFFSET macro (we already need this).
svn:r6810
2006-07-23 05:32:35 +00:00
Nick Mathewson
08a4114abf Another MSVC6 fix. Grnk.
svn:r6802
2006-07-21 14:53:23 +00:00
Nick Mathewson
77c28d112b Hm. We probably should define INT64_MAX if we really want it. (Especially since we only want it on one platform, where, coincidentally, it is not defined.)
svn:r6784
2006-07-18 02:01:32 +00:00
Nick Mathewson
e572d5990c MSVC6 is apparently terrified of unnatural cross-breeding between uint64_t and double, and needs more persuasion than usual to cast one to the other. Issue identified by Frediano Ziglio; patch revised for minimal impact on non-MSVC6 compilers.
svn:r6768
2006-07-17 00:39:05 +00:00
Roger Dingledine
3d79eb52ab stick to nick's nul/null convention
svn:r6763
2006-07-15 19:21:30 +00:00
Nick Mathewson
28a7c8a64c Make compilation work on old MSVCs without GetVertsionEx magic. Patch from Frediano Ziglio.
svn:r6749
2006-07-09 22:29:12 +00:00
Roger Dingledine
fad85f173a when an exit node gets a malformed begin cell, don't complain to
the node operator, since he can't do anything about it.


svn:r6733
2006-07-06 02:44:07 +00:00
Roger Dingledine
12cc290a7d ok, i'm not allowed to say that there. oh well.
svn:r6720
2006-07-04 16:11:35 +00:00
Roger Dingledine
579849f600 fix a misleading function comment
svn:r6717
2006-07-04 15:52:22 +00:00
Roger Dingledine
5dc1e6f788 if we're the server-side of the tls and there are problems,
don't yell as loudly.


svn:r6716
2006-07-04 15:51:59 +00:00
Roger Dingledine
35e95d7783 minor fixes
svn:r6710
2006-07-04 03:25:07 +00:00
Nick Mathewson
05eff35ac6 Harmless: Z_OK is not an acceptable answer to Z_FINISH.
svn:r6701
2006-06-29 11:17:36 +00:00
Nick Mathewson
1cd04abf1a Actually enable mmap. That should improve matters.
svn:r6694
2006-06-28 08:54:32 +00:00
Nick Mathewson
06e09cdd47 Apparently, zlib sometimes reports Z_BUF_ERROR on input exhaustion as well as on running out of output space. This could well fix the assert bug reported by weasel and arma.
svn:r6682
2006-06-24 02:06:52 +00:00
Nick Mathewson
06ffee3b67 Ooh, that could have been bad. Sort digests as digests, not strings.
svn:r6679
2006-06-22 07:29:14 +00:00
Nick Mathewson
e2697a62ac When requesting or serving resources via fingerprint/digest, request and respond in-order, removing duplicates.
svn:r6673
2006-06-21 04:57:12 +00:00
Nick Mathewson
73ada60d64 remove non-germane comment
svn:r6640
2006-06-18 07:37:21 +00:00
Nick Mathewson
f83a628a76 perhaps the reason I rail against cut-and-paste programming so vehemently is that I am so bad at it.
svn:r6638
2006-06-18 07:32:31 +00:00
Nick Mathewson
630e9cd510 Add some incremental encryption wrappers to torgzip code
svn:r6636
2006-06-18 07:24:29 +00:00
Nick Mathewson
af8096815e Add a memdup function to util
svn:r6635
2006-06-18 07:22:36 +00:00
Nick Mathewson
78428dccdb Add smartlist_reverse and smartlist_pop_last.
svn:r6634
2006-06-18 07:21:35 +00:00
Nick Mathewson
1f585987c4 Another escape() fix, for picky sprintfs.
svn:r6579
2006-06-09 17:07:22 +00:00
Nick Mathewson
2936da4c28 Override our notion of printability for esc_for_log. 127 and up are never printable. Take that, locales.
svn:r6578
2006-06-09 15:57:58 +00:00
Roger Dingledine
85d408a573 Bandaid for a seg fault i just got in 0.1.1.20.
More generally, i reopened bug 222. Whee.


svn:r6571
2006-06-09 06:35:45 +00:00
Roger Dingledine
8cf45df230 and now the exciting part: there is now no such thing as doing
a client-only tls, that is, one with no certs.


svn:r6558
2006-06-07 06:21:11 +00:00
Roger Dingledine
0bfef523df simplify the tortls api: we only support being a "server", that
is, even tor clients do the same sort of handshake.

this has been true for years, so it's best to get rid of the
stale code.


svn:r6557
2006-06-07 06:10:54 +00:00
Roger Dingledine
7512be0b65 looks like we missed a piece of the 0.1.1.9 paranoia code.
hopefully this change is a no-op.


svn:r6556
2006-06-07 02:57:23 +00:00
Roger Dingledine
45065f1466 simplify code now that libevent considers all sockets pollable.
what we really mean now is ">= 0", which is clearer to test for.


svn:r6543
2006-06-05 09:08:10 +00:00
Roger Dingledine
266afcd7d5 bandaid for bug 299. this is still a bug, since we don't
initialize for hardware acceleration in certain configurations;
but not critical until that is supported.


svn:r6536
2006-06-05 04:29:03 +00:00
Nick Mathewson
853e2d99b6 Add a new warning to our "warn a lot" list: unused parameters. This means we have to explicitly "use" unuseds, but it can catch bugs. (It caught two coding mistakes so far.)
svn:r6532
2006-06-04 22:42:13 +00:00
Nick Mathewson
c660a0f6a2 More DNS fixes. Send meaningful TTLs back to the client when
possible.  Cache at the server side independently from the TTL, to
prevent attackers from probing the server to see who has been asking
for what hostnames.  (Hi, Dan Kaminski!)

Also, clean some whitespace.


svn:r6526
2006-06-03 21:41:14 +00:00
Nick Mathewson
86da3e0a0a Patch based on post by Mike C to or-dev; special-case based on use of MSVC, rather than on MS_WINDOWS, so that mingw builds.
svn:r6523
2006-06-03 18:52:31 +00:00
Nick Mathewson
64d487a2d6 Add a basic mmap function, with a "fake-it" wrapper to do read_file_from_str instead. Based on code from Michael Mohr.
svn:r6510
2006-05-28 16:54:39 +00:00
Roger Dingledine
7f611f4732 if we're a server and some peer has a broken tls certificate, don't
shout about it unless we want to hear about protocol violations.


svn:r6507
2006-05-26 16:32:16 +00:00
Roger Dingledine
731f4086c0 resolve an unused variable
svn:r6503
2006-05-26 13:51:45 +00:00
Roger Dingledine
a4cdb834b9 Stop being picky about what the arguments to mapaddress look like.
we were refusing names that had $ in them, which people who specify
$key.exit will be sad about. There are likely other examples.
If people can think of reasons why we should be picky, let me know.


svn:r6496
2006-05-25 20:06:09 +00:00
Roger Dingledine
36712a443b Stop initializing the hardware accelerator engines simply because
we overloaded the meaning of the argument to crypto_global_init().


svn:r6490
2006-05-24 00:37:38 +00:00
Roger Dingledine
67a885ecac Claim a commonname of Tor, rather than TOR, in tls handshakes.
Maybe this will help us win the war of names.


svn:r6489
2006-05-24 00:21:55 +00:00
Nick Mathewson
89a8411ace Throw out this UNALIGNED_INT_ACCESS_OK nonsense. Even where it works, it is often way way slower than doing the right thing. Backport candidate.
svn:r6473
2006-05-23 08:23:03 +00:00
Peter Palfrader
f7ba9d77e4 All these headers we get via torint.h
svn:r6452
2006-05-10 10:24:17 +00:00
Nick Mathewson
8a13a7cfe8 mainline branch. Remove some more dead XXXs.
svn:r6401
2006-04-18 03:58:42 +00:00
Nick Mathewson
1fbc74661f Remove DER64 functions in trunk: they will never be used again unless the directory authorities switch back to 0.0.9tooearly.
svn:r6376
2006-04-10 21:23:00 +00:00
Roger Dingledine
7e3a98b489 "" is not a plausible address for addressmaps.
svn:r6299
2006-04-03 00:26:51 +00:00
Peter Palfrader
1fa7b3cef7 Avoid warnings about machine/limits.h on Debian GNU/kFreeBSD
svn:r6271
2006-03-29 05:14:12 +00:00
Roger Dingledine
0543900fbf clean up the traces from tracking the 0.1.1.9-alpha stack-smashing bug.
svn:r6240
2006-03-26 06:47:51 +00:00
Roger Dingledine
7871ad9116 failing in a support function is a warn, not an err.
svn:r6239
2006-03-26 06:47:08 +00:00
Nick Mathewson
6d9632ba23 Check return value from GetVersionEx (even though the MSDN example doesnt) and zero out the LPOSVERSIONINFOEX struct before getting the version. This may fix the "johnboy" [major=-858993460,minor=-858993460] problem.
svn:r6233
2006-03-24 05:26:33 +00:00
Nick Mathewson
15e5cf6088 Fix memory leak when uncompressing concatenated zlib streams. Unit tests and tor client work; looks ok.
svn:r6211
2006-03-21 20:31:27 +00:00
Roger Dingledine
6449e2f6d6 ok, commenting that out broke things real bad.
leave it, and accept the memory leak for now.


svn:r6201
2006-03-20 02:13:35 +00:00
Roger Dingledine
54ced294df Resolve a memory leak on clients. This disables some
functionality that we might still want. Nick?


svn:r6200
2006-03-20 00:52:22 +00:00
Nick Mathewson
0f0e14c6e3 normalize whitespace.
svn:r6173
2006-03-17 04:43:37 +00:00
Roger Dingledine
0e62befab8 add tor_strisprint() back in, this time with comments.
svn:r6170
2006-03-15 23:35:55 +00:00
Roger Dingledine
4cd4353847 and remove now-extraneous function
svn:r6168
2006-03-15 19:17:46 +00:00
Nick Mathewson
0bc19dddf5 Use INLINE (which we define) instead of __inline (which is nonstandard) in ht.h. Resolves bug 270; maybe sun C will work now.
svn:r6153
2006-03-13 15:09:49 +00:00
Nick Mathewson
daea6b21a5 Fix bug in close_logs(): when we close and delete logs, remove them all from the global "logfiles" list. This should fix bug 222.
svn:r6145
2006-03-13 00:54:21 +00:00
Nick Mathewson
0c132ee2a1 Instead of listing a set of compilers that prefers __func__ to __FUNCTION__, use autoconf. Also, prefer __func__ in our own code: __func__ is a C99 standard, whereas __FUNCTION__ is not. [Fixes bug 254.]
svn:r6144
2006-03-13 00:25:36 +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
4d3e709c4b Use escaped() for remaining cases.
svn:r6117
2006-03-11 02:21:30 +00:00
Roger Dingledine
a385b0087f fix infinite loop
svn:r6090
2006-03-06 20:01:46 +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
Nick Mathewson
6a4e304d9e Allow private:* in routerdescs; not generated yet (because older Tors do not understand it); needs testing.
svn:r6086
2006-03-05 05:27:59 +00:00
Peter Palfrader
42f14e8e10 Add function names to log_* on non-gcc
svn:r6039
2006-02-18 07:18:14 +00:00
Peter Palfrader
4f5e607389 Finish log function renaming for non-GNUC systems
svn:r6034
2006-02-18 02:11:48 +00:00
Roger Dingledine
6ce36ead42 Start the process of converting warn to log_warn and so on.
This is needed because Windows already has an err() that we
can't clobber. And we need to be able to make the log functions
a macro so we can print the function's name in the log entry.


svn:r6000
2006-02-13 08:01:59 +00:00
Nick Mathewson
2cc66125b8 try to fix bug with spurious "everything is broken" warning
svn:r5994
2006-02-13 00:26:43 +00:00
Nick Mathewson
dba155ecff Generate 18.0.0.0/8 address policy format in descs when we can; warn when the mask is not reducible to a bit-prefix.
svn:r5991
2006-02-12 23:58:22 +00:00
Roger Dingledine
b99f903e34 and don't warn when it happens here either, unless the user
wants to hear it.


svn:r5990
2006-02-12 23:44:02 +00:00
Roger Dingledine
53c54b75c9 Correct a function comment. Nick: is this right?
svn:r5989
2006-02-12 23:34:03 +00:00
Roger Dingledine
5f051574d5 Happy new year!
svn:r5949
2006-02-09 05:46:49 +00:00
Roger Dingledine
28f3765b5a and maybe some function documentation will help too
svn:r5935
2006-02-09 02:59:37 +00:00
Roger Dingledine
6f579deff4 check for EADDRINUSE in a cross-platform way (unless i'm wrong)
svn:r5899
2006-02-03 12:25:46 +00:00
Roger Dingledine
418dc7b16e I believe this resolves bug 234, the mysterious crash on 0.1.1.9
and later servers. I'm not sure yet, but better to have it in CVS
while we speculate that it's the fix.


svn:r5895
2006-02-02 10:10:07 +00:00