r12482@catbus: nickm | 2007-04-21 13:30:24 -0400
Rename a couple of confusing fields svn:r9996
This commit is contained in:
parent
648065fcb4
commit
bbd63a9ae0
|
@ -98,6 +98,7 @@ Changes in version 0.2.0.1-alpha - 2007-??-??
|
||||||
don't get full any more.
|
don't get full any more.
|
||||||
- Make dns_resolve handle attaching connections to circuits properly,
|
- Make dns_resolve handle attaching connections to circuits properly,
|
||||||
so the caller doesn't have to.
|
so the caller doesn't have to.
|
||||||
|
- Rename wants_to_read and wants_to_write to read/write_blocked_on_bw.
|
||||||
|
|
||||||
Changes in version 0.1.2.12-rc - 2007-03-16
|
Changes in version 0.1.2.12-rc - 2007-03-16
|
||||||
o Major bugfixes:
|
o Major bugfixes:
|
||||||
|
|
|
@ -35,8 +35,8 @@ micro-revision.i: FORCE
|
||||||
svn info ../.. | \
|
svn info ../.. | \
|
||||||
sed -n 's/^Revision: \([0-9][0-9]*\).*/"\1"/p' > micro-revision.i \
|
sed -n 's/^Revision: \([0-9][0-9]*\).*/"\1"/p' > micro-revision.i \
|
||||||
|| true; \
|
|| true; \
|
||||||
fi; \
|
else \
|
||||||
if test ! -f micro-revision.i -a x`which svk` != x; then\
|
if test x`which svk` != x; then \
|
||||||
location=../..; \
|
location=../..; \
|
||||||
rev=x; \
|
rev=x; \
|
||||||
while test x$$rev = xx; do \
|
while test x$$rev = xx; do \
|
||||||
|
@ -59,6 +59,7 @@ micro-revision.i: FORCE
|
||||||
echo \"$$rev\" > micro-revision.i; \
|
echo \"$$rev\" > micro-revision.i; \
|
||||||
fi; \
|
fi; \
|
||||||
fi; \
|
fi; \
|
||||||
|
fi; \
|
||||||
if test ! -f micro-revision.i; then \
|
if test ! -f micro-revision.i; then \
|
||||||
echo '""' > micro-revision.i; \
|
echo '""' > micro-revision.i; \
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1354,7 +1354,7 @@ connection_consider_empty_read_buckets(connection_t *conn)
|
||||||
return; /* all good, no need to stop it */
|
return; /* all good, no need to stop it */
|
||||||
|
|
||||||
LOG_FN_CONN(conn, (LOG_DEBUG, LD_NET, "%s", reason));
|
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);
|
connection_stop_reading(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1380,7 +1380,7 @@ connection_consider_empty_write_buckets(connection_t *conn)
|
||||||
return; /* all good, no need to stop it */
|
return; /* all good, no need to stop it */
|
||||||
|
|
||||||
LOG_FN_CONN(conn, (LOG_DEBUG, LD_NET, "%s", reason));
|
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);
|
connection_stop_writing(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1468,7 +1468,7 @@ connection_bucket_refill(int seconds_elapsed)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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 */
|
&& global_read_bucket > 0 /* and we're allowed to read */
|
||||||
&& (!connection_counts_as_relayed_traffic(conn) ||
|
&& (!connection_counts_as_relayed_traffic(conn) ||
|
||||||
global_relayed_read_bucket > 0) /* even if we're relayed traffic */
|
global_relayed_read_bucket > 0) /* even if we're relayed traffic */
|
||||||
|
@ -1478,18 +1478,18 @@ connection_bucket_refill(int seconds_elapsed)
|
||||||
/* and either a non-cell conn or a cell conn with non-empty bucket */
|
/* and either a non-cell conn or a cell conn with non-empty bucket */
|
||||||
LOG_FN_CONN(conn, (LOG_DEBUG,LD_NET,
|
LOG_FN_CONN(conn, (LOG_DEBUG,LD_NET,
|
||||||
"waking up conn (fd %d) for read", conn->s));
|
"waking up conn (fd %d) for read", conn->s));
|
||||||
conn->wants_to_read = 0;
|
conn->read_blocked_on_bw = 0;
|
||||||
connection_start_reading(conn);
|
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 */
|
&& global_write_bucket > 0 /* and we're allowed to write */
|
||||||
&& (!connection_counts_as_relayed_traffic(conn) ||
|
&& (!connection_counts_as_relayed_traffic(conn) ||
|
||||||
global_relayed_write_bucket > 0)) {
|
global_relayed_write_bucket > 0)) {
|
||||||
/* even if we're relayed traffic */
|
/* even if we're relayed traffic */
|
||||||
LOG_FN_CONN(conn, (LOG_DEBUG,LD_NET,
|
LOG_FN_CONN(conn, (LOG_DEBUG,LD_NET,
|
||||||
"waking up conn (fd %d) for write", conn->s));
|
"waking up conn (fd %d) for write", conn->s));
|
||||||
conn->wants_to_write = 0;
|
conn->write_blocked_on_bw = 0;
|
||||||
connection_start_writing(conn);
|
connection_start_writing(conn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1893,7 +1893,7 @@ connection_handle_write(connection_t *conn, int force)
|
||||||
log_debug(LD_NET,"wanted read.");
|
log_debug(LD_NET,"wanted read.");
|
||||||
if (!connection_is_reading(conn)) {
|
if (!connection_is_reading(conn)) {
|
||||||
connection_stop_writing(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,
|
/* we'll start reading again when the next second arrives,
|
||||||
* and then also start writing again.
|
* and then also start writing again.
|
||||||
*/
|
*/
|
||||||
|
@ -2540,14 +2540,14 @@ assert_connection_ok(connection_t *conn, time_t now)
|
||||||
tor_assert(conn->s < 0);
|
tor_assert(conn->s < 0);
|
||||||
|
|
||||||
if (conn->outbuf_flushlen > 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);
|
conn->edge_blocked_on_circ);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conn->hold_open_until_flushed)
|
if (conn->hold_open_until_flushed)
|
||||||
tor_assert(conn->marked_for_close);
|
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. */
|
* marked_for_close. */
|
||||||
|
|
||||||
/* buffers */
|
/* buffers */
|
||||||
|
|
|
@ -748,11 +748,10 @@ typedef struct connection_t {
|
||||||
/* The next fields are all one-bit booleans. Some are only applicable
|
/* The next fields are all one-bit booleans. Some are only applicable
|
||||||
* to connection subtypes, but we hold them here anyway, to save space.
|
* to connection subtypes, but we hold them here anyway, to save space.
|
||||||
* (Currently, they all fit into a single byte.) */
|
* (Currently, they all fit into a single byte.) */
|
||||||
/*XXXX020 rename wants_to_*; the names are misleading. */
|
unsigned read_blocked_on_bw:1; /**< Boolean: should we start reading again
|
||||||
unsigned wants_to_read:1; /**< Boolean: should we start reading again once
|
* once the bandwidth throttler allows it? */
|
||||||
* the bandwidth throttler allows it? */
|
unsigned write_blocked_on_bw:1; /**< Boolean: should we start writing again
|
||||||
unsigned wants_to_write:1; /**< Boolean: should we start writing again once
|
* once the bandwidth throttler allows reads? */
|
||||||
* the bandwidth throttler allows reads? */
|
|
||||||
unsigned hold_open_until_flushed:1; /**< Despite this connection's being
|
unsigned hold_open_until_flushed:1; /**< Despite this connection's being
|
||||||
* marked for close, do we flush it
|
* marked for close, do we flush it
|
||||||
* before closing it? */
|
* before closing it? */
|
||||||
|
|
Loading…
Reference in New Issue