mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Use END_CIRC_REASON_TORPROTOCOL instead of magic number.
This commit is contained in:
parent
3c0e09ef81
commit
9c239eccc9
3
changes/bug13840
Normal file
3
changes/bug13840
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
o Code simplifications and refactoring:
|
||||||
|
- In connection_exit_begin_conn(), use END_CIRC_REASON_TORPROTOCOL
|
||||||
|
constant instead of hardcoded value. Fixes issue 13840.
|
@ -2461,7 +2461,7 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ)
|
|||||||
|
|
||||||
relay_header_unpack(&rh, cell->payload);
|
relay_header_unpack(&rh, cell->payload);
|
||||||
if (rh.length > RELAY_PAYLOAD_SIZE)
|
if (rh.length > RELAY_PAYLOAD_SIZE)
|
||||||
return -1;
|
return -END_CIRC_REASON_TORPROTOCOL;
|
||||||
|
|
||||||
/* Note: we have to use relay_send_command_from_edge here, not
|
/* Note: we have to use relay_send_command_from_edge here, not
|
||||||
* connection_edge_end or connection_edge_send_command, since those require
|
* connection_edge_end or connection_edge_send_command, since those require
|
||||||
@ -2479,7 +2479,7 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ)
|
|||||||
|
|
||||||
r = begin_cell_parse(cell, &bcell, &end_reason);
|
r = begin_cell_parse(cell, &bcell, &end_reason);
|
||||||
if (r < -1) {
|
if (r < -1) {
|
||||||
return -1;
|
return -END_CIRC_REASON_TORPROTOCOL;
|
||||||
} else if (r == -1) {
|
} else if (r == -1) {
|
||||||
tor_free(bcell.address);
|
tor_free(bcell.address);
|
||||||
relay_send_end_cell_from_edge(rh.stream_id, circ, end_reason, NULL);
|
relay_send_end_cell_from_edge(rh.stream_id, circ, end_reason, NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user