Age | Commit message (Collapse) | Author |
|
Signed-off-by: David Goulet <dgoulet@torproject.org>
|
|
|
|
GCC added an implicit-fallthrough warning a while back, where it
would complain if you had a nontrivial "case:" block that didn't end
with break, return, or something like that. Clang recently added
the same thing.
GCC, however, would let you annotate a fall-through as intended by
any of various magic "/* fall through */" comments. Clang, however,
only seems to like "__attribute__((fallthrough))". Fortunately, GCC
accepts that too.
A previous commit in this branch defined a FALLTHROUGH macro to do
the right thing if GNUC is defined; here we replace all of our "fall
through" comments with uses of that macro.
This is an automated commit, made with the following perl one-liner:
#!/usr/bin/perl -i -p
s#/\* *falls? ?thr.*?\*/#FALLTHROUGH;#i;
(In order to avoid conflicts, I'm applying this script separately to
each maint branch. This is the 0.4.3 version.)
|
|
|
|
|
|
This was not supported previously, but provides symmetry with other
SOCKS requests, which also support addresses written in brackets.
|
|
This tests the handling of binary v6 addresses, which works correctly
in older versions but was broken in 0.3.5.1-alpha.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
We pullup 512 bytes of input to make sure that at least one SOCKS
message ends up in head of linked list
|
|
|
|
|
|
I am very glad to have written this script.
|
|
There might be a better place for it in the long run, but this is
the best I can think of for now.
|
|
|
|
I'm not sure of the best place to put this header long-term, since
both or/*.c and tools/tor-resolve.c use it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Coverage is now respectable. :)
|
|
We use these when we're acting as a SOCKS client, but we'd never
actually written tests for them :/
|
|
|
|
|
|
Many of the 'truncated command' paths in fetch_from_buf_socks() were
not reached by the tests. This new unit test tries to check them
exhaustively.
|
|
By convention, a function that frobs a foo_t should be called
foo_frob, and it should have a foo_t * as its first argument. But
for many of the buf_t functions, the buf_t was the final argument,
which is silly.
|
|
Our convention is that functions which manipulate a type T should be
named T_foo. But the buffer functions were super old, and followed
all kinds of conventions. Now they're uniform.
Here's the perl I used to do this:
\#!/usr/bin/perl -w -i -p
s/read_to_buf\(/buf_read_from_socket\(/;
s/flush_buf\(/buf_flush_to_socket\(/;
s/read_to_buf_tls\(/buf_read_from_tls\(/;
s/flush_buf_tls\(/buf_flush_to_tls\(/;
s/write_to_buf\(/buf_add\(/;
s/write_to_buf_compress\(/buf_add_compress\(/;
s/move_buf_to_buf\(/buf_move_to_buf\(/;
s/peek_from_buf\(/buf_peek\(/;
s/fetch_from_buf\(/buf_get_bytes\(/;
s/fetch_from_buf_line\(/buf_get_line\(/;
s/fetch_from_buf_line\(/buf_get_line\(/;
s/buf_remove_from_front\(/buf_drain\(/;
s/peek_buf_startswith\(/buf_peek_startswith\(/;
s/assert_buf_ok\(/buf_assert_ok\(/;
|
|
This commit does not change the implementation of any function: it
only moves code and adds new includes as necessary. Part of #23149.
|
|
The `test-operator-cleanup` patch, and related coccinelle patches,
don't do any checks for line length. This patch fixes the line
length issues caused by the previous commits.
|
|
|
|
|
|
|
|
|
|
This is a big-ish patch, but it's very straightforward. Under this
clang warning, we're not actually allowed to have a global variable
without a previous extern declaration for it. The cases where we
violated this rule fall into three roughly equal groups:
* Stuff that should have been static.
* Stuff that was global but where the extern was local to some
other C file.
* Stuff that was only global when built for the unit tests, that
needed a conditional extern in the headers.
The first two were IMO genuine problems; the last is a wart of how
we build tests.
|
|
|
|
|
|
|
|
Part of fix for 13172
|
|
Conflicts:
src/or/buffers.c
|
|
|
|
|
|
|