aboutsummaryrefslogtreecommitdiff
path: root/src/feature/dircache
AgeCommit message (Collapse)Author
2020-02-11mainloop: Remove unused parameter from connection_dir_is_global_write_low()David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-02-11mainloop: Rename global_write_bucket_low()David Goulet
That function is only used to test the global bucket write limit for a directory connection. It should _not_ be used for anything else since that function looks to see if we are a directory authority. Rename it to something more meaningful. No change in behavior at this commit, only renaming. Part of #33029 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-24dir: Return 503 code when rejecting single hop requestDavid Goulet
Single hop rejection (POST and GET) for HS v3 descriptor now return a 503 code which is more accurate code from dir-spec.txt and from other rejection case in the code. For instance if you are not a relay and you get a POST request, a 503 code is sent back with a rejection message. Part of #31958 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-09-30Re-run "make autostyle" with improved annotate_ifdef_directivesNick Mathewson
2019-07-03hs-v3: Disallow single hop client to post/get a descriptorDavid Goulet
Closes #24964 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-06-05Run "make autostyle."Nick Mathewson
2019-04-25Merge branch 'maint-0.4.0'George Kadianakis
2019-04-25Merge branch 'tor-github/pr/960' into maint-0.4.0George Kadianakis
2019-04-03Merge branch 'maint-0.4.0'George Kadianakis
2019-04-0330001: Fix a race condition in test_dir_handle_get.cNick Mathewson
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-03-29dircache: Refactor handle_get_next_bandwidth() to use connection_dir_buf_add()teor
Implements ticket 29897.
2019-03-26Merge branch 'maint-0.4.0'teor
2019-03-26Merge remote-tracking branch 'tor-github/pr/852' into maint-0.4.0teor
2019-03-26bwauth: remove declaring args, they are now in usejuga0
2019-03-26bwauth: increment bw file cache lifetimejuga0
Increment bw file cache lifetime when serving it by HTTP. And add a constant to define that lifetime.
2019-03-26bwauth: check and use compression serving bw filejuga0
2019-03-26bwauth: check if a bw file could be readjuga0
Before serving it by HTTP.
2019-03-26bwauth: use flag to do not warn when file is missingjuga0
Use flag to do not warn when the bandwidth file is missing trying to serve it by http. Also remove double space in the assignement.
2019-03-26Serve bandwidth file used in the next votejuga0
When a directory authority is using a bandwidth file to obtain the bandwidth values that will be included in the next vote, serve this bandwidth file at /tor/status-vote/next/bandwidth.z.
2019-02-09Use compress_dir_buf_add() function in a few placesrl1987
2019-01-16Bump copyright date to 2019Nick Mathewson
2019-01-16Bump copyright date to 2019.Nick Mathewson
2019-01-09Merge branch 'bug28591_035_squashed'Nick Mathewson
2019-01-09Dir: allow directory mirrors to serve future consensusesteor
When Tor's clock is behind the clocks on the authorities, allow Tor to serve future consensuses. Fixes bug 28654; bugfix on 0.3.0.1-alpha.
2018-11-06Merge remote-tracking branch 'tor-github/pr/464'Nick Mathewson
2018-11-02Merge branch 'ticket28100_squashed'Nick Mathewson
2018-11-02Don't overwrite the Content-Type when compressingAlex Xu (Hello71)
2018-10-31Merge branch 'networkstatus_mmap' into networkstatus_mmap_mergeNick Mathewson
2018-10-24Fix remaining cases of using consensus without a len parameter.Nick Mathewson
(Thanks to cyberpunks for noting two of them!)
2018-10-23dircache: make dirauths reject non UTF-8 descriptors and extrainfocypherpunks
Ticket #27367.
2018-10-01extract networkstatus parsing to its own file.Nick Mathewson
2018-10-01Move routerparse and parsecommon to their own module.Nick Mathewson
2018-09-27Split geoip from geoip-related stats.Nick Mathewson
This commit just moves the code to two separate files. The geoip code still has a few needless dependencies on core/* and features/*.
2018-09-27Move the predicted ports code out of rephist.cNick Mathewson
It differs from the rest of the rephist code in that it's actually necessary for Tor to operate, so it should probably go somewhere else. I'm not sure where yet, so I'll leave it in the same directory, but give it its own file.
2018-09-25Extract all the "am I a server" functions from router.cNick Mathewson
2018-09-25Rename dirauth/mode.h to dirauth/authmode.hNick Mathewson
This is preparation for having a routermode.h as well
2018-09-21Add an include to get --disable-module-dirauth happy againNick Mathewson
2018-09-21Split directory.c code into several modulesNick Mathewson
Parts of this C file naturally belong in dircache, dirclient, and dircommon: so, move them there.
2018-09-21Split main.c into main.c and mainloop.cNick Mathewson
The main.c code is responsible for initialization and shutdown; the mainloop.c code is responsible for running the main loop of Tor. Splitting the "generic event loop" part of mainloop.c from the event-loop-specific part is not done as part of this patch.
2018-09-20Split most of dirserv.c into several new modulesNick Mathewson
In dirauth: * bwauth.c reads and uses bandwidth files * guardfraction.c reads and uses the guardfraction file * reachability.c tests relay reachability * recommend_pkg.c handles the recommended-packages lines. * recv_descs.c handles fingerprint files and processing incoming routerinfos that relays upload to us * voteflag.c computes flag thresholds and sets those thresholds on routerstatuses when computing votes In control: * fmt_serverstatus.c generates the ancient "v1 server status" format that controllers expect. In nodelist: * routerstatus_fmt.c formats routerstatus entries for a consensus, a vote, or for the controller.
2018-09-19Split routerlist.c into 4 separate modulesNick Mathewson
There are now separate modules for: * the list of router descriptors * the list of authorities and fallbacks * managing authority certificates * selecting random nodes
2018-09-11Replace "read consensus from disk" with "map consensus from disk".Nick Mathewson
Implements 27244, and should save a bunch of RAM on clients.
2018-09-11Stop memcpy'ing uncompressed consensuses when making diffsNick Mathewson
2018-09-11Consdiff: use lengths on inputs so they don't need NUL at the endNick Mathewson
This is part of #27244, so that we can safely mmap consensus documents.
2018-09-10Defer reporting directory bootstrap progressTaylor Yu
Existing cached directory information can cause misleadingly high bootstrap percentages. To improve user experience, defer reporting of directory information progress until at least one connection has succeeded to a relay or bridge. Closes ticket 27169.
2018-08-28Merge branch 'bug26367_035_01'Nick Mathewson
2018-08-28hs: Render obsolete Tor2webDavid Goulet
Remove support for Tor2web in the code and build system. At this commit, tor doesn't have Tor2web support anymore. Ref: https://lists.torproject.org/pipermail/tor-dev/2018-July/013295.html Close #26367 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-08-28Merge branch 'bug26896_034'Nick Mathewson
2018-07-30Merge remote-tracking branch 'juga/ticket3723_03_squashed_rebased'Nick Mathewson
2018-07-18Add some missing includes and struct declarations.Nick Mathewson