]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Maintenance: Add missing stub_fde.cc (#2359) auto
authorAmos Jeffries <yadij@users.noreply.github.com>
Tue, 20 Jan 2026 06:49:31 +0000 (06:49 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Tue, 27 Jan 2026 14:21:23 +0000 (14:21 +0000)
Also moved `fdNFree()` declaration to `fd.h` (to match its definition
location) and polished its stub's return value.

src/Makefile.am
src/fd.h
src/fde.h
src/stat.cc
src/store.cc
src/tests/Stub.am
src/tests/stub_fd.cc
src/tests/stub_fde.cc [new file with mode: 0644]

index e6bb8997182d4d2b8bf92008f64718c810cd788f..4480764023dcaa9eb8222c7ac6d3f0f787609e45 100644 (file)
@@ -1471,6 +1471,7 @@ nodist_tests_testStore_SOURCES = \
        $(TESTSOURCES) \
        SquidMath.cc \
        SquidMath.h \
+       tests/stub_fde.cc \
        tests/stub_libtime.cc \
        swap_log_op.cc
 tests_testStore_LDADD= \
@@ -1588,8 +1589,7 @@ tests_testDiskIO_SOURCES = \
        fatal.h \
        fd.cc \
        fd.h \
-       fde.cc \
-       fde.h \
+       tests/stub_fde.cc \
        filemap.cc \
        tests/stub_fqdncache.cc \
        fs_io.cc \
@@ -1902,6 +1902,7 @@ tests_testHttpReply_SOURCES = \
        wordlist.h
 nodist_tests_testHttpReply_SOURCES = \
        $(TESTSOURCES) \
+       tests/stub_fde.cc \
        hier_code.cc \
        tests/stub_libtime.cc
 tests_testHttpReply_LDADD=\
index ab15ad07f5b2e20f62df9976325f3f5c3c84a147..f611a293c51be9497e55a88648e82ee584704514 100644 (file)
--- a/src/fd.h
+++ b/src/fd.h
@@ -22,6 +22,7 @@ void fd_open(int fd, unsigned int type, const char *);
 void fd_note(int fd, const char *);
 void fd_bytes(int fd, int len, IoDirection);
 void fdDumpOpen(void);
+int fdNFree(void);
 int fdUsageHigh(void);
 void fdAdjustReserved(void);
 int default_read_method(int, char *, int);
index a839e9dc6c3c534b2b9f857d6c805751f88f5839..38dea7d4b0c018d8d52a4486aedfd125ca10c390 100644 (file)
--- a/src/fde.h
+++ b/src/fde.h
@@ -188,8 +188,6 @@ private:
 
 #define fd_table fde::Table
 
-int fdNFree(void);
-
 inline int
 FD_READ_METHOD(int fd, char *buf, int len)
 {
index 969a7b37519768a365ee15cf1611f12b9af605b3..d713c0504562d28c34e13abd87bd6b32140674b3 100644 (file)
@@ -18,6 +18,7 @@
 #include "comm/Connection.h"
 #include "comm/Loops.h"
 #include "event.h"
+#include "fd.h"
 #include "fde.h"
 #include "format/Token.h"
 #include "globals.h"
index 1331c00f4ed3213782ee1cb00dfda73b82ac8667..b21075480e066ea42eb7f03956515bb51f7a1dd6 100644 (file)
@@ -24,7 +24,7 @@
 #endif
 #include "ETag.h"
 #include "event.h"
-#include "fde.h"
+#include "fd.h"
 #include "globals.h"
 #include "http.h"
 #include "HttpReply.h"
index 4702629605539a13d486bde6b1420894870bb3b2..af657f6dfade01ecbb4fc00648d0f102e90bf384 100644 (file)
@@ -49,6 +49,7 @@ STUB_SOURCE = \
        tests/stub_external_acl.cc \
        tests/stub_fatal.cc \
        tests/stub_fd.cc \
+       tests/stub_fde.cc \
        tests/stub_fqdncache.cc \
        tests/stub_helper.cc \
        tests/stub_http.cc \
index 365f66f75f728f1a130c42c1d6ee494918acac0f..bced0ca392fdc3d0573367f34d2ae628e67546b9 100644 (file)
@@ -17,6 +17,7 @@ void fd_open(int, unsigned int, const char *) STUB
 void fd_note(int, const char *) STUB
 void fd_bytes(int, int, IoDirection) STUB
 void fdDumpOpen() STUB
+int fdNFree() STUB_RETVAL(0)
 int fdUsageHigh() STUB
 void fdAdjustReserved() STUB
 int default_read_method(int, char *, int) STUB_RETVAL(0)
@@ -32,8 +33,3 @@ const char *fdTypeStr[] = {
     "MsgHdr",
     "Unknown"
 };
-
-// XXX: should be in stub_fde.cc
-#include "fde.h"
-fde *fde::Table = nullptr;
-int fdNFree(void) STUB_RETVAL(-1)
diff --git a/src/tests/stub_fde.cc b/src/tests/stub_fde.cc
new file mode 100644 (file)
index 0000000..545ffae
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 1996-2026 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
+#include "squid.h"
+
+#define STUB_API "fde.cc"
+#include "tests/STUB.h"
+
+#include "fde.h"
+void fde::Init() STUB
+void fde::setIo(READ_HANDLER *, WRITE_HANDLER *) STUB
+void fde::useDefaultIo() STUB
+void fde::useBufferedIo(READ_HANDLER *, WRITE_HANDLER *) STUB
+void fde::DumpStats(StoreEntry *) STUB
+char const *fde::remoteAddr() const STUB_RETVAL(nullptr)
+void fde::dumpStats(StoreEntry &, int) const STUB
+bool fde::readPending(int) const STUB_RETVAL(false)
+fde* fde::Table = nullptr;