If the buffer (batch of queries) passed to gnutls_record_send() exceeds the maximum size of a TLS record (pretty much always 16k), it will only process a part of the buffer and return a value smaller than the requested size. The current code does not handle that case and assumes that all queries have been sent, which is not true, resulting in the remaining queries being counted as timeouts.
This change deals with that case by calling gnutls_record_send() until the buffer has been entirely processed, resulting in several TLS records if needed.
If the buffer (batch of queries) passed to
gnutls_record_send()
exceeds the maximum size of a TLS record (pretty much always 16k), it will only process a part of the buffer and return a value smaller than the requested size. The current code does not handle that case and assumes that all queries have been sent, which is not true, resulting in the remaining queries being counted as timeouts. This change deals with that case by callinggnutls_record_send()
until the buffer has been entirely processed, resulting in several TLS records if needed.