aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-12-21 11:16:00 -0500
committerNick Mathewson <nickm@torproject.org>2017-12-21 11:16:00 -0500
commit2b8a06a2ef23350616df755a32b0e5b87d463314 (patch)
treea87b09fea52dd61a6e182a00b8adb70e0b231212 /src
parent2f0d57db56f87a21e1a927a526c1a82ebd32f9f8 (diff)
parent6cd567d7974e6bf55874f3a6d907feb050144095 (diff)
downloadtor-2b8a06a2ef23350616df755a32b0e5b87d463314.tar.gz
tor-2b8a06a2ef23350616df755a32b0e5b87d463314.zip
Merge branch 'maint-0.3.2'
Diffstat (limited to 'src')
-rw-r--r--src/or/scheduler_kist.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/or/scheduler_kist.c b/src/or/scheduler_kist.c
index 2f91dbc004..a707ab2758 100644
--- a/src/or/scheduler_kist.c
+++ b/src/or/scheduler_kist.c
@@ -298,13 +298,18 @@ update_socket_info_impl, (socket_table_ent_t *ent))
fallback:
/* If all of a sudden we don't have kist support, we just zero out all the
- * variables for this socket since we don't know what they should be.
- * We also effectively allow the socket write as much as it wants to the
- * kernel, effectively returning it to vanilla scheduler behavior. Writes
- * are still limited by the lower layers of Tor: socket blocking, full
- * outbuf, etc. */
+ * variables for this socket since we don't know what they should be. We
+ * also allow the socket to write as much as it can from the estimated
+ * number of cells the lower layer can accept, effectively returning it to
+ * Vanilla scheduler behavior. */
ent->cwnd = ent->unacked = ent->mss = ent->notsent = 0;
- ent->limit = INT_MAX;
+ /* This function calls the specialized channel object (currently channeltls)
+ * and ask how many cells it can write on the outbuf which we then multiply
+ * by the size of the cells for this channel. The cast is because this
+ * function requires a non-const channel object, meh. */
+ ent->limit = channel_num_cells_writeable((channel_t *) ent->chan) *
+ (get_cell_network_size(ent->chan->wide_circ_ids) +
+ TLS_PER_CELL_OVERHEAD);
}
/* Given a socket that isn't in the table, add it.
@@ -398,6 +403,11 @@ update_socket_info(socket_table_t *table, const channel_t *chan)
return; // Whelp. Entry didn't exist for some reason so nothing to do.
}
update_socket_info_impl(ent);
+ log_debug(LD_SCHED, "chan=%" PRIu64 " updated socket info, limit: %" PRIu64
+ ", cwnd: %" PRIu32 ", unacked: %" PRIu32
+ ", notsent: %" PRIu32 ", mss: %" PRIu32,
+ ent->chan->global_identifier, ent->limit, ent->cwnd, ent->unacked,
+ ent->notsent, ent->mss);
}
/* Increment the channel's socket written value by the number of bytes. */