From e076a1987b054f0fe3eaec696b26129c925908b9 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sat, 17 Dec 2022 16:17:05 +0000 Subject: [PATCH] minor code touch-up --- lib/http-file.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/http-file.c b/lib/http-file.c index eaa9731..926c16d 100644 --- a/lib/http-file.c +++ b/lib/http-file.c @@ -663,7 +663,6 @@ static HIO_INLINE int process_range_header (file_t* file, hio_htre_t* req, int* return -1; } } - } else { @@ -680,7 +679,6 @@ static int open_peer_with_mode (file_t* file, const hio_bch_t* actual_file, int { struct stat st; const hio_bch_t* opened_file; - flags |= O_NONBLOCK; #if defined(O_CLOEXEC) @@ -714,6 +712,19 @@ static int open_peer_with_mode (file_t* file, const hio_bch_t* actual_file, int file->peer = alt_fd; opened_file = alt_file; } + else + { + #if 0 + /* TODO: switch to directory listing if it's enabled */ + DIR* dp; + dp = opendir(actual_file); + if (dp) + { + close (file->peer); + file->peer = dp; + } + #endif + } } }