Github user shinrich commented on a diff in the pull request: https://github.com/apache/trafficserver/pull/629#discussion_r64992940 --- Diff: iocore/net/SSLNetVConnection.cc --- @@ -193,131 +193,121 @@ ssl_read_from_net(SSLNetVConnection *sslvc, EThread *lthread, int64_t &ret) { NetState *s = &sslvc->read; MIOBufferAccessor &buf = s->vio.buffer; - IOBufferBlock *b = buf.writer()->first_write_block(); int event = SSL_READ_ERROR_NONE; int64_t bytes_read = 0; - int64_t block_write_avail = 0; ssl_error_t sslErr = SSL_ERROR_NONE; int64_t nread = 0; bool trace = sslvc->getSSLTrace(); Debug("ssl", "trace=%s", trace ? "TRUE" : "FALSE"); - for (bytes_read = 0; (b != 0) && (sslErr == SSL_ERROR_NONE); b = b->next.get()) { - block_write_avail = b->write_avail(); + bytes_read = 0; + while (sslErr == SSL_ERROR_NONE) { + int64_t block_write_avail = buf.writer()->block_write_avail(); + if (block_write_avail <= 0) { + buf.writer()->add_block(); + block_write_avail = buf.writer()->block_write_avail(); + if (block_write_avail <= 0) { + Warning("Cannot add new block"); + break; + } + } --- End diff -- Good point. Looking at the non-ssl version, it is tracking a max to read. We should do something similar in the ssl-case.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---