TS-1320 Reading from SSL origin can starve sending data to client
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a7dec953 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a7dec953 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a7dec953 Branch: refs/heads/3.3.x Commit: a7dec953238d644c43b08c75a06f5b7bbc4b1019 Parents: 93e14b2 Author: William Bardwell <[email protected]> Authored: Mon Feb 25 16:57:15 2013 -0700 Committer: Leif Hedstrom <[email protected]> Committed: Mon Feb 25 16:57:46 2013 -0700 ---------------------------------------------------------------------- iocore/net/SSLNetVConnection.cc | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a7dec953/iocore/net/SSLNetVConnection.cc ---------------------------------------------------------------------- diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc index 1af06d4..ee57ad9 100644 --- a/iocore/net/SSLNetVConnection.cc +++ b/iocore/net/SSLNetVConnection.cc @@ -258,11 +258,11 @@ SSLNetVConnection::net_read_io(NetHandler *nh, EThread *lthread) if (ret == SSL_READ_READY || ret == SSL_READ_ERROR_NONE) { bytes += r; } - - } while (ret == SSL_READ_READY || ret == SSL_READ_ERROR_NONE); + ink_debug_assert(bytes >= 0); + } while ((ret == SSL_READ_READY && bytes == 0) || ret == SSL_READ_ERROR_NONE); if (bytes > 0) { - if (ret == SSL_READ_WOULD_BLOCK) { + if (ret == SSL_READ_WOULD_BLOCK || ret == SSL_READ_READY) { if (readSignalAndUpdate(VC_EVENT_READ_READY) != EVENT_CONT) { Debug("ssl", "ssl_read_from_net, readSignal != EVENT_CONT"); return; @@ -273,8 +273,8 @@ SSLNetVConnection::net_read_io(NetHandler *nh, EThread *lthread) switch (ret) { case SSL_READ_ERROR_NONE: case SSL_READ_READY: - // how did we exit the while loop above? should never happen. - ink_debug_assert(false); + readReschedule(nh); + return; break; case SSL_WRITE_WOULD_BLOCK: case SSL_READ_WOULD_BLOCK:
