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

Oknet Xu commented on TS-4804:
------------------------------

[~zwoop] the bug only in 7.0.0.

> 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: 40m
>  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