dircache_stub.c (1489B)
1 /* Copyright (c) 2001-2004, Roger Dingledine. 2 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson. 3 * Copyright (c) 2007-2021, The Tor Project, Inc. */ 4 /* See LICENSE for licensing information */ 5 6 /** 7 * @file dircache_stub.c 8 * @brief Stub declarations for use when dircache module is disabled. 9 **/ 10 11 #include "core/or/or.h" 12 #include "feature/dircache/consdiffmgr.h" 13 #include "feature/dircache/dircache.h" 14 #include "feature/dircache/dirserv.h" 15 #include "feature/dircommon/dir_connection_st.h" 16 17 DISABLE_GCC_WARNING("-Wmissing-noreturn") 18 int 19 directory_handle_command(dir_connection_t *conn) 20 { 21 (void) conn; 22 tor_assert_nonfatal_unreached_once(); 23 return -1; 24 } 25 26 int 27 connection_dirserv_flushed_some(dir_connection_t *conn) 28 { 29 (void) conn; 30 tor_assert_nonfatal_unreached_once(); 31 return -1; 32 } 33 ENABLE_GCC_WARNING("-Wmissing-noreturn") 34 35 void 36 dir_conn_clear_spool(dir_connection_t *conn) 37 { 38 if (!conn) 39 return; 40 tor_assert_nonfatal_once(conn->spool == NULL); 41 } 42 43 void 44 consdiffmgr_enable_background_compression(void) 45 { 46 } 47 48 int 49 consdiffmgr_add_consensus(const char *consensus, 50 size_t consensus_len, 51 const networkstatus_t *as_parsed) 52 { 53 (void)consensus; 54 (void)consensus_len; 55 (void)as_parsed; 56 return 0; 57 } 58 59 int 60 consdiffmgr_register_with_sandbox(struct sandbox_cfg_elem_t **cfg) 61 { 62 (void)cfg; 63 return 0; 64 } 65 66 int 67 consdiffmgr_cleanup(void) 68 { 69 return 0; 70 } 71 72 void 73 consdiffmgr_free_all(void) 74 { 75 } 76 77 void 78 dirserv_free_all(void) 79 { 80 }