return; /* all good, no need to stop it */
LOG_FN_CONN(conn, (LOG_DEBUG, LD_NET, "%s", reason));
- conn->wants_to_read = 1;
+ conn->read_blocked_on_bw = 1;
connection_stop_reading(conn);
}
return; /* all good, no need to stop it */
LOG_FN_CONN(conn, (LOG_DEBUG, LD_NET, "%s", reason));
- conn->wants_to_write = 1;
+ conn->write_blocked_on_bw = 1;
connection_stop_writing(conn);
}
}
}
- if (conn->wants_to_read == 1 /* it's marked to turn reading back on now */
+ if (conn->read_blocked_on_bw == 1 /* marked to turn reading back on now */
&& global_read_bucket > 0 /* and we're allowed to read */
&& (!connection_counts_as_relayed_traffic(conn) ||
global_relayed_read_bucket > 0) /* even if we're relayed traffic */
/* and either a non-cell conn or a cell conn with non-empty bucket */
LOG_FN_CONN(conn, (LOG_DEBUG,LD_NET,
"waking up conn (fd %d) for read", conn->s));
- conn->wants_to_read = 0;
+ conn->read_blocked_on_bw = 0;
connection_start_reading(conn);
}
- if (conn->wants_to_write == 1
+ if (conn->write_blocked_on_bw == 1
&& global_write_bucket > 0 /* and we're allowed to write */
&& (!connection_counts_as_relayed_traffic(conn) ||
global_relayed_write_bucket > 0)) {
/* even if we're relayed traffic */
LOG_FN_CONN(conn, (LOG_DEBUG,LD_NET,
"waking up conn (fd %d) for write", conn->s));
- conn->wants_to_write = 0;
+ conn->write_blocked_on_bw = 0;
connection_start_writing(conn);
}
}
log_debug(LD_NET,"wanted read.");
if (!connection_is_reading(conn)) {
connection_stop_writing(conn);
- conn->wants_to_write = 1;
+ conn->write_blocked_on_bw = 1;
/* we'll start reading again when the next second arrives,
* and then also start writing again.
*/
tor_assert(conn->s < 0);
if (conn->outbuf_flushlen > 0) {
- tor_assert(connection_is_writing(conn) || conn->wants_to_write ||
+ tor_assert(connection_is_writing(conn) || conn->write_blocked_on_bw ||
conn->edge_blocked_on_circ);
}
if (conn->hold_open_until_flushed)
tor_assert(conn->marked_for_close);
- /* XXXX check: wants_to_read, wants_to_write, s, conn_array_index,
+ /* XXXX check: read_blocked_on_bw, write_blocked_on_bw, s, conn_array_index,
* marked_for_close. */
/* buffers */
/* The next fields are all one-bit booleans. Some are only applicable
* to connection subtypes, but we hold them here anyway, to save space.
* (Currently, they all fit into a single byte.) */
- /*XXXX020 rename wants_to_*; the names are misleading. */
- unsigned wants_to_read:1; /**< Boolean: should we start reading again once
- * the bandwidth throttler allows it? */
- unsigned wants_to_write:1; /**< Boolean: should we start writing again once
- * the bandwidth throttler allows reads? */
+ unsigned read_blocked_on_bw:1; /**< Boolean: should we start reading again
+ * once the bandwidth throttler allows it? */
+ unsigned write_blocked_on_bw:1; /**< Boolean: should we start writing again
+ * once the bandwidth throttler allows reads? */
unsigned hold_open_until_flushed:1; /**< Despite this connection's being
* marked for close, do we flush it
* before closing it? */