]> granicus.if.org Git - libevent/commitdiff
build: remove splice implementation fragments
authorfanquake <fanquake@gmail.com>
Sun, 28 Mar 2021 02:57:11 +0000 (10:57 +0800)
committerfanquake <fanquake@gmail.com>
Sun, 28 Mar 2021 02:57:11 +0000 (10:57 +0800)
Looks like a `splice` implementation was planned, but has clearly never
eventuated (the TODO comment is from ~12 years ago, in
8b5bd77415fb6634fadf08357676926fecf5f032). For now, it's probably better
to remove the unused code/correct the docs.

CMakeLists.txt
buffer.c
configure.ac
event-config.h.cmake
include/event2/buffer.h
test/regress_buffer.c

index 6d7da58c47495d106e49e60a58b5df1e0bebe373..8fa7968344582d8b4887ef7e0a20de5e13cd9859 100644 (file)
@@ -470,7 +470,6 @@ list(APPEND SYMBOLS_TO_CHECK
     gettimeofday
     signal
     strtoll
-    splice
     strlcpy
     strsep
     strtok_r
index 121b37c009ae76e8f91c8a5d59c3b781fd5dec44..cf5e22c09d3b140952faaf65530b5e0bb074963a 100644 (file)
--- a/buffer.c
+++ b/buffer.c
@@ -2513,7 +2513,6 @@ evbuffer_write_sendfile(struct evbuffer *buffer, evutil_socket_t dest_fd,
 
        return (len);
 #elif defined(SENDFILE_IS_LINUX)
-       /* TODO(niels): implement splice */
        res = sendfile(dest_fd, source_fd, &offset, chain->off);
        if (res == -1 && EVUTIL_ERR_RW_RETRIABLE(errno)) {
                /* if this is EAGAIN or EINTR return 0; otherwise, -1 */
index 5489c0809a7d6fa918d13fa8e4cffb20be185a23..10b803fe42a39b463bb64452bbe09ec281f460ea 100644 (file)
@@ -350,7 +350,6 @@ AC_CHECK_FUNCS([ \
   sigaction \
   signal \
   strsignal \
-  splice \
   strlcpy \
   strsep \
   strtok_r \
index 752e7890f7801ff90a481c7334d83d0ea3c82763..208507b37126ab225c406574af1c1a7c8741dfb1 100644 (file)
 /* Define to 1 if you have the `strsignal' function. */
 #cmakedefine EVENT__HAVE_STRSIGNAL 1
 
-/* Define to 1 if you have the `splice' function. */
-#cmakedefine EVENT__HAVE_SPLICE 1
-
 /* Define to 1 if you have the <stdarg.h> header file. */
 #cmakedefine EVENT__HAVE_STDARG_H 1
 
index a9afc3c62544d2312ec8da9be385d5156443e6c8..5a76cf202a4f686656f40f300036b6ea5c35609a 100644 (file)
@@ -552,10 +552,9 @@ int evbuffer_add_file(struct evbuffer *outbuf, int fd, ev_off_t offset,
 /**
   An evbuffer_file_segment holds a reference to a range of a file --
   possibly the whole file! -- for use in writing from an evbuffer to a
-  socket.  It could be implemented with mmap, sendfile, splice, or (if all
-  else fails) by just pulling all the data into RAM.  A single
-  evbuffer_file_segment can be added more than once, and to more than one
-  evbuffer.
+  socket.  It could be implemented with mmap or sendfile, or (if all else
+  fails) by just pulling all the data into RAM. A single evbuffer_file_segment
+  can be added more than once, and to more than one evbuffer.
  */
 struct evbuffer_file_segment;
 
@@ -572,7 +571,7 @@ struct evbuffer_file_segment;
 #define EVBUF_FS_DISABLE_MMAP     0x02
 /**
    Flag for creating evbuffer_file_segment: Disable direct fd-to-fd
-   implementations (including sendfile and splice).
+   implementations (sendfile).
 
    You might want to use this option if data needs to be taken from the
    evbuffer by any means other than writing it to the network: the sendfile
@@ -600,7 +599,7 @@ typedef void (*evbuffer_file_segment_cleanup_cb)(
    file and sending it out via an evbuffer.
 
    This function avoids unnecessary data copies between userland and
-   kernel.  Where available, it uses sendfile or splice.
+   kernel.  Where available, it uses sendfile.
 
    The file descriptor must not be closed so long as any evbuffer is using
    this segment.
index fca74062f20f3a2f8e226103e80394729d531dcb..acd03ee3a17993cea2bfd2bd2dcb76e1a84301d5 100644 (file)
@@ -1161,8 +1161,7 @@ test_evbuffer_add_file(void *ptr)
                view_from_offset = 1;
        }
        if (strstr(impl, "sendfile")) {
-               /* If sendfile is set, we try to use a sendfile/splice style
-                * backend. */
+               /* If sendfile is set, we try to use a sendfile style backend. */
                flags = EVBUF_FS_DISABLE_MMAP;
                want_cansendfile = 1;
                want_ismapping = 0;