secur32: Properly handle GNUTLS_E_AGAIN in (GnuTLS) schan_imp_recv().

This commit is contained in:
Henri Verbeet 2011-10-03 20:22:51 +02:00 committed by Alexandre Julliard
parent 65aed972c0
commit 929598fd00
1 changed files with 13 additions and 1 deletions

View File

@ -371,11 +371,23 @@ SECURITY_STATUS schan_imp_recv(schan_imp_session session, void *buffer,
SIZE_T *length) SIZE_T *length)
{ {
gnutls_session_t s = (gnutls_session_t)session; gnutls_session_t s = (gnutls_session_t)session;
ssize_t ret = pgnutls_record_recv(s, buffer, *length); ssize_t ret;
again:
ret = pgnutls_record_recv(s, buffer, *length);
if (ret >= 0) if (ret >= 0)
*length = ret; *length = ret;
else if (ret == GNUTLS_E_AGAIN) else if (ret == GNUTLS_E_AGAIN)
{
struct schan_transport *t = (struct schan_transport *)pgnutls_transport_get_ptr(s);
SIZE_T count = 0;
if (schan_get_buffer(t, &t->in, &count))
goto again;
return SEC_I_CONTINUE_NEEDED; return SEC_I_CONTINUE_NEEDED;
}
else else
{ {
pgnutls_perror(ret); pgnutls_perror(ret);