Nick Mathewson
1b93b065fc
Make an inline static so we can build with coverage enabled.
2018-06-22 14:11:37 -04:00
Nick Mathewson
405fa42e8a
Another windows include
2018-06-22 13:52:30 -04:00
Nick Mathewson
4b32446a4c
We also need torerr in tm_cvt.
2018-06-22 13:34:35 -04:00
Nick Mathewson
145665abcb
Add another include for windows, and change a log to a raw_assert
2018-06-22 13:33:48 -04:00
Nick Mathewson
76a717890e
Remove an "m" that did not belong.
2018-06-22 13:32:47 -04:00
Nick Mathewson
4118ba67db
Update the micro-revision.i dependencies, and add a stdlib.h
2018-06-22 13:25:58 -04:00
Nick Mathewson
cf66544941
Two more small changes for CI.
2018-06-22 13:10:52 -04:00
Nick Mathewson
7aecea79cb
A pair of missing includes.
2018-06-22 12:53:57 -04:00
Nick Mathewson
b0adf2fc9b
Fix up the rust build script library list.
2018-06-22 12:04:11 -04:00
Nick Mathewson
bcf3e546d1
Move util_bug into libtor-log
2018-06-22 11:54:38 -04:00
Nick Mathewson
6fc2d53227
Remove util_bug dependency on compat.h
2018-06-22 11:51:58 -04:00
Nick Mathewson
7a93ce8f63
Update .gitignore and .may_include files
2018-06-22 11:46:44 -04:00
Nick Mathewson
79f73ab330
Finally extract the log library and make it build.
...
This patch:
- introduces an fdio module for low-level fd functions that don't
need to log.
- moves the responsibility for opening files outside of torlog.c,
so it won't need to call tor_open_cloexec.
2018-06-22 11:40:20 -04:00
Nick Mathewson
90a09df5ba
Extract strlcpy and strlcmp to libtor-string
2018-06-22 11:18:19 -04:00
Nick Mathewson
bfb39164ce
Extract core part of gmtime_r, localtime_r (without logging)
2018-06-22 11:17:11 -04:00
Nick Mathewson
b2d4e786b7
Remove the util_bug.h include from smartlist.h.
...
This change makes a whole bunch of things in torlog.c break, since
apparently I did not find all the fd dependencies.
2018-06-22 10:50:14 -04:00
Nick Mathewson
da4ae8a6b6
Automated fixup of include paths after torlog.h movement.
2018-06-22 10:32:10 -04:00
Nick Mathewson
97b15a1d7c
Extract the locking and logging code
...
The locking code gets its own module, since it's more fundamental
than the higher-level locking code.
Extracting the logging code was the whole point here. :)
2018-06-22 10:31:51 -04:00
Nick Mathewson
2cf033f238
Extract simple integer math into its own module
2018-06-22 09:49:13 -04:00
Nick Mathewson
3883338c81
Move smartlist_add_{v,}asprintf into smartlist.[ch]
...
Now that I know that "strings" nests below "container", I know this
is safe.
2018-06-22 09:49:13 -04:00
Nick Mathewson
1abadee3fd
Extract key string manipulation functions into a new library.
2018-06-22 09:49:13 -04:00
Nick Mathewson
1e07b4031e
Move ARRAY_LENGTH to compiler_compat.h
2018-06-22 09:49:13 -04:00
Nick Mathewson
0932f32291
Remove compat.h as unneeded from log.c and torlog.h
2018-06-22 09:49:13 -04:00
Nick Mathewson
9426751b72
Extract our code for answering "what time is it right now".
...
The other time stuff is higher-level
2018-06-22 09:49:13 -04:00
Nick Mathewson
d1cada5a8a
Update permissible includes
2018-06-22 09:49:13 -04:00
Nick Mathewson
c2a558a346
Expunge container.h
2018-06-22 09:49:13 -04:00
Nick Mathewson
de508c5f50
Extract smartlist.h from container.h
2018-06-22 09:49:13 -04:00
Nick Mathewson
9cf6fc91b1
Remove map from container.h
2018-06-22 09:49:13 -04:00
Nick Mathewson
50a5954003
Remove bloom filters, order statistics, and bitarrays from container.h
2018-06-22 09:49:13 -04:00
Nick Mathewson
932b4d0a43
Remove container->crypto dependency
...
Containers were using crypto_digest.h, just to see the value of
DIGEST_LEN. Moved those constants into a new defs module.
2018-06-22 09:49:13 -04:00
Nick Mathewson
479c2ab503
Move STRUCT_VAR_P to compat_compiler.
2018-06-22 09:49:13 -04:00
Nick Mathewson
657ff55408
Split container.c based on container types, and minimize includes
...
Minimizing includes revealed other places includes were necessary.
2018-06-22 09:49:13 -04:00
Nick Mathewson
b8be8265b6
Rectify include paths after container split (automatic)
2018-06-22 09:49:13 -04:00
Nick Mathewson
77dff00b18
Refactor container into a library.
2018-06-22 09:49:13 -04:00
Nick Mathewson
f95e3bf5fc
Simplify include structure of container.[ch]
2018-06-21 15:33:25 -04:00
Nick Mathewson
e066966bf4
Extract tor_malloc and friends to a new module.
2018-06-21 15:20:01 -04:00
Nick Mathewson
56c1fbf33f
Use the "commands" argument of AC_CONFIG_FILES to make scripts +x
...
Closes ticket 26439.
2018-06-21 14:26:47 -04:00
Nick Mathewson
8dcc015975
Fix wide lines in dirauth/dirvote.*
2018-06-21 14:23:32 -04:00
Nick Mathewson
999f7984e1
New script to check includes for modularity violations
...
Includes configuration files to enforce these rules on lib and
common. Of course, "common" *is* a modularity violation right now,
so these rules aren't as strict as I would like them to be.
2018-06-21 14:05:33 -04:00
Nick Mathewson
8918bd90e9
Merge branch 'extract_easy_common_libs'
2018-06-21 13:57:13 -04:00
Nick Mathewson
3305ae5044
Rectify include paths (automated).
...
You have no idea how glad I am that this is automated.
2018-06-21 13:20:07 -04:00
Nick Mathewson
5b8f4769dc
Move testsupport.h to its own directory
2018-06-21 13:20:07 -04:00
Nick Mathewson
e9943d5459
Move responsibility for libdonna out of src/common
2018-06-21 13:19:00 -04:00
Nick Mathewson
71571e3428
Additional non-automated change to trunnel-local.h
2018-06-21 13:19:00 -04:00
Nick Mathewson
accf239fa3
Rectify include paths (automated)
2018-06-21 13:19:00 -04:00
Nick Mathewson
25ccfff86a
Split crypto and tls libraries into directories
...
I am calling the crypto library "crypt_ops", since I want
higher-level crypto things to be separated from lower-level ones.
This library will hold only the low-level ones, once we have it
refactored.
2018-06-21 13:14:14 -04:00
Nick Mathewson
49d7c9ce53
Move more compiler-compatibility stuff into compat_compiler.h
2018-06-21 13:14:14 -04:00
Nick Mathewson
68bbe915d9
di_ops.c does not actually log anything.
2018-06-21 13:14:14 -04:00
Nick Mathewson
fa5fda5bbf
Rectify include paths (automated)
2018-06-21 13:14:14 -04:00
Nick Mathewson
cd8f919553
Move compiler-compatibility headers into their own module
...
This one has no generated code.
2018-06-21 13:14:14 -04:00
Nick Mathewson
d2f4a716e8
Remove unused pubsub module.
2018-06-21 13:14:14 -04:00
Nick Mathewson
209a285166
Rectify include paths (automated)
2018-06-21 13:14:14 -04:00
Nick Mathewson
4bdda6d05f
Move trace into its own library in libs.
...
Apparently it has no testing variant.
2018-06-21 13:14:14 -04:00
Nick Mathewson
03d7812615
Make sure liberr-testing is build with testing flags.
2018-06-21 13:14:14 -04:00
Nick Mathewson
b420da4cf8
Rectify include paths (automated)
2018-06-21 13:14:14 -04:00
Nick Mathewson
2d20cbf837
Extract compression functions into a new library.
2018-06-21 13:08:25 -04:00
Roger Dingledine
471418befb
tiny comment and whitespace fixes
2018-06-21 13:07:51 -04:00
Nick Mathewson
ad7776f66d
Rename libtor.a to libtor-app.a
2018-06-21 11:03:39 -04:00
Nick Mathewson
727db7aeb9
Rectify include paths (automated)
2018-06-21 11:03:39 -04:00
Nick Mathewson
a403ee6bb3
Move consttime library code into its own directory.
2018-06-21 11:03:39 -04:00
Nick Mathewson
275aff6917
Rectify include paths (automated)
2018-06-21 10:47:11 -04:00
Nick Mathewson
2cfcb7b364
Extract error functionality into a new lowest-level library.
2018-06-21 10:47:11 -04:00
Nick Mathewson
b2346b1201
Refactor makefiles to keep list of internal libraries in one place.
...
This change makes it possible for us to change the list of libraries
more easily, without changing every single linker line.
2018-06-21 10:35:30 -04:00
Nick Mathewson
da728e36f4
Rectify include paths (automated)
2018-06-21 09:55:16 -04:00
Nick Mathewson
874ba6861a
Fix distcheck by naming header properly.
2018-06-21 09:37:32 -04:00
Nick Mathewson
2ad062ee60
Merge branch 'mikeperry_bug26214-rebased_squashed'
2018-06-21 09:20:03 -04:00
Mike Perry
46b06cd699
Bug 26214: Test updates.
2018-06-21 09:18:51 -04:00
Mike Perry
dc397f9a61
Bug 26214: Check stream SENDME against max.
2018-06-21 09:18:51 -04:00
Nick Mathewson
92ae9bb95b
Hang on; this branch is supposed to be 0.3.4.2-alpha-dev.
2018-06-21 09:01:00 -04:00
Nick Mathewson
c42071f750
Merge branch 'maint-0.3.4'
2018-06-21 08:59:58 -04:00
Nick Mathewson
e845bd17f8
Merge branch 'bug25787_squashed' into maint-0.3.4
2018-06-21 08:56:27 -04:00
Nick Mathewson
cacf326e78
Revise geoip tests to not require paths of actual geoip config
...
When I wrote the first one of these, it needed the path of the geoip
file. But that doesn't translate well in at least two cases:
- Mingw, where the compile-time path is /c/foo/bar and the
run-time path is c:\foo\bar.
- Various CI weirdnesses, where we cross-compile a test binary,
then copy it into limbo and expect it to work.
Together, these problems precluded these tests running on windows.
So, instead let's just generate some minimal files ourselves, and
test against them.
Fixes bug 25787
2018-06-21 08:56:20 -04:00
Nick Mathewson
27e456cd72
Merge remote-tracking branch 'rl1987/ticket19979_2'
2018-06-21 08:53:48 -04:00
Nick Mathewson
72a5ae8c66
Merge branch 'maint-0.3.4'
2018-06-21 08:38:21 -04:00
Nick Mathewson
73bc863822
Merge branch 'additional_rust_test_fixes' into maint-0.3.4
2018-06-21 08:38:17 -04:00
Nick Mathewson
683776bfab
Merge branch 'maint-0.3.4'
2018-06-21 08:36:48 -04:00
Nick Mathewson
c389c41292
Merge branch 'maint-0.3.3' into maint-0.3.4
2018-06-21 08:36:48 -04:00
Nick Mathewson
599b53f046
add a bn.h include to crypto_dh.c
2018-06-21 08:34:27 -04:00
Roger Dingledine
7b1a3c5164
fix memory leak in protover.c
...
Fix a memory leak where directory authorities would leak a chunk of
memory for every router descriptor every time they considered voting.
This bug was taking down directory authorities in the live network due
to out-of-memory issues.
Fixes bug 26435; bugfix on 0.3.3.6.
2018-06-20 19:43:58 -04:00
Nick Mathewson
01d0bf1803
add build.rs to EXTRA_DIST
2018-06-20 19:32:01 -04:00
Nick Mathewson
8f3712cf6e
eol@eof is still the law in 0.3.4 :(
2018-06-20 19:05:11 -04:00
Nick Mathewson
d110f9c9a6
Add a leak suppression for backtrace_alloc
...
This appears to be an internal rust thing: I don't know why it's
leaking. We should investigate further.
2018-06-20 18:02:49 -04:00
Nick Mathewson
3b606ff787
Merge branch 'maint-0.3.4' into additional_rust_test_fixes
2018-06-20 17:53:51 -04:00
Nick Mathewson
f24797a587
Merge branch 'maint-0.3.4'
2018-06-20 17:49:56 -04:00
Nick Mathewson
f91ea506f0
Fix clang warnings introduced by 9f2b887c5d
2018-06-20 17:49:06 -04:00
Nick Mathewson
3a64052099
Fix memory leak in CryptoDigest type
...
If you're owning a C pointer, you need to implement Drop.
2018-06-20 17:28:28 -04:00
Nick Mathewson
592e8ac395
Disable doctests in src/rust/crypto module.
...
These all need C linking to work, and so far, rustdoc does not seem
to respect cargo setting about build scripts or RUSTOPTIONS.
2018-06-20 17:16:44 -04:00
Nick Mathewson
901ada7e5f
Fix bugs in rust digest tests
2018-06-20 17:08:00 -04:00
Nick Mathewson
e99ecf9399
Merge branch 'rust_build_script_v3' into additional_rust_test_fixes
2018-06-20 17:07:47 -04:00
Nick Mathewson
398f15bdf1
Merge branch 'maint-0.3.4'
2018-06-20 16:37:39 -04:00
Isis Lovecruft
7589fd6d40
rust: Remove --all-features flag from cargo test
call in test_rust.sh.
...
We'd like to feature gate code that calls C from Rust, as a workaround
to several linker issues when running `cargo test` (#25386 ), and we
can't feature gate anything out of test code if `cargo test` is called
with `--all-features`.
* FIXES #26400 : https://bugs.torproject.org/26400
2018-06-20 16:37:33 -04:00
Nick Mathewson
c86850c4c9
Don't use any asserts(), even raw, in format_number_sigsafe().
...
Also explain why.
2018-06-20 16:16:45 -04:00
Nick Mathewson
057d838409
Use raw_assert() in write_all().
...
This makes tor_log() finally non-circular.
2018-06-20 16:16:45 -04:00
Nick Mathewson
7a2dce9006
Use raw_assert() in central allocation functions.
...
This is, again, to avoid circularity in the log code.
2018-06-20 16:16:45 -04:00
Nick Mathewson
17ba51a30a
Use raw_assert in mutex functions to avoid circularity in logs.
2018-06-20 16:16:45 -04:00
Nick Mathewson
bb15dc1ebd
Allow raw_assert() to dump stack traces.
...
It doesn't do this as beautifully as tor_assert(), but it doesn't
depend on any higher-level code.
2018-06-20 16:16:45 -04:00
Nick Mathewson
a969ce464d
Remove log dependency from backtrace.[ch]
2018-06-20 16:16:45 -04:00
Nick Mathewson
3246c9648c
Use compat_compiler to restore macros in torerr.h
2018-06-20 15:08:06 -04:00
Nick Mathewson
aa490e971b
Split compiler-compatibility parts of compat.h
2018-06-20 15:08:06 -04:00
Nick Mathewson
5ecd1fec15
Move horrible-emergency handling into torerr.[ch]
...
Previously we had code like this for bad things happening from
signal handlers, but it makes sense to use the same logic to handle
cases when something is happening at a level too low for log.c to be
involved.
My raw_assert*() stuff now uses this code.
2018-06-20 15:08:06 -04:00