Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
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
The Tor Project
Core
Tor
Commits
70b9e797
Commit
70b9e797
authored
8 years ago
by
David Goulet
Browse files
Options
Downloads
Patches
Plain Diff
Slightly refactor and fix couple callsites
Signed-off-by:
David Goulet
<
dgoulet@torproject.org
>
parent
23b878b8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/or/relay.c
+3
-4
3 additions, 4 deletions
src/or/relay.c
src/or/rendmid.c
+9
-4
9 additions, 4 deletions
src/or/rendmid.c
with
12 additions
and
8 deletions
src/or/relay.c
+
3
−
4
View file @
70b9e797
...
...
@@ -610,14 +610,13 @@ relay_send_command_from_edge_(streamid_t stream_id, circuit_t *circ,
memset
(
&
cell
,
0
,
sizeof
(
cell_t
));
cell
.
command
=
CELL_RELAY
;
if
(
cpath_layer
)
{
if
(
CIRCUIT_IS_ORIGIN
(
circ
))
{
tor_assert
(
cpath_layer
);
cell
.
circ_id
=
circ
->
n_circ_id
;
cell_direction
=
CELL_DIRECTION_OUT
;
}
else
if
(
!
CIRCUIT_IS_ORIGIN
(
circ
))
{
}
else
{
cell
.
circ_id
=
TO_OR_CIRCUIT
(
circ
)
->
p_circ_id
;
cell_direction
=
CELL_DIRECTION_IN
;
}
else
{
tor_assert
(
0
);
}
memset
(
&
rh
,
0
,
sizeof
(
rh
));
...
...
This diff is collapsed.
Click to expand it.
src/or/rendmid.c
+
9
−
4
View file @
70b9e797
...
...
@@ -106,7 +106,7 @@ rend_mid_establish_intro(or_circuit_t *circ, const uint8_t *request,
RELAY_COMMAND_INTRO_ESTABLISHED
,
""
,
0
,
NULL
)
<
0
)
{
log_info
(
LD_GENERAL
,
"Couldn't send INTRO_ESTABLISHED cell."
);
return
-
1
;
goto
err_no_close
;
}
/* Now, set up this circuit. */
...
...
@@ -122,8 +122,9 @@ rend_mid_establish_intro(or_circuit_t *circ, const uint8_t *request,
log_warn
(
LD_PROTOCOL
,
"Rejecting truncated ESTABLISH_INTRO cell."
);
reason
=
END_CIRC_REASON_TORPROTOCOL
;
err:
if
(
pk
)
crypto_pk_free
(
pk
);
circuit_mark_for_close
(
TO_CIRCUIT
(
circ
),
reason
);
err_no_close:
if
(
pk
)
crypto_pk_free
(
pk
);
return
-
1
;
}
...
...
@@ -201,13 +202,15 @@ rend_mid_introduce(or_circuit_t *circ, const uint8_t *request,
(
char
*
)
request
,
request_len
,
NULL
))
{
log_warn
(
LD_GENERAL
,
"Unable to send INTRODUCE2 cell to Tor client."
);
goto
err
;
/* Stop right now, the circuit has been closed. */
return
-
1
;
}
/* And send an ack down the client's circuit. Empty body means succeeded. */
if
(
relay_send_command_from_edge
(
0
,
TO_CIRCUIT
(
circ
),
RELAY_COMMAND_INTRODUCE_ACK
,
NULL
,
0
,
NULL
))
{
log_warn
(
LD_GENERAL
,
"Unable to send INTRODUCE_ACK cell to Tor client."
);
/* Stop right now, the circuit has been closed. */
return
-
1
;
}
...
...
@@ -266,6 +269,7 @@ rend_mid_establish_rendezvous(or_circuit_t *circ, const uint8_t *request,
RELAY_COMMAND_RENDEZVOUS_ESTABLISHED
,
""
,
0
,
NULL
)
<
0
)
{
log_warn
(
LD_PROTOCOL
,
"Couldn't send RENDEZVOUS_ESTABLISHED cell."
);
/* Stop right now, the circuit has been closed. */
return
-
1
;
}
...
...
@@ -342,7 +346,8 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request,
log_warn
(
LD_GENERAL
,
"Unable to send RENDEZVOUS2 cell to client on circuit %u."
,
(
unsigned
)
rend_circ
->
p_circ_id
);
goto
err
;
/* Stop right now, the circuit has been closed. */
return
-
1
;
}
/* Join the circuits. */
...
...
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