cfengine/core — pull request #1949 by jimis (2014-09-02 14:13:54+00:00)
Title: TLSRecv clarifications

Here is a round of clean-ups triggered by @ediosyncratic's comments about whether SSL_read() can return partial reads.

My verdict is that yes this is legal (and as a result it is legal for TLSRecv() as well), and this will be the case if the opposite side did an SSL_write() of smaller size than what we are reading, or smaller than TLS record size (16KB).

But given that we are using SSL_MODE_AUTO_RETRY and that our SendTransaction() never sends more than 4KB of payload (which is smaller than the TLS record size), ReceiveTransaction() should never get partial transaction payload.