]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge branch 'ticket7356_squashed'
authorNick Mathewson <nickm@torproject.org>
Sun, 21 Dec 2014 19:48:53 +0000 (14:48 -0500)
committerNick Mathewson <nickm@torproject.org>
Sun, 21 Dec 2014 19:48:53 +0000 (14:48 -0500)
1  2 
src/or/channel.c
src/or/channel.h
src/or/channeltls.c
src/or/circuitbuild.c
src/or/circuitlist.c
src/or/connection.c
src/or/connection_or.c

index 5ee07488026e0eaafda9686b34b317ecb99a6c0a,5651bb4b27e99d81350bda466b209a3b86d7bc25..4826bdd0a72ae2547977849ece2630c167b07f73
@@@ -1772,12 -1664,9 +1743,12 @@@ channel_write_cell_queue_entry(channel_
      }
    }
  
 +  /* For statistical purposes, figure out how big this cell is */
 +  cell_bytes = channel_get_cell_queue_entry_size(chan, q);
 +
    /* Can we send it right out?  If so, try */
    if (TOR_SIMPLEQ_EMPTY(&chan->outgoing_queue) &&
-       chan->state == CHANNEL_STATE_OPEN) {
+       CHANNEL_IS_OPEN(chan)) {
      /* Pick the right write function for this cell type and save the result */
      switch (q->type) {
        case CELL_QUEUE_FIXED:
       */
      tmp = cell_queue_entry_dup(q);
      TOR_SIMPLEQ_INSERT_TAIL(&chan->outgoing_queue, tmp, next);
 +    /* Update global counters */
 +    ++n_channel_cells_queued;
 +    ++n_channel_cells_in_queues;
 +    n_channel_bytes_queued += cell_bytes;
 +    n_channel_bytes_in_queues += cell_bytes;
 +    channel_assert_counter_consistency();
 +    /* Update channel queue size */
 +    chan->bytes_in_queue += cell_bytes;
      /* Try to process the queue? */
-     if (chan->state == CHANNEL_STATE_OPEN) channel_flush_cells(chan);
+     if (CHANNEL_IS_OPEN(chan)) channel_flush_cells(chan);
    }
  }
  
@@@ -2302,15 -2098,11 +2273,15 @@@ channel_flush_some_cells_from_outgoing_
    if (!unlimited && num_cells <= flushed) return 0;
  
    /* If we aren't in CHANNEL_STATE_OPEN, nothing goes through */
-   if (chan->state == CHANNEL_STATE_OPEN) {
+   if (CHANNEL_IS_OPEN(chan)) {
      while ((unlimited || num_cells > flushed) &&
             NULL != (q = TOR_SIMPLEQ_FIRST(&chan->outgoing_queue))) {
 +      free_q = 0;
 +      handed_off = 0;
  
        if (1) {
 +        /* Figure out how big it is for statistical purposes */
 +        cell_size = channel_get_cell_queue_entry_size(chan, q);
          /*
           * Okay, we have a good queue entry, try to give it to the lower
           * layer.
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge