Nick Mathewson
b5ccdd978e
Add a dire warning about not reformatting the whole codebase yet.
2020-02-12 18:52:35 -05:00
Nick Mathewson
3b62cd85e2
clang-format: remove StatementMacros usage
...
This change lets us use clang-format-6.0, and is okay since we now
require semicolons after HT_PROTOTYPE/GENERATE.
2020-02-10 12:55:00 -05:00
Nick Mathewson
d9e211ab70
Use semicolons after HT_PROTOTYPE and HT_GENERATE.
2020-02-10 12:54:43 -05:00
Nick Mathewson
a9cc4ce0eb
ht.h: Require a semicolon after HT_PROTOTYPE and HT_GENERATE[2]
2020-02-10 12:54:06 -05:00
Nick Mathewson
fbc1eaa0af
Try to shorten an #error in address.c
2020-02-06 17:21:34 -05:00
Nick Mathewson
1651f92c16
Break CONNECTION_TESTCAE_ARG across multiple lines
2020-02-06 17:21:34 -05:00
Nick Mathewson
8a5a1600cd
Extract verbatim table in uname.c
2020-02-06 17:06:12 -05:00
Nick Mathewson
5fa62fffee
checkSpace: permit wide lines for LCOV_EXCL
...
We're telling clang-format that a line with LCOV_EXCL must not be
split -- that's fine, but we shouldn't complain when it indents it.
2020-02-06 16:25:56 -05:00
Nick Mathewson
7036ed3471
Fix a couple more long warning lines
...
These are not a problem with 2-space indentation, but cocci will
start getting confused when clang-format wraps them with 4-space
indentation.
2020-02-06 16:25:56 -05:00
Nick Mathewson
6076adde25
circuitbuild: expect bug message that clang-format will generate.
...
clang-format wants to put no space here, so we need to tell the test
to expect a lack of a space.
2020-02-06 15:34:06 -05:00
Nick Mathewson
f39ba52029
checkSpace: be more careful about bad function headers.
...
Previously we would forbid macro indentations like this:
FOO({
int x;
})
But clang-format sometimes generates those.
2020-02-06 14:54:04 -05:00
Nick Mathewson
99a5aecbc7
Wrap columnar tables in "clang-format off/on"
...
These tables have aligned comments, so we don't want clang-format to
mess with them.
2020-02-06 14:54:04 -05:00
Nick Mathewson
06a6130666
Use parentheses to avoid mis-indentations of stringified macro args
...
clang-format sometimes thinks that "#name" should be written as
"# name" if it appears at the start of a line. Using () appears
to suppress this, while confusing Coccinelle.
2020-02-06 14:54:04 -05:00
Nick Mathewson
6104c407e0
maps: do not include _ as part of expected prefix in macros.
...
Doing this makes our macro usage a little clear IMO, and also avoids
having to use an unadorned "new" within a macro. (Clang-format
seems to think that "new" means we're doing C++, and so it generates
some output that checkSpace.pl doesn't care for.)
2020-02-06 14:54:04 -05:00
Nick Mathewson
87b71a692a
Remove senseless CHECK_PRINTF()s from util_bug.c
...
These belong in util_bug.h (and they already are there).
Their presence made clang-format misindent these functions in a way
that checkSpace.pl dislikes.
2020-02-06 14:54:04 -05:00
Nick Mathewson
efa5020a9c
log_test_helpers: remove semicolons from end of macros
...
We want our code to require semicolons after use of these macros,
so that our code formatters and/or analysis tools don't get
confused.
2020-02-06 14:54:04 -05:00
Nick Mathewson
60f01da78e
Use smaller CPP error messages
...
Clang-format wants to split these messages across multiple lines,
which confuses the heck out of coccinelle.
2020-02-06 14:54:04 -05:00
Nick Mathewson
e9b663beaf
onion_queue.c: use TAILQ_HEAD less confusingly.
...
When we use macro inline, clang-format likes to break it in the
middle, which makes checkSpace get confused.
2020-02-06 14:33:05 -05:00
Nick Mathewson
c8fae6b5c8
checkSpace: don't treat an unindented label as starting a function.
2020-02-06 14:33:05 -05:00
Nick Mathewson
9feeb4cf97
prob_distr: use "clang-format off" to avoid wide lines for URLs
2020-02-06 14:33:05 -05:00
Nick Mathewson
98fdc3e41a
Use a compile-time assert in control_events.h
...
(The original idiom here led clang-format to generating a too-wide line.)
2020-02-06 14:33:05 -05:00
Nick Mathewson
8d6f27cea5
checkSpace.pl: Allow space between iteration macros and ().
...
Clang-format wants to put these in, and they do make sense for
consistency.
Also allow more types.
2020-02-06 14:33:05 -05:00
Nick Mathewson
bfa7607385
checkSpace.pl: Use a data structure for a list of non-function names
2020-02-06 14:33:05 -05:00
Nick Mathewson
1f1d943999
checkspace: allow spaces in cpp directives.
2020-02-06 14:33:05 -05:00
Nick Mathewson
15819cde61
checkSpace.pl: allow {{, ){, and ({.
2020-02-06 14:33:05 -05:00
Nick Mathewson
f1d371bf32
checkSpace: remove the nosplabel test.
2020-02-06 14:33:05 -05:00
Nick Mathewson
573ab70bfe
Temporary clang-format configuration and script.
...
The format is the same as in my previous efforts here.
The script is a little tricky, since it invokes both clang-format
and codetool, and it makes sure that files do not have a changed
mtime unless there is actually some change in the file.
2020-02-06 14:33:05 -05:00
Nick Mathewson
5bd86b50b5
codetool: post-processor for clang-format
...
This code transformer makes a couple of changes that we want for our
source code, and can be expanded to handle more.
2020-02-06 14:04:19 -05:00
Nick Mathewson
21f45197a2
Merge branch 'bug33103'
2020-02-06 08:28:25 -05:00
Nick Mathewson
b7bbff0c9c
Merge remote-tracking branch 'public/practracker_regen_overbroad_2'
2020-02-06 08:27:12 -05:00
David Goulet
a8456d2a11
test: Missing hs_init() in some hs_control tests
...
Without the hs_init(), the caches are not initialized and the previous commit
was causing an assert due to the missing caches.
But regardless of that, those tests were not initializing but were calling
hs_free_all().
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-02-06 12:54:54 +02:00
David Goulet
9278a24729
hs-v3: Remove descriptor when we remove client authorization
...
When the ONION_CLIENT_AUTH_REMOVE command is given to tor, now also remove the
descriptor associated with the client authorization credentials.
Fixes #33148
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-02-06 12:54:54 +02:00
Nick Mathewson
56c54a66bd
Fix a memory leak in handling GETINFO.
...
Fixes bug 33103; bugfix on 0.4.3.1-alpha.
2020-02-05 19:18:32 -05:00
teor
2c4d7d8c65
Merge branch 'pr1701-fix-typo'
2020-02-06 08:39:46 +10:00
David Goulet
9c33d36113
configure: Fix and improve summary pretty printing
...
Fixes #32230
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-02-06 08:39:04 +10:00
Nick Mathewson
238b1f3150
Merge remote-tracking branch 'tor-github/pr/1703'
2020-02-05 08:51:22 -05:00
George Kadianakis
2a5e641cfe
Merge branch 'tor-github/pr/1704'
2020-02-04 13:09:41 +01:00
George Kadianakis
6c749bf38c
Merge branch 'tor-github/pr/1700'
2020-02-04 13:06:00 +01:00
teor
ff52051754
address: Fix comments in address.h
...
And improve inline function spacing, and function declaration
spacing.
Comment-only change.
2020-02-04 14:36:04 +10:00
Roger Dingledine
90bb4872b8
go in to fix one typo, end up fixing more
2020-02-03 23:21:58 -05:00
Nick Mathewson
5e963f97b1
practracker: use shutil.move so --regen will work on windows
...
On windows you can't os.rename() a file if the target filename
already exists.
2020-02-03 13:36:56 -05:00
Nick Mathewson
ec965ba98b
practracker: integration tests for --regen and --regen-overbroad
2020-02-03 13:11:58 -05:00
Nick Mathewson
2542a24b63
practracker: add a --regen-overbroad option to remove overbroad exceptions.
...
Closes ticket 32372.
2020-02-03 13:02:12 -05:00
David Goulet
08f31e405d
hs-v3: Purge ephemeral client auth on NEWNYM
...
Fixes #33139 .
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-02-03 11:58:43 -05:00
Christian Clauss
472d58372b
Remove unused import UserDict
...
Fixes: https://trac.torproject.org/projects/tor/ticket/32791#comment:3
Unblocks: #1686
2020-02-03 17:55:58 +02:00
David Goulet
1bf377f4b6
Merge branch 'tor-github/pr/1687'
2020-01-30 14:06:09 -05:00
David Goulet
f07d8a1a92
Merge branch 'tor-github/pr/1692'
2020-01-30 13:53:32 -05:00
David Goulet
a1dec44723
Merge branch 'tor-github/pr/1697'
2020-01-30 13:48:36 -05:00
Nick Mathewson
9662a13d7e
Fix a changelog typo
2020-01-30 12:56:06 -05:00
Nick Mathewson
ee929eedbb
Merge branch 'maint-0.4.2'
...
Using "ours" strategy to avoid version bump.
2020-01-30 11:19:41 -05:00