Skip to content
Snippets Groups Projects
Commit 8ca874d7 authored by Guillaume Roguez's avatar Guillaume Roguez
Browse files

tls_session: fix extra packet send by gnutls

Sometimes the gnutls function gnutls_record_send() reports
to have sent more bytes than given.
This is happen if we don't flush the internal state of gnutls records
or if we don't try to loop with same arguments until we get a positive
value or not GNUTLS_E_INTERRUPTED neither GNUTLS_E_AGAIN.
When not done correctly the receiption see 2 packets: one of the
correct size and another with extra bytes, filled with zero's.

This patch fixes this situation by loop on the gnutls send function
until we get a return value different of ones given upper.
We ensure also to return -1 in case of error in low-level send functions.

Change-Id: I209ceba2e25fc7b299c38348cf36801a722af2d7
Tuleap: #798
parent 46285595
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment