mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 05:33:47 +01:00
Turn some warnings into bugs and non-fatal asserts.
This commit is contained in:
parent
91da032e9c
commit
fee95dabcf
@ -3566,10 +3566,8 @@ int
|
|||||||
connection_edge_is_rendezvous_stream(const edge_connection_t *conn)
|
connection_edge_is_rendezvous_stream(const edge_connection_t *conn)
|
||||||
{
|
{
|
||||||
tor_assert(conn);
|
tor_assert(conn);
|
||||||
|
/* It should not be possible to set both of these structs */
|
||||||
if (BUG(conn->rend_data && conn->hs_ident)) {
|
tor_assert_nonfatal(!(conn->rend_data && conn->hs_ident));
|
||||||
log_warn(LD_BUG, "Connection has both rend_data and hs_ident...");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (conn->rend_data || conn->hs_ident) {
|
if (conn->rend_data || conn->hs_ident) {
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -23,8 +23,8 @@ rend_circuit_validate_purpose(unsigned int circ_purpose, int is_service_side)
|
|||||||
{
|
{
|
||||||
if (is_service_side) {
|
if (is_service_side) {
|
||||||
if (circ_purpose != CIRCUIT_PURPOSE_S_CONNECT_REND) {
|
if (circ_purpose != CIRCUIT_PURPOSE_S_CONNECT_REND) {
|
||||||
log_warn(LD_GENERAL, "HS e2e circuit setup with wrong purpose(%d)",
|
log_fn(LOG_PROTOCOL_WARN, LD_GENERAL,
|
||||||
circ_purpose);
|
"HS e2e circuit setup with wrong purpose(%d)", circ_purpose);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -32,8 +32,8 @@ rend_circuit_validate_purpose(unsigned int circ_purpose, int is_service_side)
|
|||||||
if (!is_service_side) {
|
if (!is_service_side) {
|
||||||
if (circ_purpose != CIRCUIT_PURPOSE_C_REND_READY &&
|
if (circ_purpose != CIRCUIT_PURPOSE_C_REND_READY &&
|
||||||
circ_purpose != CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED) {
|
circ_purpose != CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED) {
|
||||||
log_warn(LD_GENERAL, "Client e2e circuit setup with wrong purpose(%d)",
|
log_fn(LOG_PROTOCOL_WARN, LD_GENERAL,
|
||||||
circ_purpose);
|
"Client e2e circuit setup with wrong purpose(%d)", circ_purpose);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user