Age | Commit message (Collapse) | Author | |
---|---|---|---|
2017-11-27 | Add a new notion of "stamps" to be a fast 32-bit monotonic timestamp | Nick Mathewson | |
The goal here is to replace our use of msec-based timestamps with something less precise, but easier to calculate. We're doing this because calculating lots of msec-based timestamps requires lots of 64/32 division operations, which can be inefficient on 32-bit platforms. We make sure that these stamps can be calculated using only the coarse monotonic timer and 32-bit bitwise operations. | |||
2017-09-27 | Move ext_or_command tests to test_proto_misc.c | Nick Mathewson | |
No other code changes. | |||
2017-09-05 | Make preferred_chunk_size nonstatic, and add a prefix to it | Nick Mathewson | |
2017-09-05 | Refactor buffer APIs to put a buf_t first. | Nick Mathewson | |
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. | |||
2017-09-05 | Repair buffer API so everything starts with buf_. | Nick Mathewson | |
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\(/; | |||
2017-09-05 | Move the tls parts of buffers.c into buffers_tls.c | Nick Mathewson | |
2017-09-05 | Make buffers.c independent of or.h | Nick Mathewson | |
Also, put ext_or function in new module; it had accidentally gotten into proto_socks.c | |||
2017-09-05 | Make buf_pullup() expose the pulled-up data. | Nick Mathewson | |
This lets us drop the testing-only function buf_get_first_chunk_data(), and lets us implement proto_http and proto_socks without looking at buf_t internals. | |||
2017-09-05 | Move protocol-specific functions out of buffers.c | Nick Mathewson | |
This commit does not change the implementation of any function: it only moves code and adds new includes as necessary. Part of #23149. | |||
2017-08-24 | Fix operator usage in src/test/*.c | Alexander Færøy | |
This patch fixes the operator usage in src/test/*.c to use the symbolic operators instead of the normal C comparison operators. This patch was generated using: ./scripts/coccinelle/test-operator-cleanup src/test/*.[ch] | |||
2017-06-21 | unit tests for peek_buf_startswith() | Nick Mathewson | |
2017-05-02 | Merge branch 'compress_none_v2_squashed' | Nick Mathewson | |
2017-05-02 | Add unit tests for the NO_METHOD compressor | Nick Mathewson | |
These required some special-casing, since some of the assumption about real compression algorithms don't actually hold for the identity transform. Specifically, we had assumed: - compression functions typically change the lengths of their inputs. - decompression functions can detect truncated inputs - compression functions have detectable headers None of those is true for the identity transformation. | |||
2017-05-01 | Rename x-lzma to x-tor-lzma | Nick Mathewson | |
We shouldn't call it lzma, because we are imposing a limit on the memory needed for decoding. | |||
2017-04-27 | Have a separate entry point for each compresion test | Nick Mathewson | |
2017-04-27 | Test support for multiple compression backends in the buffer code. | Alexander Færøy | |
This patch refactors the buffer compression tests to support multiple comprssion backends. See: https://bugs.torproject.org/22085 | |||
2017-04-18 | Rename `write_to_buf_zlib()` to `write_to_buf_compress()`. | Alexander Færøy | |
See https://bugs.torproject.org/21663 | |||
2017-04-18 | Rename `zlib_state` to `compress_state` in the test_buffers. | Alexander Færøy | |
See https://bugs.torproject.org/21663 | |||
2017-04-17 | Refactor the streaming compression code. | Alexander Færøy | |
This patch refactors our streaming compression code to allow us to extend it with non-zlib/non-gzip based compression schemas. See https://bugs.torproject.org/21663 | |||
2017-04-17 | Rename `tor_gzip_{compress,uncompress}` to `tor_{compress,uncompress}`. | Alexander Færøy | |
To allow us to use the API name `tor_compress` and `tor_uncompress` as the main entry-point for all compression/uncompression and not just gzip and zlib. See https://bugs.torproject.org/21663 | |||
2017-03-15 | Run the copyright update script. | Nick Mathewson | |
2017-02-14 | Don't atoi off the end of a buffer chunk. | Nick Mathewson | |
Fixes bug 20894; bugfix on 0.2.0.16-alpha. We already applied a workaround for this as 20834, so no need to freak out (unless you didn't apply 20384 yet). | |||
2016-09-13 | Make preferred_chunk_size avoid overflow, handle big inputs better | Nick Mathewson | |
Also, add tests for the function. Closes 20081; bugfix on 0.2.0.16-alpha. This is a Guido Vranken issue. Thanks, Guido! | |||
2016-08-12 | Merge remote-tracking branch 'public/Fix_19450' | Nick Mathewson | |
2016-08-02 | Remove generic_buffer_*() functions as needless. | Nick Mathewson | |
These functions were there so that we could abstract the differences between evbuffer and buf_t. But with the bufferevent removal, this no longer serves a purpose. | |||
2016-08-02 | Rename generic_buffer_set_to_copy, since generic buffers are not a thing | Nick Mathewson | |
2016-07-28 | Merge branch 'bug18902_squashed' | Nick Mathewson | |
2016-07-28 | Fix all -Wshadow warnings on Linux | Nick Mathewson | |
This is a partial fix for 18902. | |||
2016-07-21 | Use new mock functions in buffer/time_tracking test | Nick Mathewson | |
2016-06-11 | Add -Wmissing-variable-declarations, with attendant fixes | Nick Mathewson | |
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. | |||
2016-02-27 | Update the copyright year. | Nick Mathewson | |
2015-09-02 | Remove remaining references to "nulterminate" in comments | Nick Mathewson | |
Thanks to Roger for spotting this! | |||
2015-09-01 | Remove the unused "nulterminate" option to buf_pullup() | Nick Mathewson | |
I was going to add a test for this, but I realized that it had no users. So, removed. | |||
2015-06-01 | Appease make check-spaces | Andrea Shepard | |
2015-05-07 | Merge branch 'writing_tests' | Nick Mathewson | |
2015-05-07 | Write the outlines of a WritingTests.txt document | Nick Mathewson | |
Also, add some sample tests to be examples. | |||
2015-02-11 | Remove mempools and buf freelists | Nick Mathewson | |
They have been off-by-default since 0.2.5 and nobody has complained. :) Also remove the buf_shrink() function, which hasn't done anything since we first stopped using contiguous memory to store buffers. Closes ticket 14848. | |||
2015-01-06 | Merge remote-tracking branch 'public/feature11791' | Nick Mathewson | |
2015-01-02 | Bump copyright dates to 2015, in case someday this matters. | Nick Mathewson | |
2014-11-17 | Use smaller zlib objects when under memory pressure | Nick Mathewson | |
We add a compression level argument to tor_zlib_new, and use it to determine how much memory to allocate for the zlib object. We use the existing level by default, but shift to smaller levels for small requests when we have been over 3/4 of our memory usage in the past half-hour. Closes ticket 11791. | |||
2014-11-12 | Fix wide lines (from 13172) | Nick Mathewson | |
2014-11-12 | Replace operators used as macro arguments with OP_XX macros | Nick Mathewson | |
Part of fix for 13172 | |||
2014-10-28 | Add another year to our copyright dates. | Nick Mathewson | |
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right? | |||
2014-09-15 | Use coccinelle scripts to clean up our unit tests | Nick Mathewson | |
This should get rid of most of the users of the old test_* functions. Some are in macros and will need manual cleanup, though. This patch is for 13119, and was automatically generated with these scripts. The perl scripts are there because coccinelle hates operators as macro arguments. ------------------------------ s/==,/_X_EQ_,/g; s/!=,/_X_NE_,/g; s/<,/_X_LT_,/g; s/>,/_X_GT_,/g; s/>=,/_X_GEQ_,/g; s/<=,/_X_LEQ_,/g; ------------------------------ @@ expression a; identifier func; @@ func (...) { <... -test_fail_msg +TT_DIE ( +( a +) ) ...> } @@ identifier func; @@ func (...) { <... -test_fail() +TT_DIE(("Assertion failed.")) ...> } @@ expression a; identifier func; @@ func (...) { <... -test_assert +tt_assert (a) ...> } @@ expression a, b; identifier func; @@ func (...) { <... -test_eq +tt_int_op (a, +_X_EQ_, b) ...> } @@ expression a, b; identifier func; @@ func (...) { <... -test_neq +tt_int_op (a, +_X_NEQ_, b) ...> } @@ expression a, b; identifier func; @@ func (...) { <... -test_streq +tt_str_op (a, +_X_EQ_, b) ...> } @@ expression a, b; identifier func; @@ func (...) { <... -test_strneq +tt_str_op (a, +_X_NEQ_, b) ...> } @@ expression a, b; identifier func; @@ func (...) { <... -test_eq_ptr +tt_ptr_op (a, +_X_EQ_, b) ...> } @@ expression a, b; identifier func; @@ func() { <... -test_neq_ptr +tt_ptr_op (a, +_X_NEQ_, b) ...> } @@ expression a, b, len; identifier func; @@ func (...) { <... -test_memeq +tt_mem_op (a, +_X_EQ_, b, len) ...> } @@ expression a, b, len; identifier func; @@ func (...) { <... -test_memneq +tt_mem_op (a, +_X_NEQ_, b, len) ...> } ------------------------------ @@ char a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a == b +a, _X_EQ_, b ) ...> } @@ int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a == b +a, _X_EQ_, b ) ...> } @@ long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a == b +a, _X_EQ_, b ) ...> } @@ unsigned int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a == b +a, _X_EQ_, b ) ...> } @@ unsigned long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a == b +a, _X_EQ_, b ) ...> } @@ char a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a != b +a, _X_NEQ_, b ) ...> } @@ int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a != b +a, _X_NEQ_, b ) ...> } @@ long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a != b +a, _X_NEQ_, b ) ...> } @@ unsigned int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a != b +a, _X_NEQ_, b ) ...> } @@ unsigned long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a != b +a, _X_NEQ_, b ) ...> } @@ char a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a >= b +a, _X_GEQ_, b ) ...> } @@ int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a >= b +a, _X_GEQ_, b ) ...> } @@ long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a >= b +a, _X_GEQ_, b ) ...> } @@ unsigned int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a >= b +a, _X_GEQ_, b ) ...> } @@ unsigned long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a >= b +a, _X_GEQ_, b ) ...> } @@ char a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a <= b +a, _X_LEQ_, b ) ...> } @@ int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a <= b +a, _X_LEQ_, b ) ...> } @@ long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a <= b +a, _X_LEQ_, b ) ...> } @@ unsigned int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a <= b +a, _X_LEQ_, b ) ...> } @@ unsigned long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a <= b +a, _X_LEQ_, b ) ...> } @@ char a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a > b +a, _X_GT_, b ) ...> } @@ int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a > b +a, _X_GT_, b ) ...> } @@ long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a > b +a, _X_GT_, b ) ...> } @@ unsigned int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a > b +a, _X_GT_, b ) ...> } @@ unsigned long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a > b +a, _X_GT_, b ) ...> } @@ char a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a < b +a, _X_LT_, b ) ...> } @@ int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a < b +a, _X_LT_, b ) ...> } @@ long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_int_op ( -a < b +a, _X_LT_, b ) ...> } @@ unsigned int a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a < b +a, _X_LT_, b ) ...> } @@ unsigned long a, b; identifier func; @@ func (...) { <... -tt_assert +tt_uint_op ( -a < b +a, _X_LT_, b ) ...> } ------------------------------ s/_X_NEQ_/!=/g; s/_X_NE_/!=/g; s/_X_EQ_/==/g; s/_X_GT_/>/g; s/_X_LT_/</g; s/_X_GEQ_/>=/g; s/_X_LEQ_/<=/g; s/test_mem_op\(/tt_mem_op\(/g; | |||
2014-08-15 | Remove stale printfs from buffer/zlib_fin_at_chunk_end test | Nick Mathewson | |
These got committed by mistake. | |||
2014-05-08 | Fix unearthed problems in unit tests | Nick Mathewson | |
2014-05-08 | Fix numerous type errors in the unit tests | Nick Mathewson | |
Remove tinytest casts that were suppressing them. Fix for #11825. | |||
2014-05-08 | More unit tests for #11648-related stuff | Nick Mathewson | |
These are actually tests for #311. It appears to me that we didn't fix #311 properly when we thought we did in 475eb5d6; instead, the real fix was 05eff35ac6d64b, a few minutes earlier. | |||
2014-05-06 | Unit test for write_to_buf_zlib | Nick Mathewson | |
2014-05-01 | Merge remote-tracking branch 'public/valgrind_tests' | Nick Mathewson | |