Fix AsyncSocket::handleRead
authorSarang Masti <mssarang@fb.com>
Wed, 27 May 2015 03:19:36 +0000 (20:19 -0700)
committerNoam Lerner <noamler@fb.com>
Wed, 3 Jun 2015 16:47:44 +0000 (09:47 -0700)
commitf92ce30d990d2e8d90a056401b8e58459f733409
tree8e96b610beea3329713a1537dfdd2fe6fc0310ca
parent23bc29b8109d9dc11793367f6bdcfa1962471c27
Fix AsyncSocket::handleRead

Summary:
If openssl has buffered data read from the socket, we might not get a
read event on the socket. So, we must schedule a readCallback to ensure
before exiting from AsyncSocket::handleRead if we have exhausted the
maxReadsPerEvent_ limit.

Test Plan: -- modifying existing test to test this corner case.

Reviewed By: davejwatson@fb.com

Subscribers: net-systems@, trunkagent, folly-diffs@, yfeldblum, chalfant

FB internal diff: D2102601

Tasks: 7168699

Signature: t1:2102601:1432837605:82e72a2a1875c08c9c1e8e831796c9c90df927fa
folly/io/async/AsyncSocket.cpp
folly/io/async/AsyncSocket.h
folly/io/async/test/AsyncSSLSocketTest.cpp
folly/io/async/test/AsyncSSLSocketTest.h