Github user SolidWallOfCode commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/673#discussion_r64913857
  
    --- Diff: iocore/net/UnixNetVConnection.cc ---
    @@ -545,57 +545,61 @@ write_to_net_io(NetHandler *nh, UnixNetVConnection 
*vc, EThread *thread)
         vc->write.triggered = 0;
         write_signal_error(nh, vc, (int)-r);
         return;
    -  } else {
    -    int wbe_event = vc->write_buffer_empty_event; // save so we can clear 
if needed.
    +  }
     
    -    NET_SUM_DYN_STAT(net_write_bytes_stat, r);
    +  int wbe_event = vc->write_buffer_empty_event; // save so we can clear if 
needed.
     
    -    // Remove data from the buffer and signal continuation.
    -    ink_assert(buf.reader()->read_avail() >= r);
    -    buf.reader()->consume(r);
    -    ink_assert(buf.reader()->read_avail() >= 0);
    -    s->vio.ndone += r;
    +  NET_SUM_DYN_STAT(net_write_bytes_stat, r);
     
    -    // If the empty write buffer trap is set, clear it.
    -    if (!(buf.reader()->is_read_avail_more_than(0)))
    -      vc->write_buffer_empty_event = 0;
    +  // Remove data from the buffer and signal continuation.
    +  ink_assert(buf.reader()->read_avail() >= r);
    --- End diff --
    
    Use `is_read_avail_more_than(r)` and `is_read_avail_more_than(0)`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to