tor/src
Nick Mathewson 367dd9cf02 30001: Fix a race condition in test_dir_handle_get.c
Previously we used time(NULL) to set the Expires: header in our HTTP
responses.  This made the actual contents of that header untestable,
since the unit tests have no good way to override time(), or to see
what time() was at the exact moment of the call to time() in
dircache.c.

This gave us a race in dir_handle_get/status_vote_next_bandwidth,
where the time() call in dircache.c got one value, and the call in
the tests got another value.

I'm applying our regular solution here: using approx_time() so that
the value stays the same between the code and the test.  Since
approx_time() is updated on every event callback, we shouldn't be
losing any accuracy here.

Fixes bug 30001. Bug introduced in fb4a40c32c4a7e5; not in any
released Tor.
2019-04-03 10:16:18 -04:00
..
app Merge remote-tracking branch 'tor-github/pr/726' into maint-0.4.0 2019-02-26 07:27:42 -05:00
config Merge branch 'maint-0.3.5' into maint-0.4.0 2019-04-03 09:27:44 -04:00
core Correctly report PT vs proxy during bootstrap 2019-03-25 14:13:45 +10:00
ext Bump copyright date to 2019 2019-01-16 12:33:22 -05:00
feature 30001: Fix a race condition in test_dir_handle_get.c 2019-04-03 10:16:18 -04:00
lib Pass NULL to lpApplicationName in CreateProcessA(). 2019-03-25 03:10:37 +01:00
rust protover: Add missing Padding to translate_to_rust 2019-03-05 12:33:43 -05:00
test 30001: Fix a race condition in test_dir_handle_get.c 2019-04-03 10:16:18 -04:00
tools Bump copyright date to 2019 2019-01-16 12:33:22 -05:00
trunnel Add padding negotiation trunnel output. 2019-01-02 15:12:20 +02:00
win32 Bump to 0.4.0.3-alpha-dev 2019-03-23 08:44:36 -04:00
include.am Move buffers.c out of lib/containers to resolve a circularity. 2018-11-14 16:07:03 -05:00