-
Notifications
You must be signed in to change notification settings - Fork 951
Ticket33072 043 02 #1804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dgoulet-tor
wants to merge
7
commits into
torproject:maint-0.4.3
Choose a base branch
from
dgoulet-tor:ticket33072_043_02
base: maint-0.4.3
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Ticket33072 043 02 #1804
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3af832c
dirauth: Always answer compressed directory requests
dgoulet-tor fea32cc
dirauth: Add option AuthDirRejectUncompressedRequests
dgoulet-tor 4b06cbb
test: Tests AuthDirRejectUncompressedRequests
dgoulet-tor 0c1ab3c
fixup! dirauth: Add option AuthDirRejectUncompressedRequests
dgoulet-tor 7c12693
fixup! dirauth: Always answer compressed directory requests
dgoulet-tor 0030806
fixup! dirauth: Add option AuthDirRejectUncompressedRequests
dgoulet-tor 7f86192
fixup! dirauth: Add option AuthDirRejectUncompressedRequests
dgoulet-tor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
o Minor bugfix (directory authority): | ||
- Always allow compressed directory requests and introduce option | ||
AuthDirRejectUncompressedRequests to control that behavior. Fixes bug | ||
33072; bugfix on 0.1.2.5-alpha. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3277,8 +3277,11 @@ connection_bucket_write_limit(connection_t *conn, time_t now) | |
* shouldn't send <b>attempt</b> bytes of low-priority directory stuff | ||
* out to <b>conn</b>. | ||
* | ||
* If we are a directory authority, always answer dir requests thus true is | ||
* always returned. | ||
* If we are a directory authority, false is returned (indicating that we | ||
* should answer the request) if one of these conditions is met: | ||
* - Connection is from a known relay (address is looked up). | ||
* - AuthDirRejectRequestsUnderLoad is set to 0. | ||
* - Compression is being used for the request (looking at c_method). | ||
Comment on lines
+3280
to
+3284
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment doesn't match what the code does. |
||
* | ||
* Note: There are a lot of parameters we could use here: | ||
* - global_relayed_write_bucket. Low is bad. | ||
|
@@ -3293,14 +3296,21 @@ connection_bucket_write_limit(connection_t *conn, time_t now) | |
* that's harder to quantify and harder to keep track of. | ||
*/ | ||
bool | ||
connection_dir_is_global_write_low(const connection_t *conn, size_t attempt) | ||
connection_dir_is_global_write_low(const connection_t *conn, size_t attempt, | ||
const compress_method_t c_method) | ||
{ | ||
size_t smaller_bucket = | ||
MIN(token_bucket_rw_get_write(&global_bucket), | ||
token_bucket_rw_get_write(&global_relayed_bucket)); | ||
|
||
/* Special case for authorities (directory only). */ | ||
if (authdir_mode_v3(get_options())) { | ||
/* If this requests is uncompressed and we are configured to reject those, | ||
* indicate that we have reached the limit thus deny answering. */ | ||
if (c_method == NO_METHOD && | ||
dirauth_should_reject_uncompressed_requests()) { | ||
return true; | ||
} | ||
/* Are we configured to possibly reject requests under load? */ | ||
if (!dirauth_should_reject_requests_under_load()) { | ||
/* Answer request no matter what. */ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, the changes file is out of sync as well.
We let AuthDirRejectRequestsUnderLoad and the bandwidth buckets decide about compressed requests.