Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benjamin J. Thompson
Tor
Commits
54ef039b
Commit
54ef039b
authored
12 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge branch 'bug5263_023'
parents
37ef4f16
9c588730
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changes/bug5263
+5
-0
5 additions, 0 deletions
changes/bug5263
src/or/main.c
+24
-0
24 additions, 0 deletions
src/or/main.c
with
29 additions
and
0 deletions
changes/bug5263
0 → 100644
+
5
−
0
View file @
54ef039b
o Minor bugfixes:
- Disable writing on marked-for-close connections when they are
blocked on bandwidth, to prevent busy-looping in Libevent. Fixes
bug 5263; bugfix on 0.0.2pre13, where we first added a special
case for flushing marked connections.
This diff is collapsed.
Click to expand it.
src/or/main.c
+
24
−
0
View file @
54ef039b
...
...
@@ -848,6 +848,30 @@ conn_close_if_marked(int i)
"Holding conn (fd %d) open for more flushing."
,
(
int
)
conn
->
s
));
conn
->
timestamp_lastwritten
=
now
;
/* reset so we can flush more */
}
else
if
(
sz
==
0
)
{
/* retval is also 0 */
/* Connection must flush before closing, but it's being rate-limited.
Let's remove from Libevent, and mark it as blocked on bandwidth so it
will be re-added on next token bucket refill. Prevents busy Libevent
loops where we keep ending up here and returning 0 until we are no
longer blocked on bandwidth. */
if
(
connection_is_writing
(
conn
))
{
conn
->
write_blocked_on_bw
=
1
;
connection_stop_writing
(
conn
);
}
if
(
connection_is_reading
(
conn
))
{
#define MARKED_READING_RATE 180
static
ratelim_t
marked_read_lim
=
RATELIM_INIT
(
MARKED_READING_RATE
);
char
*
m
;
if
((
m
=
rate_limit_log
(
&
marked_read_lim
,
now
)))
{
log_warn
(
LD_BUG
,
"Marked connection (fd %d, type %s, state %s) "
"is still reading; that shouldn't happen.%s"
,
(
int
)
conn
->
s
,
conn_type_to_string
(
conn
->
type
),
conn_state_to_string
(
conn
->
type
,
conn
->
state
),
m
);
tor_free
(
m
);
}
conn
->
read_blocked_on_bw
=
1
;
connection_stop_reading
(
conn
);
}
}
return
0
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment