Skip to content

Commit 56d1242

Browse files
committed
tls-gnutls.c: Do not check for errno after I/O operations
Based on gnutls_record_send/recv man pages, we should use the return value of the functions as indicator what happened in the function and do not look into errno at all. Checking the errno value caused infinity loop in cupsd on busy servers if there were enough connection errors when cupsd wrote the response. The patch is provided by Paul Zirnik from SUSE - thank you for the patch! Fixes #827
1 parent ebd5109 commit 56d1242

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cups/tls-gnutls.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,7 +1613,7 @@ _httpTLSRead(http_t *http, // I - Connection to server
16131613

16141614
result = gnutls_record_recv(http->tls, buf, (size_t)len);
16151615

1616-
if (result < 0 && !errno)
1616+
if (result < 0)
16171617
{
16181618
// Convert GNU TLS error to errno value...
16191619
switch (result)
@@ -2022,7 +2022,7 @@ _httpTLSWrite(http_t *http, // I - Connection to server
20222022

20232023
result = gnutls_record_send(http->tls, buf, (size_t)len);
20242024

2025-
if (result < 0 && !errno)
2025+
if (result < 0)
20262026
{
20272027
// Convert GNU TLS error to errno value...
20282028
switch (result)

0 commit comments

Comments
 (0)