[ 
https://issues.apache.org/jira/browse/TS-4804?focusedWorklogId=27765&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27765
 ]

ASF GitHub Bot logged work on TS-4804:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/Sep/16 19:14
            Start Date: 01/Sep/16 19:14
    Worklog Time Spent: 10m 
      Work Description: Github user zwoop commented on the issue:

    https://github.com/apache/trafficserver/pull/952
  
    [approve ci]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 27765)
    Time Spent: 50m  (was: 40m)

> Incorrect write.vio.ndone
> -------------------------
>
>                 Key: TS-4804
>                 URL: https://issues.apache.org/jira/browse/TS-4804
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Core
>            Reporter: Oknet Xu
>            Assignee: Oknet Xu
>             Fix For: 7.0.0
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> {code}
> int64_t
> UnixNetVConnection::load_buffer_and_write(int64_t towrite, MIOBufferAccessor 
> &buf, int64_t &total_written, int &needs)
> {
> ...
>     if (r > 0) {
>       buf.reader()->consume(r);
>     }
>     total_written += r;
> ...
>   return r;
> }
> {code}
> the 'r' is returned from socketManage.writev().
> 'total_written += r;' should be enclosed by if statement because the 'r' may 
> be a negative value otherwise the total_written is incorrect.
> {code}
> void
> write_to_net_io(NetHandler *nh, UnixNetVConnection *vc, EThread *thread)
> {
> ...
>   int64_t r             = vc->load_buffer_and_write(towrite, buf, 
> total_written, needs);
>   if (total_written > 0) {
>     NET_SUM_DYN_STAT(net_write_bytes_stat, total_written);
>     s->vio.ndone += total_written;
>   }
> ...
> }
> {code}
> The incorrect total_written will cause the incorrect of write.vio.ndone.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to