Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions cups/tls-openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1720,7 +1720,15 @@ _httpTLSRead(http_t *http, // I - Connection to server

DEBUG_printf("7_httpTLSRead(http=%p, buf=%p, len=%d) returning %d", (void *)http, (void *)buf, len, bytes);

return (bytes);
if (bytes > 0)
return (bytes);

if (SSL_get_error(http->tls, bytes) == SSL_ERROR_WANT_READ)
errno = EAGAIN;
else
errno = EPIPE;

return (-1);
}


Expand Down Expand Up @@ -2053,7 +2061,19 @@ _httpTLSWrite(http_t *http, // I - Connection to server
const char *buf, // I - Buffer holding data
int len) // I - Length of buffer
{
return (SSL_write(http->tls, buf, len));
int bytes;

bytes = SSL_write(http->tls, buf, len);

if (bytes > 0)
return (bytes);

if (SSL_get_error(http->tls, bytes) == SSL_ERROR_WANT_WRITE)
errno = EAGAIN;
else
errno = EPIPE;

return (-1);
}


Expand Down
Loading