Changeset View
Changeset View
Standalone View
Standalone View
crypto/openssl/include/internal/ktls.h
Show First 20 Lines • Show All 186 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* KTLS enables the sendfile system call to send data from a file over | * KTLS enables the sendfile system call to send data from a file over | ||||
* TLS. | * TLS. | ||||
*/ | */ | ||||
static ossl_inline ossl_ssize_t ktls_sendfile(int s, int fd, off_t off, | static ossl_inline ossl_ssize_t ktls_sendfile(int s, int fd, off_t off, | ||||
size_t size, int flags) | size_t size, int flags) | ||||
{ | { | ||||
off_t sbytes; | off_t sbytes = 0; | ||||
int ret; | int ret; | ||||
ret = sendfile(fd, s, off, size, NULL, &sbytes, flags); | ret = sendfile(fd, s, off, size, NULL, &sbytes, flags); | ||||
if (ret == -1) { | if (ret == -1 && sbytes == 0) | ||||
if (errno == EAGAIN && sbytes != 0) | |||||
return sbytes; | |||||
return -1; | return -1; | ||||
} | |||||
return sbytes; | return sbytes; | ||||
} | } | ||||
# endif /* __FreeBSD__ */ | # endif /* __FreeBSD__ */ | ||||
# if defined(OPENSSL_SYS_LINUX) | # if defined(OPENSSL_SYS_LINUX) | ||||
# include <linux/tls.h> | # include <linux/tls.h> | ||||
▲ Show 20 Lines • Show All 192 Lines • Show Last 20 Lines |