summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/s_server.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/s_server.c b/apps/s_server.c
index 5ab58aebfa..acf577180a 100644
--- a/apps/s_server.c
+++ b/apps/s_server.c
@@ -2992,6 +2992,9 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
int total_bytes = 0;
#endif
int width;
+#ifndef OPENSSL_NO_KTLS
+ int use_sendfile_for_req = use_sendfile;
+#endif
fd_set readfds;
const char *opmode;
#ifdef CHARSET_EBCDIC
@@ -3329,7 +3332,11 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
}
/* send the file */
#ifndef OPENSSL_NO_KTLS
- if (use_sendfile) {
+ if (use_sendfile_for_req && !BIO_get_ktls_send(SSL_get_wbio(con))) {
+ BIO_printf(bio_err, "Warning: sendfile requested but KTLS is not available\n");
+ use_sendfile_for_req = 0;
+ }
+ if (use_sendfile_for_req) {
FILE *fp = NULL;
int fd;
struct stat st;