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
d780cd5f
Commit
d780cd5f
authored
11 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge branch 'circuit_queue_cap-0.2.3-squashed' into maint-0.2.3
parents
4835faeb
9e8c104a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
changes/bug9063
+3
-0
3 additions, 0 deletions
changes/bug9063
src/or/or.h
+9
-0
9 additions, 0 deletions
src/or/or.h
src/or/relay.c
+22
-1
22 additions, 1 deletion
src/or/relay.c
with
34 additions
and
1 deletion
changes/bug9063
0 → 100644
+
3
−
0
View file @
d780cd5f
o Normal bugfixes:
- Close any circuit that has more cells queued than the spec permits.
Fixes bug #9063; bugfix on 0.2.3.25.
This diff is collapsed.
Click to expand it.
src/or/or.h
+
9
−
0
View file @
d780cd5f
...
...
@@ -539,6 +539,8 @@ typedef enum {
#define CIRCUIT_PURPOSE_IS_ESTABLISHED_REND(p) \
((p) == CIRCUIT_PURPOSE_C_REND_JOINED || \
(p) == CIRCUIT_PURPOSE_S_REND_JOINED)
/** True iff the circuit_t c is actually an or_circuit_t */
#define CIRCUIT_IS_ORCIRC(c) (((circuit_t *)(c))->magic == OR_CIRCUIT_MAGIC)
/** How many circuits do we want simultaneously in-progress to handle
* a given stream? */
...
...
@@ -814,6 +816,13 @@ typedef enum {
/** Amount to increment a stream window when we get a stream SENDME. */
#define STREAMWINDOW_INCREMENT 50
/** Maximum number of queued cells on a circuit for which we are the
* midpoint before we give up and kill it. This must be >= circwindow
* to avoid killing innocent circuits, and >= circwindow*2 to give
* leaky-pipe a chance for being useful someday.
*/
#define ORCIRC_MAX_MIDDLE_CELLS (21*(CIRCWINDOW_START_MAX)/10)
/* Cell commands. These values are defined in tor-spec.txt. */
#define CELL_PADDING 0
#define CELL_CREATE 1
...
...
This diff is collapsed.
Click to expand it.
src/or/relay.c
+
22
−
1
View file @
d780cd5f
...
...
@@ -2532,8 +2532,10 @@ append_cell_to_circuit_queue(circuit_t *circ, or_connection_t *orconn,
cell_t
*
cell
,
cell_direction_t
direction
,
streamid_t
fromstream
)
{
or_circuit_t
*
orcirc
=
NULL
;
cell_queue_t
*
queue
;
int
streams_blocked
;
if
(
circ
->
marked_for_close
)
return
;
...
...
@@ -2541,11 +2543,30 @@ append_cell_to_circuit_queue(circuit_t *circ, or_connection_t *orconn,
queue
=
&
circ
->
n_conn_cells
;
streams_blocked
=
circ
->
streams_blocked_on_n_conn
;
}
else
{
or_circuit_t
*
orcirc
=
TO_OR_CIRCUIT
(
circ
);
orcirc
=
TO_OR_CIRCUIT
(
circ
);
queue
=
&
orcirc
->
p_conn_cells
;
streams_blocked
=
circ
->
streams_blocked_on_p_conn
;
}
/* Are we a middle circuit about to exceed ORCIRC_MAX_MIDDLE_CELLS? */
if
((
circ
->
n_conn
!=
NULL
)
&&
CIRCUIT_IS_ORCIRC
(
circ
))
{
orcirc
=
TO_OR_CIRCUIT
(
circ
);
if
(
orcirc
->
p_conn
)
{
if
(
queue
->
n
+
1
>=
ORCIRC_MAX_MIDDLE_CELLS
)
{
/* Queueing this cell would put queue over the cap */
log_warn
(
LD_CIRC
,
"Got a cell exceeding the cap of %u in the %s direction "
"on middle circ ID %u; killing the circuit."
,
ORCIRC_MAX_MIDDLE_CELLS
,
(
direction
==
CELL_DIRECTION_OUT
)
?
"n"
:
"p"
,
(
direction
==
CELL_DIRECTION_OUT
)
?
circ
->
n_circ_id
:
orcirc
->
p_circ_id
);
circuit_mark_for_close
(
circ
,
END_CIRC_REASON_RESOURCELIMIT
);
return
;
}
}
}
cell_queue_append_packed_copy
(
queue
,
cell
);
/* If we have too many cells on the circuit, we should stop reading from
...
...
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