Fix incorrect bytesWritten computation in AsyncSocket
authorTiho Tarnavski <tihot@fb.com>
Tue, 29 Nov 2016 23:41:06 +0000 (15:41 -0800)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Tue, 29 Nov 2016 23:53:28 +0000 (15:53 -0800)
commit59a501cff93ae2ac4751f3b49f00f8937301e404
treee31378950b651e37d3673ea8313ec112b94bd9b8
parentee43735cc06a4243e6676b332035927715643be7
Fix incorrect bytesWritten computation in AsyncSocket

Summary: If a write request is buffered after a partial write, then bytes written is not updated after subsequent write operations (`performWrite`) for the buffered write request (`BytesWriteRequest`). This results in a wrong value for totalBytesWritten_, which is reported in the error callback in case the write request fails.

Reviewed By: yfeldblum

Differential Revision: D4205743

fbshipit-source-id: f77ca55ccfdceda1008c45e72ec093b00bf250e4
folly/io/async/AsyncSocket.cpp
folly/io/async/test/AsyncSocketTest.h
folly/io/async/test/AsyncSocketTest2.cpp