mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 14:51:11 +01:00
For accuracy, s/exit_allows_optimistic_data/may_use_optimistic_data/
This commit is contained in:
parent
6e923ed8cd
commit
cd3709a2b0
3 changed files with 9 additions and 8 deletions
|
@ -739,7 +739,7 @@ circuit_detach_stream(circuit_t *circ, edge_connection_t *conn)
|
||||||
tor_assert(conn);
|
tor_assert(conn);
|
||||||
|
|
||||||
conn->cpath_layer = NULL; /* make sure we don't keep a stale pointer */
|
conn->cpath_layer = NULL; /* make sure we don't keep a stale pointer */
|
||||||
conn->exit_allows_optimistic_data = 0;
|
conn->may_use_optimistic_data = 0;
|
||||||
conn->on_circuit = NULL;
|
conn->on_circuit = NULL;
|
||||||
|
|
||||||
if (CIRCUIT_IS_ORIGIN(circ)) {
|
if (CIRCUIT_IS_ORIGIN(circ)) {
|
||||||
|
@ -1597,13 +1597,13 @@ link_apconn_to_circ(edge_connection_t *apconn, origin_circuit_t *circ,
|
||||||
if (optimistic_data_enabled() &&
|
if (optimistic_data_enabled() &&
|
||||||
circ->_base.purpose == CIRCUIT_PURPOSE_C_GENERAL &&
|
circ->_base.purpose == CIRCUIT_PURPOSE_C_GENERAL &&
|
||||||
exitnode->rs->version_supports_optimistic_data)
|
exitnode->rs->version_supports_optimistic_data)
|
||||||
apconn->exit_allows_optimistic_data = 1;
|
apconn->may_use_optimistic_data = 1;
|
||||||
else
|
else
|
||||||
apconn->exit_allows_optimistic_data = 0;
|
apconn->may_use_optimistic_data = 0;
|
||||||
log_info(LD_APP, "Looks like completed circuit to %s %s allow "
|
log_info(LD_APP, "Looks like completed circuit to %s %s allow "
|
||||||
"optimistic data for connection to %s",
|
"optimistic data for connection to %s",
|
||||||
safe_str_client(node_describe(exitnode)),
|
safe_str_client(node_describe(exitnode)),
|
||||||
apconn->exit_allows_optimistic_data ? "does" : "doesn't",
|
apconn->may_use_optimistic_data ? "does" : "doesn't",
|
||||||
safe_str_client(apconn->socks_request->address));
|
safe_str_client(apconn->socks_request->address));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2372,7 +2372,7 @@ connection_ap_supports_optimistic_data(const edge_connection_t *conn)
|
||||||
conn->on_circuit->purpose != CIRCUIT_PURPOSE_C_GENERAL)
|
conn->on_circuit->purpose != CIRCUIT_PURPOSE_C_GENERAL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return conn->exit_allows_optimistic_data;
|
return conn->may_use_optimistic_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Write a relay begin cell, using destaddr and destport from ap_conn's
|
/** Write a relay begin cell, using destaddr and destport from ap_conn's
|
||||||
|
|
|
@ -1269,9 +1269,10 @@ typedef struct edge_connection_t {
|
||||||
unsigned int is_transparent_ap:1;
|
unsigned int is_transparent_ap:1;
|
||||||
|
|
||||||
/** For AP connections only: Set if this connection's target exit node
|
/** For AP connections only: Set if this connection's target exit node
|
||||||
* allows optimistic data. (That is, data sent on this stream before
|
* allows optimistic data (that is, data sent on this stream before
|
||||||
* the exit has sent a CONNECTED cell.)*/
|
* the exit has sent a CONNECTED cell) and we have chosen to use it.
|
||||||
unsigned int exit_allows_optimistic_data : 1;
|
*/
|
||||||
|
unsigned int may_use_optimistic_data : 1;
|
||||||
|
|
||||||
/** For AP connections only: buffer for data that we have sent
|
/** For AP connections only: buffer for data that we have sent
|
||||||
* optimistically, which we might need to re-send if we have to
|
* optimistically, which we might need to re-send if we have to
|
||||||
|
|
Loading…
Add table
Reference in a new issue